platform/upstream/llvm.git
3 years ago[BasicAA] Add more tests for non-equal index (NFC)
Nikita Popov [Sat, 5 Dec 2020 20:21:01 +0000 (21:21 +0100)]
[BasicAA] Add more tests for non-equal index (NFC)

3 years ago[TargetMachine] Simplify shouldAssumeDSOLocal by processing ExternalSymbolSDNode...
Fangrui Song [Sat, 5 Dec 2020 19:40:18 +0000 (11:40 -0800)]
[TargetMachine] Simplify shouldAssumeDSOLocal by processing ExternalSymbolSDNode early

The function accrues many `GV` nullness checks. Process `!GV`
(ExternalSymbolSDNode) early to simplify code.

Also improve a comment added in r327198 (intrinsics is a subset of
ExternalSymbolSDNode).

Intended to be NFC.

3 years ago[debugserver] Remove bridgeos availability
Jonas Devlieghere [Sat, 5 Dec 2020 18:17:48 +0000 (10:17 -0800)]
[debugserver] Remove bridgeos availability

I didn't realize that the 'bridgeos' is not part of the public SDK.

3 years ago[X86] Autodetect znver3
Benjamin Kramer [Sat, 5 Dec 2020 18:07:09 +0000 (19:07 +0100)]
[X86] Autodetect znver3

3 years ago[OpenMP][OMPT] Fix OMPT return address guard for gomp interface
Joachim Protze [Thu, 26 Nov 2020 10:55:56 +0000 (11:55 +0100)]
[OpenMP][OMPT] Fix OMPT return address guard for gomp interface

D91692 missed various locations in kmp_gsupport, where the scope for
OMPT_STORE_RETURN_ADDRESS is too narrow, i.e. the scope ends before the OMPT
callback is called in some nested function.

This patch fixes the scoping issue, so that all OMPT tests pass, when the
tests are built with gcc.

Differential Revision: https://reviews.llvm.org/D92121

3 years ago[SystemZ][ZOS] Fix the usage of pthread_t within libc++
Zbigniew Sarbinowski [Sat, 5 Dec 2020 00:13:23 +0000 (00:13 +0000)]
[SystemZ][ZOS] Fix the usage of pthread_t within libc++

