Jim Lin [Sat, 5 Jun 2021 04:49:14 +0000 (12:49 +0800)]
[RISCV] Replace (XLenVT (VLOp GPR:$vl)) with VLOpFrag
This is for D100288 to reduce the changes.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D103682
Michael Kruse [Sat, 5 Jun 2021 04:17:41 +0000 (23:17 -0500)]
[Polly] Move MatMul optimization into its own file. NFC.
Functions shared between generalized matrix-multiplication optimization
and other post-reschedule optimizations (tiling, prevect) are moved into
the schedule tree transformation utility ScheduleTreeTransform.
Vitaly Buka [Sat, 5 Jun 2021 03:17:45 +0000 (20:17 -0700)]
Revert "Update and improve compiler-rt tests for -mllvm -asan_use_after_return=(never|[runtime]|always)."
Reverts commits of D103304, it breaks Darwin.
This reverts commit
60e5243e593ec7e0feca42783edb735e9ac2c4a7.
This reverts commit
26b3ea224e7744058c0053e8eee25a8a3acc9f5d.
This reverts commit
17600ec32a6f3e5720e5232ddb23d67daa650f4d.
Fangrui Song [Sat, 5 Jun 2021 03:15:56 +0000 (20:15 -0700)]
[lsan] Bump the thread limit from 1<<13 to 1<<22
This matches asan. Some applications need more than 1<<13 threads.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D103731
Vitaly Buka [Sat, 5 Jun 2021 02:32:24 +0000 (19:32 -0700)]
[NFC][scudo] Fix sign-compare warning in test
Vitaly Buka [Sat, 5 Jun 2021 02:26:03 +0000 (19:26 -0700)]
[NFC][scudo] Convert to TYPED more ScudoCombinedTest
Vitaly Buka [Fri, 4 Jun 2021 22:56:13 +0000 (15:56 -0700)]
[scudo] Remove ScopedString::Length
Differential Revision: https://reviews.llvm.org/D103725
Vitaly Buka [Fri, 4 Jun 2021 20:48:54 +0000 (13:48 -0700)]
[Scudo] Improve ScopedString constructor
Avoid referencing elements beyond internal vector size.
Reviewed By: cryptoad
Differential Revision: https://reviews.llvm.org/D103718
Vitaly Buka [Sat, 5 Jun 2021 01:22:32 +0000 (18:22 -0700)]
[NFC][scudo] Fix sign-compare warning in test
Kevin Athey [Fri, 4 Jun 2021 23:58:39 +0000 (16:58 -0700)]
remove windows tests for -asan_use-after-return=always (as this is currently disabled for Windows)
Aart Bik [Fri, 4 Jun 2021 23:17:16 +0000 (16:17 -0700)]
[mlir][sparse] add option for 32-bit indices in scatter/gather
Controlled by a compiler option, if 32-bit indices can be handled
with zero/sign-extention alike (viz. no worries on non-negative
indices), scatter/gather operations can use the more efficient
32-bit SIMD version.
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D103632
Nico Weber [Fri, 4 Jun 2021 23:49:29 +0000 (19:49 -0400)]
[gn build] manually port
60e5243e593e (weak asan symbol)
Kevin Athey [Fri, 4 Jun 2021 23:44:34 +0000 (16:44 -0700)]
fix SANITIZE_WINDOWS pragma for https://reviews.llvm.org/rG60e5243e593ec7e0feca42783edb735e9ac2c4a7
Rob Suderman [Fri, 4 Jun 2021 23:30:46 +0000 (16:30 -0700)]
[mlir][tosa] Update tosa.rescale for i48 input type
i48 integers require slightly tweaked behavior, specifically supporting zero
point offsetting with slightly higher bitdepth. Updated results lowering
appropriately.
Reviewed By: NatashaKnk
Differential Revision: https://reviews.llvm.org/D102659
Kevin Athey [Fri, 4 Jun 2021 21:30:04 +0000 (14:30 -0700)]
Update and improve compiler-rt tests for -mllvm -asan_use_after_return=(never|[runtime]|always).
In addition:
- optionally add global flag to capture compile intent for UAR:
__asan_detect_use_after_return_always.
The global is a SANITIZER_WEAK_ATTRIBUTE.
for issue: https://github.com/google/sanitizers/issues/1394
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D103304
Ahmed Taei [Fri, 4 Jun 2021 22:41:19 +0000 (15:41 -0700)]
Revert "Add memref.dim canonicalization patterns to TilingCanonicalizationPatterns"
This reverts commit
a52959401d9544ac7037405aaf714bd08f071ea9.
Differential Revision: https://reviews.llvm.org/D103724
Scott Linder [Wed, 26 May 2021 20:38:41 +0000 (20:38 +0000)]
[ADT] Refactor enumerate unit tests
Preparation for landing the tests for llvm::makeVisitor, including
breaking out the a "Counted" base class and explicitly testing
the prvalue case as distinct from the rvalue case.
Differential Revision: https://reviews.llvm.org/D103206
Roman Lebedev [Fri, 4 Jun 2021 22:23:25 +0000 (01:23 +0300)]
[X86] AMD Zen 3: double the LoopMicroOpBufferSize
While the IndVars issue (PR50384) has been resolved,
and the compile performance improved, a new blocker emerged,
the codegen machine instruction scheduling is also quadratic.
So we still can't really specify the right value here.
Filed PR50584.
Peter Steinfeld [Fri, 4 Jun 2021 20:24:19 +0000 (13:24 -0700)]
[flang] Check for undefined derived types
It's possible to specify refer to an undefined derived type as the type of a
component of another derived type and then never define the type of the
component. We were not detecting this situation. To fix this, I
changed the value of isForwardReferenced_ in the symbol's
DerivedTypeDetails and checked for it when performing other derived type
checks.
I also had to record the fact that error messages were previously
emitted for the same problem in some cases so that I could avoid
duplicate messages.
I also added a test.
Differential Revision: https://reviews.llvm.org/D103714
Arnamoy Bhattacharyya [Fri, 4 Jun 2021 21:17:49 +0000 (17:17 -0400)]
[flang][OpenMP] Add semantic check to allow only loop iteration variables in a `linear` clause within `distribute` construct.
Implement the following semantic check:
"A list item may not appear in a linear clause, unless it is the loop iteration variable."
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D100224
Ten Tzen [Fri, 4 Jun 2021 21:04:46 +0000 (14:04 -0700)]
[Windows SEH]: Fix -O2 crash for Windows -EHa
This patch fixes a Windows -EHa crash induced by previous commit
797ad701522988e212495285dade8efac41a24d4.
The crash was caused by "LifetimeMarker" scope (with option -O2) that should not be considered as SEH Scope.
This change also turns off -fasync-exceptions by default under -EHa option for now.
Differential Revision: https://reviews.llvm.org/D103664#2799944
Terry Wilmarth [Mon, 10 May 2021 17:58:39 +0000 (12:58 -0500)]
[OpenMP] Add experimental nesting mode feature
Nesting mode is a new experimental feature in the OpenMP
runtime. It allows a user to set up nesting for an application in a
way that corresponds to the hardware topology levels on the machine an
application is being run on. For example, if a machine has 2 sockets,
each with 12 cores, then use of nesting mode could set up an outer
level of nesting that uses 2 threads per parallel region, and an inner
level of nesting that uses 12 threads per parallel region.
Nesting mode is controlled with the KMP_NESTING_MODE environment
variable as follows:
1) KMP_NESTING_MODE = 0: Nesting mode is off (default); max-active-levels-var
is set to 1 (the default -- nesting is off, nested parallel regions
are serialized).
2) KMP_NESTING_MODE = 1: Nesting mode is on, and a number of threads
will be assigned for each level discovered in the machine topology;
max-active-levels-var is set to the number of levels discovered.
3) KMP_NESTING_MODE = n, n>1: [Note: this option is experimental and may change
or be removed in the future.] Nesting mode is on, and a number of
threads will be assigned for each topology level discovered on the
machine, up to k<=n levels (since there may be fewer than n levels
discovered in the topology), and beyond the kth level, nested parallel
regions will be serialized; NOTE: max-active-levels-var is 1 (the default --
nesting is off, and nested parallel regions are serialized until the
user changes max-active-levels-var.
If the user sets OMP_NUM_THREADS or OMP_MAX_ACTIVE_LEVELS, they will
override KMP_NESTING_MODE settings for the associated environment
variables. The detected topology may be limited by an affinity mask
setting on the initial thread, or if the user sets KMP_HW_SUBSET. See
also: KMP_HOT_TEAMS_MAX_LEVEL for controlling use of hot teams for
nested parallel regions. Note that this feature only sets numbers of
threads used at nesting levels. The user should make use of
OMP_PLACES and OMP_PROC_BIND or KMP_AFFINITY for affinitizing those
threads, if desired.
Differential Revision: https://reviews.llvm.org/D102188
Kostya Kortchinsky [Fri, 4 Jun 2021 20:38:26 +0000 (13:38 -0700)]
[scudo] Fix String DCHECK
This resolves an issue tripping a `DCHECK`, as I was checking for the
capacity and not the size. We don't need to 0-init the Vector as it's
done already, and make sure we only 0-out the string on clear if it's
not empty.
Differential Revision: https://reviews.llvm.org/D103716
Nico Weber [Fri, 4 Jun 2021 20:41:35 +0000 (16:41 -0400)]
[gn build] (semi-manually) port
07c92b2e9581
Ahmed Taei [Fri, 4 Jun 2021 20:31:05 +0000 (13:31 -0700)]
Add memref.dim canonicalization patterns to TilingCanonicalizationPatterns
Otherwise tiled and padded linalg op will be alive (after distribution).
Differential Revision: https://reviews.llvm.org/D103715
Eli Friedman [Fri, 4 Jun 2021 20:33:29 +0000 (13:33 -0700)]
Regenerate a few tests related to SCEV.
In preparation for https://reviews.llvm.org/D103656
Fangrui Song [Fri, 4 Jun 2021 20:27:56 +0000 (13:27 -0700)]
[InstrProfiling] If no value profiling, make data variable private and (for Windows) use one comdat
`__profd_*` variables are referenced by code only when value profiling is
enabled. If disabled (e.g. default -fprofile-instr-generate), the symbols just
waste space on ELF/Mach-O. We change the comdat symbol from `__profd_*` to
`__profc_*` because an internal symbol does not provide deduplication features
on COFF. The choice doesn't matter on ELF.
(In -DLLVM_BUILD_INSTRUMENTED_COVERAGE=on build, there is now no `__profd_*` symbols.)
On Windows this enables further optimization. We are no longer affected by the
link.exe limitation: an external symbol in IMAGE_COMDAT_SELECT_ASSOCIATIVE can
cause duplicate definition error.
https://lists.llvm.org/pipermail/llvm-dev/2021-May/150758.html
We can thus use llvm.compiler.used instead of llvm.used like ELF (D97585).
This avoids many `/INCLUDE:` directives in `.drectve`.
Here is rnk's measurement for Chrome:
```
This reduced object file size of base_unittests.exe, compiled with coverage, optimizations, and gmlt debug info by 10%:
#BEFORE
$ find . -iname '*.obj' | xargs du -b | awk '{ sum += $1 } END { print sum}'
1047758867
$ du -cksh base_unittests.exe
82M base_unittests.exe
82M total
# AFTER
$ find . -iname '*.obj' | xargs du -b | awk '{ sum += $1 } END { print sum}'
937886499
$ du -cksh base_unittests.exe
78M base_unittests.exe
78M total
```
The change is NFC for Mach-O.
Reviewed By: davidxl, rnk
Differential Revision: https://reviews.llvm.org/D103372
Aaron Ballman [Fri, 4 Jun 2021 19:50:44 +0000 (15:50 -0400)]
Fix a diagnoses-valid bug with using declarations
The following was found by a customer and is accepted by the other primary
C++ compilers, but fails to compile in Clang:
namespace sss {
double foo(int, double);
template <class T>
T foo(T); // note: target of using declaration
} // namespace sss
namespace oad {
void foo();
}
namespace oad {
using ::sss::foo;
}
namespace sss {
using oad::foo; // note: using declaration
}
namespace sss {
double foo(int, double) { return 0; }
template <class T>
T foo(T t) { // error: declaration conflicts with target of using
return t;
}
} // namespace sss
I believe the issue is that MergeFunctionDecl() was calling
checkUsingShadowRedecl() but only considering a FunctionDecl as a
possible shadow and not FunctionTemplateDecl. The changes in this patch
largely mirror how variable declarations were being handled by also
catching FunctionTemplateDecl.
Vitaly Buka [Sun, 30 May 2021 00:18:17 +0000 (17:18 -0700)]
[scudo] Untag pointer in iterateOverChunks
Pointer comparison in Lambda will not work on tagged pointers.
Reviewed By: pcc
Differential Revision: https://reviews.llvm.org/D103496
Vitaly Buka [Tue, 25 May 2021 04:40:44 +0000 (21:40 -0700)]
[scudo] Add memtag_test
Differential Revision: https://reviews.llvm.org/D103074
Vitaly Buka [Fri, 4 Jun 2021 18:25:47 +0000 (11:25 -0700)]
[scudo] Remove disableMemoryTagChecksTestOnly
And replace with ScopedDisableMemoryTagChecks.
Differential Revision: https://reviews.llvm.org/D103708
Martin Storsjö [Fri, 4 Jun 2021 19:27:18 +0000 (22:27 +0300)]
[mailmap] Add the canonical spelling of my name
Nikita Popov [Mon, 31 May 2021 19:22:21 +0000 (21:22 +0200)]
[IndVars] Don't forget value when inferring nowrap flags
When SimplifyIndVars infers IR nowrap flags from SCEV, this may
happen in two ways: Either nowrap flags were already present in
SCEV and just get transferred to IR. Or zero/sign extension of
addrecs infers additional nowrap flags, and those get transferred
to IR. In the latter case, calling forgetValue() ensures that the
newly inferred nowrap flags get propagated to any other SCEV
expressions based on the addrec. However, the invalidation can
also have a major compile-time effect in some cases. For
https://bugs.llvm.org/show_bug.cgi?id=50384 with n=512 compile-
time drops from 7.1s to 0.8s without this invalidation. At the
same time, removing the invalidation doesn't affect any codegen
in test-suite.
Differential Revision: https://reviews.llvm.org/D103424
Rong Xu [Fri, 4 Jun 2021 18:02:11 +0000 (11:02 -0700)]
[SampleFDO] New hierarchical discriminator for FS SampleFDO (llvm-profdata part)
This patch was split from https://reviews.llvm.org/D102246
[SampleFDO] New hierarchical discriminator for Flow Sensitive SampleFDO
This is for llvm-profdata part of change. It sets the bit masks for the
profile reader in llvm-profdata. Also add an internal option
"-fs-discriminator-pass" for show and merge command to process the profile
offline.
This patch also moved setDiscriminatorMaskedBitFrom() to
SampleProfileReader::create() to simplify the interface.
Differential Revision: https://reviews.llvm.org/D103550
peter klausler [Thu, 3 Jun 2021 22:48:16 +0000 (15:48 -0700)]
[flang] CheckConformance: tristate-ify result
To ensure that errors are emitted by CheckConformance and
its callers in all situations, it's necessary for the returned result
of that function to distinguish between three possible
outcomes: the arrays are known to conform at compilation time,
the arrays are known to not conform (and a message has been
produced), and an indeterminate result in which is not possible
to determine conformance. So convert CheckConformance's
result into an optional<bool>, and convert its confusing
Boolean flag arguments into a bit-set of named flags too.
Differential Revision: https://reviews.llvm.org/D103654
Adam Nemet [Thu, 3 Jun 2021 15:57:33 +0000 (08:57 -0700)]
[Matrix] Fix transpose-multiply folding if transpose has multiple uses
Don't add it to FusedInsts in this case.
Differential Revision: https://reviews.llvm.org/D103627
Fangrui Song [Fri, 4 Jun 2021 17:26:55 +0000 (10:26 -0700)]
[profile] Add -fprofile-instr-generate tests for weak definition and various linkages
Vitaly Buka [Fri, 28 May 2021 09:08:44 +0000 (02:08 -0700)]
[scudo] Always exclude Tag 0
prepareTaggedChunk uses Tag 0 for header.
Android already PR_MTE_TAG_MASK to 0xfffe,
but with the patch we will not need to deppend
on the system configuration.
Reviewed By: pcc
Differential Revision: https://reviews.llvm.org/D103134
Jason Zheng [Tue, 1 Jun 2021 09:22:00 +0000 (10:22 +0100)]
[OpenCL] Add DWARF address spaces mapping for SPIR
Extend debug info handling by adding DWARF address space mapping for
SPIR, with corresponding test case.
Reviewed By: Anastasia
Differential Revision: https://reviews.llvm.org/D103097
Konstantin Zhuravlyov [Fri, 4 Jun 2021 12:55:26 +0000 (08:55 -0400)]
CUDA/HIP: Change device-use-host-var.cu's NOT "external" check to include variable name
Otherwise it is causing one of our build jobs to fail,
it is using "external" as directory, and NOT is
failing because "external" is found in ModuleID.
Differential Revision: https://reviews.llvm.org/D103658
Jessica Paquette [Thu, 3 Jun 2021 00:45:58 +0000 (17:45 -0700)]
[AArch64][GlobalISel] Handle multiple phis in fixupPHIOpBanks
If we ended up with two phi instructions in a block, and we needed to fix up
the banks for the first one, we'd end up inserting our COPY before the second
phi.
E.g.
```
%x = G_PHI ...
%fixup = COPY ...
%y = G_PHI ...
```
This is invalid MIR, and breaks assumptions made by the register allocator later
down the line. With the verifier enabled, it also emits a verification error.
This teaches fixupPHIOpBanks to walk past any phi instructions in the block
when emitting the fixup copies.
Here's an example of the crashing code (same as added testcase):
https://godbolt.org/z/h5j1x3o6e
Differential Revision: https://reviews.llvm.org/D103582
zoecarver [Tue, 1 Jun 2021 21:54:29 +0000 (14:54 -0700)]
[libcxx][ranges] Add concepts in range.utility.helpers.
There are no changes to public APIs.
Differential Revision: https://reviews.llvm.org/D103493
Mark Schimmel [Fri, 4 Jun 2021 16:47:50 +0000 (19:47 +0300)]
Add commutable attribute to opcodes for ARC
This patch sets the isCommutable attribute for several opcodes that have
the "reg = OPCODE reg, reg" format.
Differential Revision: https://reviews.llvm.org/D103653
LLVM GN Syncbot [Fri, 4 Jun 2021 16:41:04 +0000 (16:41 +0000)]
[gn build] Port
d31a2e7554ea
LLVM GN Syncbot [Fri, 4 Jun 2021 16:41:03 +0000 (16:41 +0000)]
[gn build] Port
7ed7d4ccb899
zoecarver [Wed, 26 May 2021 21:25:02 +0000 (14:25 -0700)]
[libcxx][ranges] Add `ranges::empty_view`.
Differential Revision: https://reviews.llvm.org/D103208
Joseph Huber [Thu, 3 Jun 2021 00:20:17 +0000 (20:20 -0400)]
[Attributor] Check HeapToStack's state for isKnownHeapToStack
This patch changes the `isKnownHeapToStack` and `isAssumedHeapToStack`
member functions to return if a function call is going to be altered by
HeapToStack.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D103574
zoecarver [Thu, 3 Jun 2021 18:26:03 +0000 (11:26 -0700)]
[libcxx][gardening] Move all algorithms into their own headers.
This is a fairly mechanical change, it just moves each algorithm into its own header. This is a NFC.
Note: during this change, I burned down all the includes, so this follows "include only and exactly what you use."
Differential Revision: https://reviews.llvm.org/D103583
Joseph Huber [Wed, 2 Jun 2021 21:32:42 +0000 (17:32 -0400)]
[Attributor] Allow lookupAAFor to return null on invalid state
This patch adds an option to `lookupAAFor` that allows it to return a
nullptr if the state of the looked up attribute is invalid. This is so
future passes can use this to query other attributes with the guarantee
that they are valid.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D103556
Peyton, Jonathan L [Fri, 4 Jun 2021 16:19:27 +0000 (11:19 -0500)]
[OpenMP] fix spelling error in message-converter.pl
Craig Topper [Fri, 4 Jun 2021 15:57:07 +0000 (08:57 -0700)]
[RISCV] Teach vsetvli insertion pass that operations on masks don't care about SEW/LMUL.
All that really matters is that the VLMAX of the preceding
instructions is the same as the VLMAX required by the mask
operation.
Also update the vmsge(u) handling to use the SEW/LMUL we use for
other mask register operations. We were matching it to the compare
before. Some cases will be improve if we fix masked compares to
use tail agnostic policy. I think they ignore the tail policy
anyway.
Reviewed By: frasercrmck
Differential Revision: https://reviews.llvm.org/D103299
Mikhail Goncharov [Fri, 4 Jun 2021 16:10:17 +0000 (18:10 +0200)]
[clang] use a different name for generated test cdb
if build system copied source files as readonly, then override of db_tu.json
will fail
Adam Czachorowski [Wed, 2 Jun 2021 17:45:11 +0000 (19:45 +0200)]
[clangd] Run code completion on each token coverd by --check-lines
In --check mode we do not run code completion because it is too slow,
especially on larger files. With the introducation of --check-lines we
can narrow down the scope and thus we can afford to do code completion.
We vlog() the top completion result, but that's not really the point.
The most value will come from being able to reproduce crashes that occur
during code completion and require preamble build or index (and thus are
more difficult to reproduce with -code-complete-at).
Differential Revision: https://reviews.llvm.org/D103538
Sanjay Patel [Fri, 4 Jun 2021 15:40:39 +0000 (11:40 -0400)]
[ConstantFolding] add copysign tests for more FP types; NFC
D102673 proposes to ease the current type check, but
there doesn't appear to be any test coverage for that.
Alexey Bataev [Thu, 3 Jun 2021 21:13:35 +0000 (14:13 -0700)]
[OPENMP]Fix PR50129: omp cancel parallel not working as expected.
Need to emit a call for __kmpc_cancel_barrier in the exit block for
__kmpc_cancel function call if cancellation of the parallel block is
requested.
Differential Revision: https://reviews.llvm.org/D103646
Bradley Smith [Thu, 27 May 2021 12:59:06 +0000 (13:59 +0100)]
[AArch64] Remove SETCC of CSEL when the latter's condition can be inverted
setcc (csel 0, 1, cond, X), 1, ne ==> csel 0, 1, !cond, X
Where X is a condition code setting instruction.
Co-authored-by: Paul Walker <paul.walker@arm.com>
Differential Revision: https://reviews.llvm.org/D103256
Matthias Springer [Fri, 4 Jun 2021 14:44:18 +0000 (23:44 +0900)]
[mlir][linalg] Refactor PadTensorOpVectorizationPattern (NFC)
* Rename PadTensorOpVectorizationPattern to GenericPadTensorOpVectorizationPattern.
* Make GenericPadTensorOpVectorizationPattern a private pattern, to be instantiated via populatePadTensorOpVectorizationPatterns.
* Factor out parts of PadTensorOpVectorizationPattern into helper functions.
This commit prepares PadTensorOpVectorizationPattern for a series of subsequent commits that add more specialized PadTensorOp vectorization patterns.
Differential Revision: https://reviews.llvm.org/D103681
Nico Weber [Fri, 4 Jun 2021 14:42:37 +0000 (10:42 -0400)]
Temporarily remove another test added in one of the tests added in effb87d
This test reads the test file removed in
db3e4faa4d2ca.
Nico Weber [Fri, 4 Jun 2021 14:39:49 +0000 (10:39 -0400)]
Revert test fixups after
e9a9c850989e (which reverted a14fc74).
This reverts commit
da3ed58b97c1cc1356b7732d5dcbb6e4de3057da.
This reverts commit
ba1fb0ff8c9f9ef7f9b7d1fe43cb95c8d1363f78.
Matthias Springer [Fri, 4 Jun 2021 14:30:28 +0000 (23:30 +0900)]
[mlir] Mark VectorToSCF patterns as recursive
Differential Revision: https://reviews.llvm.org/D103599
Nico Weber [Fri, 4 Jun 2021 14:37:53 +0000 (10:37 -0400)]
[gn build] (manually) port
de07b1e84d8de9
Alexey Bataev [Thu, 3 Jun 2021 19:13:10 +0000 (12:13 -0700)]
[OPENMP]Fix PR49790: Constexpr values not handled in `omp declare mapper` clause.
Patch allows using of constexpr vars evaluatable to constant calue to be
used in declare mapper construct.
Differential Revision: https://reviews.llvm.org/D103642
Valentin Clement [Fri, 4 Jun 2021 14:25:50 +0000 (10:25 -0400)]
[mlir][openacc] Conversion of data operands in acc.data to LLVM IR dialect
Convert data operands from the acc.data operation using the same conversion pattern than D102170.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D103332
Andrzej Warzynski [Wed, 2 Jun 2021 20:53:02 +0000 (21:53 +0100)]
[flang][driver] Add checks for missing option arguments
With this patch, the following invocation of the frontend driver will
return an error:
```
flang-new -fc1 input-file.f90 -o
```
Similar logic applies to other options that require arguments.
Similar checks are already available in the compiler driver, flang-new
(that's implemented in clangDriver).
Differential Revision: https://reviews.llvm.org/D103554
Sanjay Patel [Fri, 4 Jun 2021 14:15:22 +0000 (10:15 -0400)]
[InstCombine] add tests for pow() reassociation; NFC
Baseline tests for D102574
Nico Weber [Fri, 4 Jun 2021 14:02:22 +0000 (10:02 -0400)]
Temporarily remove one of the tests added in
effb87dfa810a
It fails on some Linux systems. Remove the test until we've figured
out what's going on. See https://crbug.com/1216005 for details.
mydeveloperday [Fri, 4 Jun 2021 13:59:12 +0000 (14:59 +0100)]
[clang-format] NFC, 2% improvement in overall clang-formatted status (now 50%)
Nico Weber [Fri, 4 Jun 2021 13:51:24 +0000 (09:51 -0400)]
Revert "[InstrProfiling] If no value profiling, make data variable private and (for Windows) use one comdat"
This reverts commit
a14fc749aab2c8e1a45d19d512255ebfc69357c3.
Breaks check-profile on macOS. See https://reviews.llvm.org/D103372 for details.
Louis Dionne [Wed, 2 Jun 2021 14:41:37 +0000 (10:41 -0400)]
[libc++] Use the using_if_exists attribute when provided
As discussed on cfe-dev [1], use the using_if_exists Clang attribute when
the compiler supports it. This makes it easier to port libc++ on top of
new platforms that don't fully support the C Standard library.
Previously, libc++ would fail to build when trying to import a missing
declaration in a <cXXXX> header. With the attribute, the declaration will
simply not be imported into namespace std, and hence it won't be available
for libc++ to use. In many cases, the declarations were *not* actually
required for libc++ to work (they were only surfaced for users to use
them as std::XXXX), so not importing them into namespace std is acceptable.
The same thing could be achieved by conscious usage of `#ifdef` along
with platform detection, however that quickly creates a maintenance
problem as libc++ is ported to new platforms. Furthermore, this problem
is exacerbated when mixed with vendor internal-only platforms, which can
lead to difficulties maintaining a downstream fork of the library.
For the time being, we only use the using_if_exists attribute when it
is supported. At some point in the future, we will start removing #ifdef
paths that are unnecessary when the attribute is supported, and folks
who need those #ifdef paths will be required to use a compiler that
supports the attribute.
[1]: http://lists.llvm.org/pipermail/cfe-dev/2020-June/066038.html
Differential Revision: https://reviews.llvm.org/D90257
Stuart Brady [Fri, 4 Jun 2021 13:44:12 +0000 (14:44 +0100)]
[OpenCL][NFC] Test commit: tidy up whitespace in comment
Nicholas Guy [Wed, 26 May 2021 13:49:58 +0000 (14:49 +0100)]
[AArch64] Further enable UnrollAndJam
Due to the dependency on runtime unrolling, UnJ is only
enabled by default on in-order scheduling models,
and if a cpu is specified through -mcpu.
Differential Revision: https://reviews.llvm.org/D103604
Yaxun (Sam) Liu [Thu, 27 May 2021 19:51:02 +0000 (15:51 -0400)]
[HIP] Fix spack HIP device lib detection
spack HIP device library is installed at amdgcn directory under llvm/clang
directory.
This patch fixes detection of HIP device library for spack.
Reviewed by: Artem Belevich, Harmen Stoppels
Differential Revision: https://reviews.llvm.org/D103281
Sanjay Patel [Fri, 4 Jun 2021 13:03:32 +0000 (09:03 -0400)]
[InstCombine] add/adjust test comments; NFC
Follow-up to post-commit comment:
https://reviews.llvm.org/rG23a116c8c446
Jan Svoboda [Wed, 2 Jun 2021 12:49:14 +0000 (14:49 +0200)]
[clang][deps] Support object files
When a project uses PCH with explicit modules, the build will look like this:
1. scan PCH dependencies
2. explicitly build PCH
3. scan TU dependencies
4. explicitly build TU
Step 2 produces an object file for the PCH, which the dependency scanner needs to read in step 3. This patch adds support for this.
The `clang-scan-deps` invocation in the attached test would fail without this change.
Depends on D103516.
Reviewed By: Bigcheese
Differential Revision: https://reviews.llvm.org/D103519
Andrzej Warzynski [Fri, 4 Jun 2021 12:58:03 +0000 (13:58 +0100)]
[flang][driver] Add support for `-module-suffix`
This option is supported in `f18`, but not yet available in `flang-new`.
It is required in order to call `flang-new` from the `flang` bash
script.
Differential Revision: https://reviews.llvm.org/D103613
Mirko Brkusanin [Thu, 3 Jun 2021 16:09:45 +0000 (18:09 +0200)]
[AMDGPU][GlobalISel] Legalize G_ABS
Legalize and select G_ABS so that we can use llvm.abs intrinsic
Differential Revision: https://reviews.llvm.org/D102391
Jan Svoboda [Wed, 2 Jun 2021 12:07:14 +0000 (14:07 +0200)]
[clang][deps] Add argument for customizing PCM paths
Dependency scanning currently performs an implicit build. When testing that Clang can build modules with the command-lines generated by `clang-scan-deps`, the actual compilation would overwrite artifacts created during the scan, which makes debugging harder than it should be and can lead to errors in multi-step builds.
To prevent this, this patch adds new flag to `clang-scan-deps` that allows developers to customize the directory to use when generating module map paths, instead of always using the module cache. Moreover, the explicit context hash in now part of the PCM path, which will be useful in D102488, where the context hash can change due to command-line pruning.
Reviewed By: Bigcheese
Differential Revision: https://reviews.llvm.org/D103516
Dmitry Preobrazhensky [Fri, 4 Jun 2021 12:38:37 +0000 (15:38 +0300)]
[AMDGPU][MC][NFC] Fixed typos in parser
Differential Revision: https://reviews.llvm.org/D103680
Jean Perier [Fri, 4 Jun 2021 12:27:23 +0000 (14:27 +0200)]
[flang] Generate type info symbols outside of derived type scopes
A recent change was made in https://reviews.llvm.org/D101482 to cope
with kind parameters. It had the side effect of generating some type
info symbols inside derived type scopes. Derived type scope symbols
are meant for components, and other/later compilation phases might
choke when finding compiler generated symbols there that are not
components.
This patch preserves the fix from D101482 while still generating the
symbols outside of derived type scopes.
Differential Revision: https://reviews.llvm.org/D103621
Balázs Kéri [Fri, 4 Jun 2021 10:21:20 +0000 (12:21 +0200)]
[clang][AST] Set correct DeclContext in ASTImporter lookup table for ParmVarDecl.
ParmVarDecl is created with translation unit as the parent DeclContext
and later moved to the correct DeclContext. ASTImporterLookupTable
should be updated at this move.
Reviewed By: martong
Differential Revision: https://reviews.llvm.org/D103231
Bradley Smith [Wed, 26 May 2021 11:07:17 +0000 (12:07 +0100)]
[AArch64][SVE] Add support for using reverse forms of SVE2 shifts
When using and ACLE intrinsic for an SVE2 shift, if the predicate passed
has all relevant lanes active, then use a reversed version of the
instruction if beneficial.
Christian Sigg [Thu, 3 Jun 2021 07:25:22 +0000 (09:25 +0200)]
[mlir] Catch nonconvertible types in async conversion
Reviewed By: ezhulenev, ftynse
Differential Revision: https://reviews.llvm.org/D103592
Sanjay Patel [Thu, 3 Jun 2021 20:13:16 +0000 (16:13 -0400)]
[InstCombine] convert lshr to ashr to eliminate cast op
This is similar to
b865eead7657 ( D103617 ) and fixes:
https://llvm.org/PR50575
41b71f718b94c6f12b did this and more (noted with TODO
comments in the tests), but it didn't handle the case
where the destination is narrower than the source, so
it got reverted.
This is a simple match-and-replace. If there's evidence
that the TODO cases are useful, we can revisit/extend.
Sanjay Patel [Thu, 3 Jun 2021 19:53:11 +0000 (15:53 -0400)]
[InstCombine] add tests for sext-of-trunc-of-lshr; NFC
Nico Weber [Fri, 4 Jun 2021 10:46:19 +0000 (06:46 -0400)]
Revert "[gn build] port
d1d36f7ad (llvm-tapi-diff)"
This reverts commit
13155138c1ce1e91032d467e20e557f9cdbf08f5.
d1d36f7ad was reverted in
5337c7550d.
Jeremy Morse [Fri, 4 Jun 2021 10:18:40 +0000 (11:18 +0100)]
Re-land
ae4303b42c, "Track PHI values through register coalescing"
Was reverted in
0507fc2ffc9, in phi-coalesce-subreg.mir I'd explicitly named
some passes to run instead of specifying a range. As a result some
two-address-instrs weren't correctly rewritten and the verifier got upset.
Original commit message:
[DebugInstrRef][2/3] Track PHI values through register coalescing
In the instruction referencing variable location model, we store variable
locations that point at PHIs in MachineFunction during register allocation.
Unfortunately, register coalescing can substantially change the locations
of registers, and so that PHI-variable-location side table needs
maintenence during the pass.
This patch builds an index from the side table, and whenever a vreg gets
coalesced into another vreg, update the index to record the new vreg that
the PHI happens in. It also accepts a limited range of subregister
coalescing, for example merging a subregister into a larger class.
Differential Revision: https://reviews.llvm.org/D86813
Thomas Preud'homme [Fri, 4 Jun 2021 08:55:33 +0000 (09:55 +0100)]
[test] Fix accidental match in parent_recurse_depth.s
The CHECK-NOT directives in
tools/llvm-dwarfdump/X86/parent_recurse_depth.s can accidentally match
something in the path of the object file created by yaml2obj, for
example:
llvm-project/llvm/test/tools/llvm-dwarfdump/X86/parent_recurse_depth.s:13:12:
error: ONE-NOT: excluded string found in input
^
<stdin>:1:22: note: found here
builds/llvm-projects/mainline/release/test/tools/llvm-dwarfdump/X86/Output/parent_recurse_depth.s.tmp.o: file format elf64-x86-64
^~~~
This commit alleviate this issue by consuming the file name from the
output, forcing all the CHECK-NOT to match what comes after.
Reviewed By: Higuoxing
Differential Revision: https://reviews.llvm.org/D103676
Raphael Isemann [Fri, 4 Jun 2021 08:59:31 +0000 (10:59 +0200)]
[lldb][NFC] Remove a redundant call to weak_ptr::expired
The `lock` call directly will check for us if the `weak_ptr` is expired and
returns an invalid `shared_ptr` (which we correctly handle), so this check is
redundant.
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D103442
Martin Storsjö [Tue, 1 Jun 2021 09:04:58 +0000 (09:04 +0000)]
[libcxx] Don't use an undefined '+' in unsigned/octal/hexal print formats
If building code like this:
unsigned long val = 1000;
snprintf(buf, sizeof(buf), "%+lu", val);
with clang, clang warns
warning: flag '+' results in undefined behavior with 'u' conversion specifier [-Wformat]
Therefore, don't construct such undefined format strings. (There's
no compiler warnings here, as the compiler can't inspect dynamically
assembled format strings.)
This fixes number formatting in mingw-w64 if built with
`__USE_MINGW_ANSI_STDIO` defined (there, the '+' flag causes a
leading plus to be printed when formatting unsigned numbers too,
while the '+' flag doesn't cause any extra leading plus in other
stdio implementations).
Differential Revision: https://reviews.llvm.org/D103444
Fraser Cormack [Thu, 27 May 2021 12:45:23 +0000 (13:45 +0100)]
[SelectionDAG] Extend FoldConstantVectorArithmetic to SPLAT_VECTOR
This patch extends the SelectionDAG's ability to constant-fold vector
arithmetic to include support for SPLAT_VECTOR. This is not only for
scalable-vector types but also for fixed-length vector types, which
helps Hexagon in a couple of cases.
The original RISC-V test case was in fact an infinite DAGCombine loop.
The pattern `and (truncate v1), (truncate v2)` can be combined to
`truncate (and v1, v2)` but the truncate can similarly be combined back
to `truncate (and v1, v2)` (but, crucially, only when one of `v1` or
`v2` is a constant vector).
It wasn't exposed in on fixed-length types because a TRUNCATE of a
constant BUILD_VECTOR was folded into the BUILD_VECTOR itself, whereas
this did not happen for the equivalent (scalable-vector) SPLAT_VECTOR.
Reviewed By: RKSimon, craig.topper
Differential Revision: https://reviews.llvm.org/D103246
Tobias Gysi [Fri, 4 Jun 2021 08:18:19 +0000 (08:18 +0000)]
[mlir][linalg] Cleanup left over uses of deprecated LinalgOp methods.
Replace all remaining uses of deprecated Structured Op Interface methods. This patch is based on https://reviews.llvm.org/D103394.
Differential Revision: https://reviews.llvm.org/D103673
Tim Northover [Wed, 5 May 2021 12:12:55 +0000 (13:12 +0100)]
AArch64: support atomic zext/sextloads
Diana Picus [Mon, 31 May 2021 08:51:11 +0000 (08:51 +0000)]
[flang] Change capitalization for Adjustl/r
Rename the definitions of the character runtime functions Adjustl and
Adjustr (used to be AdjustL and AdjustR respectively).
Also add unit tests (and move some of the helpers to the top of the
file, since they're now used in more than one place).
Differential Revision: https://reviews.llvm.org/D103392
Esme-Yi [Fri, 4 Jun 2021 08:14:47 +0000 (08:14 +0000)]
[Debug-Info] handle DW_CC_pass_by_value/DW_CC_pass_by_reference under strict DWARF.
Summary: When -strict-dwarf=true is specified, the calling convention info
DW_CC_pass_by_value or DW_CC_pass_by_reference can only be generated at DWARF5.
Reviewed By: shchenz, dblaikie
Differential Revision: https://reviews.llvm.org/D103300
Yilong Guo [Fri, 4 Jun 2021 07:37:21 +0000 (09:37 +0200)]
[Format] Fix incorrect pointer detection
https://llvm.org/PR50429
Before:
void f() { f(float(1), a *a); }
After:
void f() { f(float(1), a * a); }
Signed-off-by: Yilong Guo <yilong.guo@intel.com>
Reviewed By: HazardyKnusperkeks, curdeius
Differential Revision: https://reviews.llvm.org/D103589
ShihPo Hung [Thu, 3 Jun 2021 08:10:21 +0000 (16:10 +0800)]
[Sema][RISCV][SVE] Allow ?: to select Typedef BuiltinType in C
This patch solves an error such as:
incompatible operand types ('vbool4_t' (aka '__rvv_bool4_t') and '__rvv_bool4_t')
when one of the value is a TypedefType of the other value in ?:.
Reviewed By: rjmccall
Differential Revision: https://reviews.llvm.org/D103603
Muhammad Omair Javaid [Fri, 4 Jun 2021 06:56:28 +0000 (11:56 +0500)]
Add LLDB in release binaries by default
LLDB is currently not selected in LLVM release testing and thus it
doesnt make its way into prebuilt binaries which build with default
configuration. This patch enables LLDB by default in test-release
script.
Assuming LLDB build by default was disabled back in 2016 LLDB support
for various architectures has a long way since then. It has buildbots
for most architectures and supports a case to be included by default.
Also lldb build can easily be disabled in case some release managers
choose to do so.
Reviewed By: tstellar
Differential Revision: https://reviews.llvm.org/D101864
madhur13490 [Wed, 26 May 2021 05:47:03 +0000 (11:17 +0530)]
[AMDGPU] [IndirectCalls] Don't propagate attributes to address taken functions and their callees
Don't propagate launch bound related attributes to
address taken functions and their callees. The idea
is to do a traversal over the call graph starting at
address taken functions and erase the attributes
set by previous logic i.e. process().
This two phase approach makes sure that we don't
miss out on deep nested callees from address taken
functions as a function might be called directly as
well as indirectly.
This patch is also reattempt to D94585 as latent issues
are fixed in hasAddressTaken function in the recent
past.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D103138
hsmahesha [Fri, 4 Jun 2021 05:46:46 +0000 (11:16 +0530)]
Revert "[AMDGPU] Increase alignment of LDS globals if necessary before LDS lowering."
This reverts commit
d71ff907ef23eaef86ad66ba2d711e4986cd6cb2.
Cyndy Ishida [Fri, 4 Jun 2021 03:53:06 +0000 (20:53 -0700)]
Revert "[llvm] llvm-tapi-diff"
This reverts commit
d1d36f7ad2ae82bea8a6fcc40d6c42a72e21f096.
Reverting this patch to investigate linux bot failures
+ fix with author offline