This is the the minimal change introduced in [[ https://reviews.llvm.org/D88599 | D88599 ]]  to unblock the controversial change and discussion of proper separation between thread from thread id which will continue in D88599.

This patch will address the differences of definition of pthread_t on z/OS vs. Linux and other OS. Main trick to make the code work on z/OS relies on redefining libcpp_thread_id type and _LIBCPP_NULL_THREAD macro. This is necessary to separate initialization of libcxx_thread_id from the one of __libcxx_thread_t;

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D91875

3 years ago[clang-format] Add option for case sensitive regexes for sorted includes
mydeveloperday [Sat, 5 Dec 2020 16:32:37 +0000 (16:32 +0000)]
[clang-format] Add option for case sensitive regexes for sorted includes

I think the title says everything.

Reviewed By: MyDeveloperDay

Patch By:  HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D91507

3 years ago[NFC][libc++] Update C++20 issues status.
Mark de Wever [Sat, 5 Dec 2020 15:36:19 +0000 (16:36 +0100)]
[NFC][libc++] Update C++20 issues status.

Properly mark LWG1203 as completed and move the version number to the
version column.

3 years ago[NFC][clang-tidy] Fixes comment typos.
Mark de Wever [Sat, 5 Dec 2020 15:31:16 +0000 (16:31 +0100)]
[NFC][clang-tidy] Fixes comment typos.

3 years ago[ConstraintElimination] Wrap dump() call in LLVM_DEBUG (NFC).
Florian Hahn [Sat, 5 Dec 2020 12:55:27 +0000 (12:55 +0000)]
[ConstraintElimination] Wrap dump() call in LLVM_DEBUG (NFC).

ConstraintSystem::dump only generates output with -debug, but there's no
need to call it without -debug.

3 years ago[ConstraintElimination] Handle constraints with all zero var coeffs.
Florian Hahn [Sat, 5 Dec 2020 10:52:50 +0000 (10:52 +0000)]
[ConstraintElimination] Handle constraints with all zero var coeffs.

Constraints where all variable coefficients are 0 do not add any useful
information. When checking, we can check if they are always true/false.

3 years ago[AMDGPU][MC] Improved diagnostics message for sym/expr operands
Dmitry Preobrazhensky [Sat, 5 Dec 2020 10:41:27 +0000 (13:41 +0300)]
[AMDGPU][MC] Improved diagnostics message for sym/expr operands

See bug 48295 (https://bugs.llvm.org/show_bug.cgi?id=48295)

Reviewers: rampitec

Differential Revision: https://reviews.llvm.org/D92088

3 years ago[AA] Initialize Depth member
Nikita Popov [Sat, 5 Dec 2020 10:35:58 +0000 (11:35 +0100)]
[AA] Initialize Depth member

Fix mistake introduced in f8afba5f7a25a69c12191d979d78d40fa6e5b684:
I failed to initialize the Depth member to zero.

3 years ago[AMDGPU][MC] Corrected error position for invalid MOVREL src
Dmitry Preobrazhensky [Sat, 5 Dec 2020 10:21:28 +0000 (13:21 +0300)]
[AMDGPU][MC] Corrected error position for invalid MOVREL src

See bug 47518 (https://bugs.llvm.org/show_bug.cgi?id=47518)

Reviewers: rampitec

Differential Revision: https://reviews.llvm.org/D92084

3 years ago[clang-format] [NFC] keep clang-format tests clang-format clean
mydeveloperday [Sat, 5 Dec 2020 10:14:51 +0000 (10:14 +0000)]
[clang-format] [NFC] keep clang-format tests clang-format clean

I use several of the clang-format clean directories as a test suite, this one had got slightly out of wack in a prior commit

Reviewed By: HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D92666

3 years ago[AA] Add statistics for alias results (NFC)
Nikita Popov [Sat, 5 Dec 2020 09:39:31 +0000 (10:39 +0100)]
[AA] Add statistics for alias results (NFC)

Count how many NoAlias/MustAlias/MayAlias we get from top-level
queries.

3 years ago[BasicAA] Add recphi tests with nested loops (NFC)
Nikita Popov [Fri, 4 Dec 2020 18:05:16 +0000 (19:05 +0100)]
[BasicAA] Add recphi tests with nested loops (NFC)

3 years ago[TargetMachine][CodeGenModule] Delete unneeded ppc32 special case from shouldAssumeDS...
Fangrui Song [Sat, 5 Dec 2020 08:42:07 +0000 (00:42 -0800)]
[TargetMachine][CodeGenModule] Delete unneeded ppc32 special case from shouldAssumeDSOLocal

PPCMCInstLower does not actually call shouldAssumeDSOLocal for ppc32 so this is dead.
Actually Clang ppc32 does produce a pair of absolute relocations which match GCC.

This also fixes a comment (R_PPC_COPY and R_PPC64_COPY do exist).

3 years ago[TargetMachine] Delete wasm special case from shouldAssumeDSOLocal
Fangrui Song [Sat, 5 Dec 2020 07:22:47 +0000 (23:22 -0800)]
[TargetMachine] Delete wasm special case from shouldAssumeDSOLocal

3 years ago[llvm-nm][MachO] Don't call getFlags on redacted symbols
Francis Visoiu Mistrih [Sat, 5 Dec 2020 04:10:06 +0000 (20:10 -0800)]
[llvm-nm][MachO] Don't call getFlags on redacted symbols

Avoid calling getFlags on a non-existent symbol.

The way this is triggered is by calling strip -N on a binary, which sets
the MH_NLIST_OUTOFSYNC_WITH_DYLDINFO header flag. Then, in the
LC_FUNCTION_STARTS command, nm is trying to print the stripped symbols
and needs the proper checks.

3 years ago[AMDGPU] Use llvm::is_contained (NFC)
Kazu Hirata [Sat, 5 Dec 2020 05:42:54 +0000 (21:42 -0800)]
[AMDGPU] Use llvm::is_contained (NFC)

3 years ago[IRCE] Remove unused IsSigned and its accessor (NFC)
Kazu Hirata [Sat, 5 Dec 2020 05:26:12 +0000 (21:26 -0800)]
[IRCE] Remove unused IsSigned and its accessor (NFC)

IsSigned and its accessor, isSigned, were introduced on Oct 25, 2017
in commit 9ac7021a2563d433549a21990f96184d413e69e2.  The last use was
removed on Nov 20, 2017 in commit
268467869b99b15a15f81bf009d31e11536bef39.

3 years ago[RISCV] Formatting for easier reading (NFC)
Hsiangkai Wang [Fri, 4 Dec 2020 07:34:11 +0000 (15:34 +0800)]
[RISCV] Formatting for easier reading (NFC)

Authored-by: Hsiangkai Wang <kai.wang@sifive.com>
3 years ago[mlir][IR] Move the storage for results to before the Operation instead of after.
River Riddle [Sat, 5 Dec 2020 05:01:26 +0000 (21:01 -0800)]
[mlir][IR] Move the storage for results to before the Operation instead of after.

Trailing objects are really nice for storing additional data inline with the main class, and is something that we heavily take advantage of for Operation(and many other classes). To get the address of the inline data you need to compute the address by doing some pointer arithmetic taking into account any objects stored before the object you want to access. Most classes keep the count of the number of objects, so this is relatively cheap to compute. This is not the case for results though, which have two different types(inline and trailing) that are not necessarily as cheap to compute as the count for other objects. This revision moves the storage for results to before the operation and stores them in reverse order. This allows for getting results to still be very fast given that they are never iterated directly in order, and also greatly improves the speed when accessing the other trailing objects of an operation(operands/regions/blocks/etc).

This reduced compile time when compiling a decently sized mlir module by about ~400ms, or 2.17s -> 1.76s.

Differential Revision: https://reviews.llvm.org/D92687

3 years ago[mlir][OpFormatGen] Add support for optional enum attributes
River Riddle [Sat, 5 Dec 2020 04:54:23 +0000 (20:54 -0800)]
[mlir][OpFormatGen] Add support for optional enum attributes

The check for formatting enum attributes was missing a call to get the base attribute, which is necessary to strip off the top-level OptionalAttr<> wrapper.

Differential Revision: https://reviews.llvm.org/D92713

3 years ago[builtins][ARM] Check __ARM_FP instead of __VFP_FP__.
Zhuojia Shen [Sat, 5 Dec 2020 04:53:23 +0000 (20:53 -0800)]
[builtins][ARM] Check __ARM_FP instead of __VFP_FP__.

This patch fixes builtins' CMakeLists.txt and their VFP tests to check
the standard macro defined in the ACLE for VFP support. It also enables
the tests to be built and run for single-precision-only targets while
builtins were built with double-precision support.

Differential revision: https://reviews.llvm.org/D92497

3 years ago[debugserver] Honor the cpu sub type if specified
Jonas Devlieghere [Sat, 5 Dec 2020 04:21:50 +0000 (20:21 -0800)]
[debugserver] Honor the cpu sub type if specified

Use the newly added spawnattr API, posix_spawnattr_setarchpref_np, to
select a slice preferences per cpu and subcpu types, instead of just cpu
with posix_spawnattr_setarchpref_np.

rdar://16094957

Differential revision: https://reviews.llvm.org/D92712

3 years ago[lldb] Remove unused argument to expectedFailure
Jonas Devlieghere [Fri, 4 Dec 2020 17:45:43 +0000 (09:45 -0800)]
[lldb] Remove unused argument to expectedFailure

3 years ago[ELF] Fix relocation-model.ll
Fangrui Song [Sat, 5 Dec 2020 03:33:19 +0000 (19:33 -0800)]
[ELF] Fix relocation-model.ll

3 years ago[TargetMachine] Don't imply dso_local on global variable declarations in Reloc::Stati...
Fangrui Song [Sat, 5 Dec 2020 03:03:40 +0000 (19:03 -0800)]
[TargetMachine] Don't imply dso_local on global variable declarations in Reloc::Static model

clang/lib/CodeGen/CodeGenModule sets dso_local on applicable global variables,
we don't need to duplicate the work in TargetMachine:shouldAssumeDSOLocal.
(Actually the long-term goal (started by r324535) is to remove as much
additional implied dso_local in TargetMachine:shouldAssumeDSOLocal as possible.)

By not implying dso_local, we will respect dso_local/dso_preemptable specifiers
set by the frontend. This allows the proposed -fno-direct-access-external-data
option to work with -fno-pic and prevent copy relocations.

This patch should be NFC in terms of the Clang behavior because the case we
don't set dso_local is a case Clang sets dso_local. However, some tests don't
set dso_local on some `external global` and expose some differences. Most tests
have been fixed to be more robust in previous commits.

3 years ago[test] Split some tests which test both static and pic relocation models
Fangrui Song [Sat, 5 Dec 2020 02:35:45 +0000 (18:35 -0800)]
[test] Split some tests which test both static and pic relocation models

TargetMachine::shouldAssumeDSOLocal currently implies dso_local for
Static. Split some tests so that these `external dso_local global`
will align with the Clang behavior.

3 years ago[RISCV] Use fcvt.h/d/f.w if the input is an assertsexti32 not just when the input...
Craig Topper [Sat, 5 Dec 2020 02:36:14 +0000 (18:36 -0800)]
[RISCV] Use fcvt.h/d/f.w if the input is an assertsexti32 not just when the input is sext_inreg.

3 years ago[NFC][AMDGPU] AMDGPUUsage updates
Tony [Sat, 5 Dec 2020 00:57:21 +0000 (00:57 +0000)]
[NFC][AMDGPU] AMDGPUUsage updates

- Document code object V2 gfx800.
- Document amdpal is supported by Linux Pro.

Differential Revision: https://reviews.llvm.org/D92708

3 years ago[test] Split some tests which test both static and pic relocation models
Fangrui Song [Sat, 5 Dec 2020 02:11:35 +0000 (18:11 -0800)]
[test] Split some tests which test both static and pic relocation models

TargetMachine::shouldAssumeDSOLocal currently implies dso_local for
Static. Split some tests so that these `external dso_local global` will
align with the Clang behavior.

3 years ago[lld][WebAssembly] Add suppport for PIC + passive data initialization
Sam Clegg [Fri, 4 Dec 2020 00:51:56 +0000 (16:51 -0800)]
[lld][WebAssembly] Add suppport for PIC + passive data initialization

This change improves our support for shared memory to include
PIC executables (and shared libraries).

To handle this case the linker-generated `__wasm_init_memory`
function (that only exists in shared memory builds) must be
capable of loading memory segements at non-const offsets based
on the runtime value of `__memory_base`.

Differential Revision: https://reviews.llvm.org/D92620

3 years agoMake __stack_chk_guard dso_local if Reloc::Static
Fangrui Song [Sat, 5 Dec 2020 00:57:45 +0000 (16:57 -0800)]
Make __stack_chk_guard dso_local if Reloc::Static

This is currently implied by TargetMachine::shouldAssumeDSOLocal
but will be changed in the future.

3 years ago[llvm] Update WinMsvc.cmake's fms-compatability to match llvm's prereqs
Nathan Lanza [Fri, 4 Dec 2020 23:52:10 +0000 (15:52 -0800)]
[llvm] Update WinMsvc.cmake's fms-compatability to match llvm's prereqs

llvm's minimum fms-compatability-version was just bumped to 19.14 and
thus the WinMsvc.cmake file needs to be adjusted accordingly.

3 years ago[RISCV] Define preprocessor definitions for 'V' extension.
Hsiangkai Wang [Fri, 4 Dec 2020 12:45:41 +0000 (20:45 +0800)]
[RISCV] Define preprocessor definitions for 'V' extension.

Differential Revision: https://reviews.llvm.org/D92650

3 years ago[objc] diagnose protocol conformance in categories with direct members
Alex Lorenz [Fri, 4 Dec 2020 23:06:13 +0000 (15:06 -0800)]
[objc] diagnose protocol conformance in categories with direct members
in their corresponding class interfaces

Categories that add protocol conformances to classes with direct members should prohibit protocol
conformances when the methods/properties that the protocol expects are actually declared as 'direct' in the class.

Differential Revision: https://reviews.llvm.org/D92602

3 years ago[clang] add a `swift_async_name` attribute
Alex Lorenz [Fri, 4 Dec 2020 22:45:27 +0000 (14:45 -0800)]
[clang] add a `swift_async_name` attribute

The swift_async_name attribute provides a name for a function/method that can be used
to call the async overload of this method from Swift. This name specified in this attribute
assumes that the last parameter in the function/method its applied to is removed when
Swift invokes it, as the the Swift's await/async transformation implicitly constructs the callback.

Differential Revision: https://reviews.llvm.org/D92355

3 years ago[clang] add a new `swift_attr` attribute
Alex Lorenz [Fri, 4 Dec 2020 17:29:45 +0000 (09:29 -0800)]
[clang] add a new `swift_attr` attribute

The swift_attr attribute is a generic annotation attribute that's not used by clang,
but is used by the Swift compiler. The Swift compiler can use these annotations to provide
various syntactic and semantic sugars for the imported Objective-C API declarations.

Differential Revision: https://reviews.llvm.org/D92354

3 years ago[test] precommit test for D92698
Philip Reames [Fri, 4 Dec 2020 23:12:16 +0000 (15:12 -0800)]
[test] precommit test for D92698

3 years agoIndex: Remove unused internal header SimpleFormatContext.h, NFC
Duncan P. N. Exon Smith [Fri, 4 Dec 2020 23:04:31 +0000 (15:04 -0800)]
Index: Remove unused internal header SimpleFormatContext.h, NFC

Looks like nothing has included this header since
d21485d2f5ffacf7b726c741ee409b3682045255 / r286279 in 2016. Delete the
dead code.

3 years agoAdd diagnostic for for-range-declaration being specificed with thread_local
shafik [Fri, 4 Dec 2020 22:47:36 +0000 (14:47 -0800)]
Add diagnostic for for-range-declaration being specificed with thread_local

Currently we have a diagnostic that catches the other storage class specifies for the range based for loop declaration but we miss the thread_local case. This changes adds a diagnostic for that case as well.

Differential Revision: https://reviews.llvm.org/D92671

3 years ago[asan][test] Improve -asan-use-private-alias tests
Fangrui Song [Fri, 4 Dec 2020 23:05:59 +0000 (15:05 -0800)]
[asan][test] Improve -asan-use-private-alias tests

In preparation for D92078

3 years ago[libc++] Update the commented "synopsis" in <algorithm> to match current reality.
Arthur O'Dwyer [Thu, 3 Dec 2020 01:02:18 +0000 (20:02 -0500)]
[libc++] Update the commented "synopsis" in <algorithm> to match current reality.

The synopsis now reflects what's implemented. It does NOT reflect
all of what's specified in C++20. The "constexpr in C++20" markings
are still missing from these 12 algorithms, because they are still
unimplemented by libc++:

    reverse partition sort nth_element next_permutation prev_permutation
    push_heap pop_heap make_heap sort_heap partial_sort partial_sort_copy

All of the above algorithms were excluded from [P0202].

All of the above algorithms were made constexpr in [P0879] (along with
swap_ranges, iter_swap, and rotate â€” we've already implemented those three).

Differential Revision: https://reviews.llvm.org/D92255

3 years ago[libc++] [P0202] constexpr set_union, set_difference, set_symmetric_difference, merge
Arthur O'Dwyer [Fri, 4 Dec 2020 18:47:12 +0000 (13:47 -0500)]
[libc++] [P0202] constexpr set_union, set_difference, set_symmetric_difference, merge

These had been waiting on the ability to use `std::copy` from
constexpr code (which in turn had been waiting on the ability to
use `is_constant_evaluated()` to switch between `memmove` and non-`memmove`
implementations of `std::copy`). That work landed a while ago,
so these algorithms can all be constexpr in C++20 now.

Simultaneously, update the tests for the set algorithms.

- Use an element type with "equivalent but not identical" values.
- The custom-comparator tests now pass something different from `operator<`.
- Make the constexpr coverage match the non-constexpr coverage.

Differential Revision: https://reviews.llvm.org/D92255

3 years ago[libc++] Slightly improve constexpr test coverage for std::includes.
Arthur O'Dwyer [Fri, 4 Dec 2020 18:38:51 +0000 (13:38 -0500)]
[libc++] Slightly improve constexpr test coverage for std::includes.

Differential Revision: https://reviews.llvm.org/D92255

3 years ago[VE] Add vfsqrt, vfcmp, vfmax, and vfmin intrinsic instructions
Kazushi (Jam) Marukawa [Fri, 4 Dec 2020 11:15:13 +0000 (20:15 +0900)]
[VE] Add vfsqrt, vfcmp, vfmax, and vfmin intrinsic instructions

Add vfsqrt, vfcmp, vfmax, and vfmin intrinsic instructions and
regression tests.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D92651

3 years agoASTImporter: Migrate to the FileEntryRef overload of SourceManager::createFileID...
Duncan P. N. Exon Smith [Thu, 3 Dec 2020 01:25:46 +0000 (17:25 -0800)]
ASTImporter: Migrate to the FileEntryRef overload of SourceManager::createFileID, NFC

Migrate `ASTImporter::Import` over to using the `FileEntryRef` overload
of `SourceManager::createFileID`. No functionality change here.

Differential Revision: https://reviews.llvm.org/D92529

3 years agoARCMigrate: Initialize fields in EditEntry inline, NFC
Duncan P. N. Exon Smith [Thu, 3 Dec 2020 01:32:08 +0000 (17:32 -0800)]
ARCMigrate: Initialize fields in EditEntry inline, NFC

Initialize the fields inline instead of having to manually write out a
default constructor.

Differential Revision: https://reviews.llvm.org/D92597

3 years agoFrontend: Use translateLineCol instead of translateFileLineCol, NFC
Duncan P. N. Exon Smith [Fri, 4 Dec 2020 22:34:22 +0000 (14:34 -0800)]
Frontend: Use translateLineCol instead of translateFileLineCol, NFC

`ParseDirective` in VerifyDiagnosticConsumer.cpp is already calling
`translateFile`, so use the `FileID` returned by that to call
`translateLineCol` instead of using the more heavyweight
`translateFileLineCol`.

No functionality change here.

3 years ago[MC] Consume EndOfStatement in .cfi_{sections,endproc}
Scott Linder [Fri, 4 Dec 2020 22:14:37 +0000 (22:14 +0000)]
[MC] Consume EndOfStatement in .cfi_{sections,endproc}

Previously these directives were always interpreted as having an extra
blank line after them.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D92612

3 years ago[gn build] Port 4d8bf870a82
LLVM GN Syncbot [Fri, 4 Dec 2020 22:16:56 +0000 (22:16 +0000)]
[gn build] Port 4d8bf870a82

3 years agoADT: Remove AlignedCharArrayUnion, NFC
Duncan P. N. Exon Smith [Wed, 2 Dec 2020 23:41:36 +0000 (15:41 -0800)]
ADT: Remove AlignedCharArrayUnion, NFC

Prep commit already migrated users over to std::aligned_union_t; this
just deletes the type / header / test.

Differential Revision: https://reviews.llvm.org/D92517

3 years ago[mlir][vector] rephrased description
Aart Bik [Fri, 4 Dec 2020 19:48:48 +0000 (11:48 -0800)]
[mlir][vector] rephrased description

More carefully worded description. Added constructor to options.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D92664

3 years agoInclude BuiltinAttributes.h in llvm-prettyprinters/gdb/mlir-support.cpp
Krzysztof Parzyszek [Fri, 4 Dec 2020 21:54:29 +0000 (15:54 -0600)]
Include BuiltinAttributes.h in llvm-prettyprinters/gdb/mlir-support.cpp

This header was introduced in c7cae0e4fa4e1ed4bdca186096a408578225fc2b.

3 years ago[test] Add explicit dso_local to constant/global variable declarations
Fangrui Song [Fri, 4 Dec 2020 21:51:01 +0000 (13:51 -0800)]
[test] Add explicit dso_local to constant/global variable declarations

They are currently implicit because TargetMachine::shouldAssumeDSOLocal implies
dso_local.

For external data, clang -fno-pic emits the dso_local specifier for ELF and
non-MinGW COFF. Adding explicit dso_local makes these tests in align with the
clang behavior and helps implementing an option to use GOT indirection for
external data access in -fno-pic mode (to avoid copy relocations).

3 years ago[dfsan] Add empty APIs for field-level shadow
Jianzhou Zhao [Fri, 4 Dec 2020 02:50:56 +0000 (02:50 +0000)]
[dfsan] Add empty APIs for field-level shadow

This is a child diff of D92261.

This diff adds APIs that return shadow type/value/zero from origin
objects. For the time being these APIs simply returns primitive
shadow type/value/zero. The following diff will be implementing the
conversion.

As D92261 explains, some cases still use primitive shadow during
the incremential changes. The cases include
1) alloca/load/store
2) custom function IO
3) vectors
At the cases this diff does not use the new APIs, but uses primitive
shadow objects explicitly.

Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/D92629

3 years ago[OPENMP]Fix PR48394: need to capture variables used in atomic constructs.
Alexey Bataev [Fri, 4 Dec 2020 20:56:54 +0000 (12:56 -0800)]
[OPENMP]Fix PR48394: need to capture variables used in atomic constructs.

The variables used in atomic construct should be captured in outer
task-based regions implicitly. Otherwise, the compiler will crash trying
to find the address of the local variable.

Differential Revision: https://reviews.llvm.org/D92682

3 years ago[libc++] fix std::sort(T**, T**)
Brett Gutstein [Fri, 4 Dec 2020 21:05:03 +0000 (16:05 -0500)]
[libc++] fix std::sort(T**, T**)

previously, invocations of std::sort(T**, T**) casted the arguments to
(size_t *). this breaks sorting on systems for which pointers don't fit
in a size_t. change the cast to (uintptr_t *) and add a test.

Differential Revision: https://reviews.llvm.org/D92190

3 years ago[Tooling] JSONCompilationDatabase::loadFromBuffer retains the buffer, copy it.
Sam McCall [Fri, 4 Dec 2020 10:34:30 +0000 (11:34 +0100)]
[Tooling] JSONCompilationDatabase::loadFromBuffer retains the buffer, copy it.

This function doesn't seem to be used in-tree outside tests.
However clangd wants to use it soon, and having the CDB be self-contained seems
reasonable.

Differential Revision: https://reviews.llvm.org/D92646

3 years agoADT: Migrate users of AlignedCharArrayUnion to std::aligned_union_t, NFC
Duncan P. N. Exon Smith [Wed, 2 Dec 2020 23:33:08 +0000 (15:33 -0800)]
ADT: Migrate users of AlignedCharArrayUnion to std::aligned_union_t, NFC

Prepare to delete `AlignedCharArrayUnion` by migrating its users over to
`std::aligned_union_t`.

I will delete `AlignedCharArrayUnion` and its tests in a follow-up
commit so that it's easier to revert in isolation in case some
downstream wants to keep using it.

Differential Revision: https://reviews.llvm.org/D92516

3 years ago[dfsan] Add a test case of storing zero
Jianzhou Zhao [Fri, 4 Dec 2020 05:39:37 +0000 (05:39 +0000)]
[dfsan] Add a test case of storing zero

This covers a branch in storeShadow.

Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/D92632

3 years ago[flang][openacc] Add clause validaty tests for data construct + fix default restriction
Valentin Clement [Fri, 4 Dec 2020 20:12:05 +0000 (15:12 -0500)]
[flang][openacc] Add clause validaty tests for data construct + fix default restriction

Add clause validity tests for the data construct. The default clause can appear only once
and this was not enforce in the ACC.td.

Reviewed By: sameeranjoshi

Differential Revision: https://reviews.llvm.org/D91888

3 years ago[clang-format] NFC update in the overall clang-formatted status
mydeveloperday [Fri, 4 Dec 2020 20:07:54 +0000 (20:07 +0000)]
[clang-format] NFC  update in the overall clang-formatted status

The current state of the clang-formatted-ness of the LLVM project hasn't been updated since June bring it upto date

3 years agoRevert "[flang][openacc] Add clause validity tests for the update directive"
clementval [Fri, 4 Dec 2020 20:06:22 +0000 (15:06 -0500)]
Revert "[flang][openacc] Add clause validity tests for the update directive"

This reverts commit e46065433466eec50903fec6f40a09cf26fa801e.

3 years ago[CUDA] Another attempt to fix early inclusion of <new> from libstdc++
Artem Belevich [Fri, 4 Dec 2020 19:27:39 +0000 (11:27 -0800)]
[CUDA] Another attempt to fix early inclusion of <new> from libstdc++

Previous patch (9a465057a64dba) did not fix the problem.
https://bugs.llvm.org/show_bug.cgi?id=48228

If the <new> is included too early, before CUDA-specific defines are available,
just include-next the standard <new> and undo the include guard.  CUDA-specific
variants of operator new/delete will be declared if/when <new> is used from the
CUDA source itself, when all CUDA-related macros are available.

Differential Revision: https://reviews.llvm.org/D91807

3 years agoADT: Change AlignedCharArrayUnion to an alias of std::aligned_union_t, NFC
Duncan P. N. Exon Smith [Fri, 4 Dec 2020 02:37:59 +0000 (18:37 -0800)]
ADT: Change AlignedCharArrayUnion to an alias of std::aligned_union_t, NFC

All the users of `AlignedCharArrayUnion` were changed in
5b267fb7966157e0d79ea85cbc1d07f92f840d3c to stop peeking inside (to look
at `buffer`), so this finishes gutting it. It's now an alias of
`std::aligned_union_t`, with a minor difference in template parameters
(`std::aligned_union_t` takes a minimum size and 0+ types, whereas this
just takes 1+ types... maybe a bit simpler to use correctly?).

A follow up will remove `AlignedCharArrayUnion` entirely, inlining this
alias into its users.

Differential Revision: https://reviews.llvm.org/D92512

3 years ago[RISCV] Initial infrastructure for code generation of the RISC-V V-extension
Craig Topper [Tue, 1 Dec 2020 03:48:24 +0000 (19:48 -0800)]
[RISCV] Initial infrastructure for code generation of the RISC-V V-extension

The companion RFC (http://lists.llvm.org/pipermail/llvm-dev/2020-October/145850.html) gives lots of details on the overall strategy, but we summarize it here:

LLVM IR involving vector types is going to be selected using pseudo instructions (only MachineInstr). These pseudo instructions contain dummy operands to represent the vector type being operated and the vector length for the operation.
These two dummy operands, as set by instruction selection, will be used by the custom inserter to prepend every operation with an appropriate vsetvli instruction that ensures the vector architecture is properly configured for the operation. Not in this patch: later passes will remove the redundant vsetvli instructions.
Register classes of tuples of vector registers are used to represent vector register groups (LMUL > 1).
Those pseudos are eventually lowered into the actual instructions when emitting the MCInsts.
About the patch:

Because there is a bit of initial infrastructure required, this is the minimal patch that allows us to select instructions for 3 LLVM IR instructions: load, add and store vectors of integers. LLVM IR operations have "whole-vector" semantics (as in they generate values for all the elements).

Later patches will extend the information represented in TableGen.

Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com>
Co-Authored-by: Evandro Menezes <evandro.menezes@sifive.com>
Co-Authored-by: Craig Topper <craig.topper@sifive.com>
Differential Revision: https://reviews.llvm.org/D89449

3 years ago[flang][openacc] Add clause validity tests for the update directive
Valentin Clement [Fri, 4 Dec 2020 19:38:31 +0000 (14:38 -0500)]
[flang][openacc] Add clause validity tests for the update directive

Add couple of clause validity tests for the update directive and check for
the restriction where at least self, host or device clause must appear on the directive.

Reviewed By: sameeranjoshi

Differential Revision: https://reviews.llvm.org/D92447

3 years agoAttempt to fix buildbot after rG993eaf2d69d8
Evgeny Leviant [Fri, 4 Dec 2020 19:10:36 +0000 (22:10 +0300)]
Attempt to fix buildbot after rG993eaf2d69d8

3 years agoADT: Stop peeking inside AlignedCharArrayUnion, NFC
Duncan P. N. Exon Smith [Wed, 2 Dec 2020 21:44:16 +0000 (13:44 -0800)]
ADT: Stop peeking inside AlignedCharArrayUnion, NFC

Update all the users of `AlignedCharArrayUnion` to stop peeking inside
(to look at `buffer`) so that a follow-up patch can replace it with an
alias to `std::aligned_union_t`.

This was reviewed as part of https://reviews.llvm.org/D92512, but I'm
splitting this bit out to commit first to reduce churn in case the
change to `AlignedCharArrayUnion` needs to be reverted for some
unexpected reason.

3 years agoFix for Bug 48055.
Hiroshi Yamauchi [Thu, 3 Dec 2020 19:04:19 +0000 (11:04 -0800)]
Fix for Bug 48055.

Differential Revision: https://reviews.llvm.org/D92599

3 years ago[libc++] [test] Disable parts of path.factory.pass.cpp as requiring localization...
Marek Kurdej [Fri, 4 Dec 2020 19:04:09 +0000 (20:04 +0100)]
[libc++] [test] Disable parts of path.factory.pass.cpp as requiring localization enabled.

It was added in commit 6be11e35d5397ae1c117eb840a969585fdd7d08d, "[libcxx] Implement c++2a char8_t input/output of std::filesystem::path".

3 years ago[TEST]Autogenerate test checks, NFC.
Alexey Bataev [Fri, 4 Dec 2020 18:56:28 +0000 (10:56 -0800)]
[TEST]Autogenerate test checks, NFC.

3 years ago[libc++] [test] Mark path.charconv.pass.cpp as requiring localization enabled.
Marek Kurdej [Fri, 4 Dec 2020 18:58:48 +0000 (19:58 +0100)]
[libc++] [test] Mark path.charconv.pass.cpp as requiring localization enabled.

It was added in commit 0b71bf793924301d53cf01eeb0a27e96fea17791, "[libcxx] [test] Add a test for conversions between wchar_t, utf8, char16_t, char32_t and windows native narrow code pages"

3 years agoRecommit [TableGen][SchedModels] Fix read/write variant substitution
Evgeny Leviant [Fri, 4 Dec 2020 18:50:34 +0000 (21:50 +0300)]
Recommit [TableGen][SchedModels] Fix read/write variant substitution

Original commit rG112b3cb6ba49 introduced non-determinism in subtarget
generator due to iteration over DenseMap. New patch fixes this changing
ProcModelMapTy from DenseMap to std::map.

3 years ago[AArch64] Add custom lowering for ISD::ABS
Craig Topper [Fri, 4 Dec 2020 18:45:31 +0000 (10:45 -0800)]
[AArch64] Add custom lowering for ISD::ABS

Instead of trying to pattern match the code produced by ISD::ABS expansion, just custom legalize ISD::ABS to the desired sequence.

The one test change is because a DAG combine for (neg (abs)) is no longer firing because ISD::ABS is now Custom instead of Expand.

Differential Revision: https://reviews.llvm.org/D92154

3 years ago[RISCV] Add support for printing pcrel immediates as absolute addresses in llvm-objdump
Craig Topper [Fri, 4 Dec 2020 18:31:23 +0000 (10:31 -0800)]
[RISCV] Add support for printing pcrel immediates as absolute addresses in llvm-objdump

This makes the llvm-objdump output much more readable and closer to binutils objdump. This builds on D76591

It requires changing the OperandType for certain immediates to "OPERAND_PCREL" so tablegen will generate code to pass the instruction's address. This means we can't do the generic check on these instructions in verifyInstruction any more. Should I add it back with explicit opcode checks? Or should we add a new operand flag to control the passing of address instead of matching the name?

Differential Revision: https://reviews.llvm.org/D92147

3 years agoDon't use sysroot/include when sysroot is empty.
Hafiz Abid Qadeer [Fri, 4 Dec 2020 17:45:04 +0000 (17:45 +0000)]
Don't use sysroot/include when sysroot is empty.

Baremetal toolchain add Driver.SysRoot/include to the system include
paths without checking if Driver.SysRoot is empty. This resulted in
"-internal-isystem" "include" in the command. This patch adds check for
empty sysroot.

Reviewed By: jroelofs

Differential Revision: https://reviews.llvm.org/D92176

3 years ago[libc] add tests to WrapperGen
Michael Jones [Thu, 19 Nov 2020 21:11:42 +0000 (21:11 +0000)]
[libc] add tests to WrapperGen

This adds an initial test that can serve as a basis for other tests on
wrappergen.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D92137

3 years ago[DAG] Move SelectionDAG implementation to KnownBits::setInReg(). NFCI.
Simon Pilgrim [Fri, 4 Dec 2020 18:08:53 +0000 (18:08 +0000)]
[DAG] Move SelectionDAG implementation to KnownBits::setInReg(). NFCI.

3 years ago[mlir][vector][NFC] Change UnrollVectorPattern to not be statically dependent on...
Thomas Raoux [Fri, 4 Dec 2020 07:44:36 +0000 (23:44 -0800)]
[mlir][vector][NFC] Change UnrollVectorPattern to not be statically dependent on an op type

Make UnrollVectorPattern inherit from RewritePattern instead of
OpRewritePattern so that we don't need to create many patterns when applying to
many different type of ops. Since we may want to apply the pattern to all
arithmetic op, it is more convenient to filter dynamically.

Differential Revision: https://reviews.llvm.org/D92635

3 years ago[clang-format] Improve clang-formats handling of concepts
mydeveloperday [Fri, 4 Dec 2020 17:44:25 +0000 (17:44 +0000)]
[clang-format] Improve clang-formats handling of concepts

This is a starting point to improve the handling of concepts in clang-format. There is currently no real formatting of concepts and this can lead to some odd formatting, e.g.

Reviewed By: mitchell-stellar, miscco, curdeius

Differential Revision: https://reviews.llvm.org/D79773

3 years ago[libc++] [docs] Add Version column to issues tables on status pages.
Marek Kurdej [Fri, 4 Dec 2020 17:41:51 +0000 (18:41 +0100)]
[libc++] [docs] Add Version column to issues tables on status pages.

3 years ago[OpenMP][OMPT] Make sure that 0 is never used as ID in tests (NFC)
Joachim Protze [Fri, 4 Dec 2020 17:41:07 +0000 (18:41 +0100)]
[OpenMP][OMPT] Make sure that 0 is never used as ID in tests (NFC)

3 years ago[MLIR] Fix parseFunctionLikeOp() to fail parsing empty regions
Rahul Joshi [Thu, 3 Dec 2020 00:49:47 +0000 (16:49 -0800)]
[MLIR] Fix parseFunctionLikeOp() to fail parsing empty regions

- Change parseOptionalRegion to return an OptionalParseResult.
- Change parseFunctionLikeOp() to fail parsing if the function body was parsed but was
  empty.
- See https://llvm.discourse.group/t/funcop-parsing-bug/2164

Differential Revision: https://reviews.llvm.org/D91886

3 years ago[MLIR] Generate inferReturnTypes declaration using InferTypeOpInterface trait.
Rahul Joshi [Fri, 4 Dec 2020 00:18:11 +0000 (16:18 -0800)]
[MLIR] Generate inferReturnTypes declaration using InferTypeOpInterface trait.

- Instead of hardcoding the parameters and return types of 'inferReturnTypes', use the
  InferTypeOpInterface trait to generate the method declaration.
- Fix InferTypeOfInterface to use fully qualified type for inferReturnTypes results.

Differential Revision: https://reviews.llvm.org/D92585

3 years ago[NewPM] Make pass adaptors less templatey
Arthur Eubanks [Fri, 4 Dec 2020 16:30:34 +0000 (08:30 -0800)]
[NewPM] Make pass adaptors less templatey

Currently PassBuilder.cpp is by far the file that takes longest to
compile. This is due to tons of templates being instantiated per pass.

Follow PassManager by using wrappers around passes to avoid making
the adaptors templated on the pass type. This allows us to move various
adaptors' run methods into .cpp files.

This reduces the compile time of PassBuilder.cpp on my machine from 66
to 39 seconds. It also reduces the size of opt from 685M to 676M.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D92616

3 years ago[libomptarget][amdgpu] Fix latent race in load binary
Jon Chesterfield [Fri, 4 Dec 2020 16:29:09 +0000 (16:29 +0000)]
[libomptarget][amdgpu] Fix latent race in load binary

3 years agoFix a test failing on windows
Erik Pilkington [Fri, 4 Dec 2020 16:10:40 +0000 (11:10 -0500)]
Fix a test failing on windows

3 years ago[OPENMP]Fix PR48387: disable warning messages caused by internal conversions.
Alexey Bataev [Fri, 4 Dec 2020 14:17:08 +0000 (06:17 -0800)]
[OPENMP]Fix PR48387: disable warning messages caused by internal conversions.

Compiler needs to convert some of the loop iteration
variables/conditions to different types for better codegen and it may
lead to spurious warning messages about implicit signed/unsigned
conversions.

Differential Revision: https://reviews.llvm.org/D92655

3 years ago[PowerPC] Regenerate p10-vector-rotate.ll
Simon Pilgrim [Fri, 4 Dec 2020 15:18:32 +0000 (15:18 +0000)]
[PowerPC] Regenerate p10-vector-rotate.ll

Reorder check-prefixes to stop update_llc_test_checks.py complaining

3 years agofix typos to cycle bots
Nico Weber [Fri, 4 Dec 2020 15:18:44 +0000 (10:18 -0500)]
fix typos to cycle bots

3 years ago[gn build] Port c8ec685ca55
LLVM GN Syncbot [Fri, 4 Dec 2020 15:06:48 +0000 (15:06 +0000)]
[gn build] Port c8ec685ca55

3 years ago[Sema] Fold VLAs to constant arrays in a few more contexts
Erik Pilkington [Thu, 3 Dec 2020 15:01:53 +0000 (10:01 -0500)]
[Sema] Fold VLAs to constant arrays in a few more contexts

552c6c2 removed support for promoting VLAs to constant arrays when the bounds
isn't an ICE, since this can result in miscompiling a conforming program that
assumes that the array is a VLA. Promoting VLAs for fields is still supported,
since clang doesn't support VLAs in fields, so no conforming program could have
a field VLA.

This change is really disruptive, so this commit carves out two more cases
where we promote VLAs which can't miscompile a conforming program:

 - When the VLA appears in an ivar -- this seems like a corollary to the field thing
 - When the VLA has an initializer -- VLAs can't have an initializer

Differential revision: https://reviews.llvm.org/D90871

3 years ago[llvm-exegesis][PowerPC] Add more register classes
Jinsong Ji [Fri, 4 Dec 2020 14:07:52 +0000 (14:07 +0000)]
[llvm-exegesis][PowerPC] Add more register classes

This PR adds more register class support in PowerPC,
mark OperandType for imm and memory operands.

Also added more unit tests for SnippetGenerator.

Reviewed By: #powerpc, steven.zhang

Differential Revision: https://reviews.llvm.org/D88044

3 years ago[mlir][Linalg] NFC - Expose tiling canonicalization patterns through a populate method
Nicolas Vasilache [Fri, 4 Dec 2020 14:22:00 +0000 (14:22 +0000)]
[mlir][Linalg] NFC - Expose tiling canonicalization patterns through a populate method

3 years ago[AST][NFC] Silence GCC warning about broken strict aliasing rules
Thomas Preud'homme [Mon, 30 Nov 2020 17:02:12 +0000 (17:02 +0000)]
[AST][NFC] Silence GCC warning about broken strict aliasing rules

The deserialize() method would trigger the following warning on GCC <7:

   warning: dereferencing type-punned pointer will break
       strict-aliasing rules [-Wstrict-aliasing]

       ParamIdx P(*reinterpret_cast<ParamIdx *>(&S));
                                                  ^

&S was previously reinterpret_casted from a ParamIdx into a SerialType,
it is therefore safe to cast back into a ParamIdx. Similar to what was
done in D50608, we replace it with two static_cast via void * which
silences the warning and presumably makes GCC understand that no
strict-aliasing violation is happening.

No functional change intended.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D92384