OSDN Git Service
Alex Zinenko [Wed, 6 Jan 2021 15:21:08 +0000 (16:21 +0100)]
[mlir] replace LLVM dialect float types with built-ins
Continue the convergence between LLVM dialect and built-in types by replacing
the bfloat, half, float and double LLVM dialect types with their built-in
counterparts. At the API level, this is a direct replacement. At the syntax
level, we change the keywords to `bf16`, `f16`, `f32` and `f64`, respectively,
to be compatible with the built-in type syntax. The old keywords can still be
parsed but produce a deprecation warning and will be eventually removed.
Depends On D94178
Reviewed By: mehdi_amini, silvas, antiagainst
Differential Revision: https://reviews.llvm.org/D94179
Adam Czachorowski [Fri, 8 Jan 2021 16:21:02 +0000 (17:21 +0100)]
[clangd] Add missing "override" to fix the build.
Follow-up to
d4af86581e80ef0f7a6f4a4fff1c97260a726e71
Differential Revision: https://reviews.llvm.org/D94314
David Green [Fri, 8 Jan 2021 16:10:01 +0000 (16:10 +0000)]
[ConstProp] Constant propagation for get.active.lane.mask instrinsics
Similar to the Arm VCTP intrinsics, if the operands of an
active.lane.mask are both known, the constant lane mask can be
calculated. This can come up after unrolling the loops.
Differential Revision: https://reviews.llvm.org/D94103
Adam Czachorowski [Thu, 7 Jan 2021 20:24:40 +0000 (21:24 +0100)]
[clangd] Fix type printing in the presence of qualifiers
When printing QualType with qualifiers like "const", or pointing to an
elaborated type, we would print garbage like:
std::const std::vector<int>&
with the initial std:: being calculated correctly, but inserted in the
wrong place and the second std:: not removed (due to elaborated type).
This affected, among others, ExtractFunction and ExpandAuto tweaks.
This change introduces a new callback to PrintingPolicy, which allows us
to influence the printing of namespace qualifiers. In the future, the
same callback can be used to improve handling of "using namespace"
directives as well.
Fixes:
https://github.com/clangd/clangd/issues/640 (ExtractFunction)
https://github.com/clangd/clangd/issues/264 (ExpandAuto)
First point of https://github.com/clangd/clangd/issues/524
Differential Revision: https://reviews.llvm.org/D94259
Eugene Zhulenev [Fri, 8 Jan 2021 15:43:54 +0000 (07:43 -0800)]
Revert "[mlir:JitRunner] Use custom shared library init/destroy functions if available"
This reverts commit
84dc9b451bfd62474f44dd1af0e4955a0110d523.
Fix Windows breakage: http://lab.llvm.org:8011/#/builders/13/builds/3658/steps/6/logs/stdio
Differential Revision: https://reviews.llvm.org/D94309
Simon Pilgrim [Fri, 8 Jan 2021 15:08:12 +0000 (15:08 +0000)]
[X86][SSE] Fold unpack(hop(),hop()) -> permute(hop())
UNPCKL/UNPCKH only uses one op from each hop, so we can merge the hops and then permute the result.
David Green [Fri, 8 Jan 2021 15:15:08 +0000 (15:15 +0000)]
[ARM][LV] Additional loop invariant reduction test. NFC
Eugene Zhulenev [Fri, 8 Jan 2021 11:14:04 +0000 (03:14 -0800)]
[mlir:JitRunner] Use custom shared library init/destroy functions if available
Use custom mlir runner init/destroy functions to safely init and destroy shared libraries loaded by the JitRunner.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D94270
Paul C. Anagnostopoulos [Fri, 8 Jan 2021 15:10:05 +0000 (10:10 -0500)]
[TableGen] Remove unused declaration that caused build failures.
Heejin Ahn [Sat, 26 Dec 2020 00:14:35 +0000 (16:14 -0800)]
[WebAssembly] Rename wasm_rethrow_in_catch intrinsic/builtin
`wasm_rethrow_in_catch` intrinsic and builtin are used in order to
rethrow an exception when the exception is caught but there is no
matching clause within the current `catch`. For example,
```
try {
foo();
} catch (int n) {
...
}
```
If the caught exception does not correspond to C++ `int` type, it should
be rethrown. These intrinsic/builtin were renamed `rethrow_in_catch`
because at the time I thought there would be another intrinsic for C++'s
`throw` keyword, which rethrows an exception. It turned out that `throw`
keyword doesn't require wasm's `rethrow` instruction, so we rename
`rethrow_in_catch` to just `rethrow` here.
Reviewed By: dschuff, tlively
Differential Revision: https://reviews.llvm.org/D94038
David Green [Fri, 8 Jan 2021 14:54:16 +0000 (14:54 +0000)]
[ARM] Update and regenerate test checks. NFC
Paul C. Anagnostopoulos [Wed, 16 Dec 2020 21:25:54 +0000 (16:25 -0500)]
[TableGen] Add the assert statement, step 1
Differential Revision: https://reviews.llvm.org/D93911
This first step adds the assert statement and supports it at top level
and in record definitions. Later steps will support it in class
definitions and multiclasses.
Kiran Chandramohan [Thu, 7 Jan 2021 15:51:55 +0000 (15:51 +0000)]
[MLIR][OpenMP] Attribute to include WsLoop upperbound
This patch adds an attribute `inclusive` which if present causes
the upperbound to be included in the loop iteration interval.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D94235
Simon Pilgrim [Fri, 8 Jan 2021 14:37:19 +0000 (14:37 +0000)]
[X86][SSE] Add vphaddd/vphsubd unpack(hop(),hop()) tests
Alexey Bataev [Fri, 8 Jan 2021 13:31:07 +0000 (05:31 -0800)]
[SLP][NFC]Add a test for reused shrink check, NFC.
Xiangling Liao [Thu, 7 Jan 2021 22:16:33 +0000 (17:16 -0500)]
[NFC] Renaming PackStack to AlignPackStack
This patch renames PackStack and related variable names to also contain align across Clang.
As it is right now, Clang already uses one stack to record the information from both #pragma
align and #pragma pack. Leaving it as PackStack is confusing, and could cause people to
ignore #pragma align when developing code that interacts with PackStack.
Differential Revision: https://reviews.llvm.org/D93901
Simon Pilgrim [Fri, 8 Jan 2021 13:58:46 +0000 (13:58 +0000)]
[X86][SSE] Add tests for unpack(hop(),hop())
We should be able to convert these to permute(hop()) as we only ever use one of the ops from each hop.
KareemErgawy-TomTom [Fri, 8 Jan 2021 13:48:48 +0000 (14:48 +0100)]
[MLIR][SPIRV] Add `UsableInSpecConstantOp` trait.
Instead of checking explicitly checking for whether an op is usalbe
inside a `SpecConstantOperationOP`, this commit adds a new trait to
filter such ops.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D94288
Kazushi (Jam) Marukawa [Fri, 8 Jan 2021 11:10:02 +0000 (20:10 +0900)]
[VE] Support pack_f32p and pack_f32a intrinsic instructions
Support pack_f32p and pack_f32a intrinsic instructions and regression tests.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D94296
Heejin Ahn [Thu, 24 Dec 2020 11:07:24 +0000 (03:07 -0800)]
[WebAssembly] Change label numbers to variables in test
cfg-stackify-eh.ll contains many `CHECK` lines specifying label / catch
comments with numbers. These numbers are subject to change every time
any block/loop/try is added in the middle in existing functions or any
other function is added in the middle of the file, generating a large
number of lines in diffs. This change converts them to variables so they
can be more resistent to future changes.
Reviewed By: dschuff, tlively
Differential Revision: https://reviews.llvm.org/D94037
Anastasia Stulova [Fri, 8 Jan 2021 13:37:27 +0000 (13:37 +0000)]
[OpenCL] Documentation for experimental C++ libs
Started a new doc section about the OpenCL experimental
features and described ongoing work on C++ libraries
e.g. type traits.
Tags: #clang
Differential Revision: https://reviews.llvm.org/D94188
Alexander Belyaev [Fri, 8 Jan 2021 13:33:39 +0000 (14:33 +0100)]
Revert "[SLP]Need shrink the load vector after reordering."
This reverts commit
4284afdf9432f7d756f56b0ab21d69191adefa8d.
This changes computed values in fused_batchnorm_test_cpu.
Not equal to tolerance rtol=1e-06, atol=0.001
Mismatched value: a is different from b.
not close where = (array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1]), array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1]), array([0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
1, 1]), array([0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3,
4, 5]))
not close lhs = [-0.
6636615 -0.
9804948 -1.148275 -0.
68193716 -0.
8572368 -0.
65046215
-0.
6993756 -1.
2244141 -1.
0938729 -0.
50369143 -0.
51830524 -0.738452
-0.
7214286 -0.
48115745 -0.
9380924 -0.
9341769 -0.
5916775 -1.
2896856
-0.
7264182 -0.
9746917 -0.783249 -0.
7659018 -0.
86214024 -0.
47784212]
not close rhs = [ 0.
44102234 0.
12418899 -0.
04359123 0.
42274666 0.
24744703 0.
45422167
0.
40530816 -0.
11973029 0.
01081094 0.
6009924 0.
5863786 0.
3662318
0.
38325527 0.
62352633 0.
1665914 0.
1705069 0.
5130063 -0.
18500176
0.
37826565 0.
12999213 0.
3214348 0.338782 0.
24254355 0.
62684166]
not close dif = [1.
1046839 1.
1046838 1.
1046838 1.
1046839 1.
1046839 1.
1046839 1.
1046838
1.
1046839 1.
1046839 1.
1046839 1.
1046839 1.
1046839 1.
1046839 1.
1046838
1.
1046839 1.
1046839 1.
1046839 1.
1046839 1.
1046839 1.
1046839 1.
1046839
1.
1046839 1.
1046838 1.
1046838]
not close tol = [0.
00100044 0.
00100012 0.
00100004 0.
00100042 0.
00100025 0.
00100045
0.
00100041 0.
00100012 0.
00100001 0.
0010006 0.
00100059 0.
00100037
0.
00100038 0.
00100062 0.
00100017 0.
00100017 0.
00100051 0.
00100019
0.
00100038 0.
00100013 0.
00100032 0.
00100034 0.
00100024 0.
00100063]
LLVM GN Syncbot [Fri, 8 Jan 2021 13:30:54 +0000 (13:30 +0000)]
[gn build] Port
9c4b2225b24
Simon Moll [Fri, 8 Jan 2021 12:53:18 +0000 (13:53 +0100)]
[VP] ISD helper functions [VE] isel for vp_add, vp_and
This implements vp_add, vp_and for the VE target by lowering them to the
VVP_* layer. We also add helper functions for VP SDNodes (isVPSDNode,
getVPMaskIdx, getVPExplicitVectorLengthIdx).
Reviewed By: kaz7
Differential Revision: https://reviews.llvm.org/D93766
Raphael Isemann [Fri, 8 Jan 2021 13:24:48 +0000 (14:24 +0100)]
[lldb][NFC] Refactor setup code for Clang diagnostics
Shivam Gupta [Fri, 8 Jan 2021 13:24:36 +0000 (14:24 +0100)]
[MLIR][NFC] remove unnecessary includes form tablegen command
With [[ https://reviews.llvm.org/D77156 | D77156 ]] includes are not needed here.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D94216
Mark Murray [Tue, 5 Jan 2021 12:10:04 +0000 (12:10 +0000)]
[AArch64] Add +flagm archictecture option, allowing the v8.4a flag modification extension.
Differential Revision: https://reviews.llvm.org/D94081
Mark Murray [Mon, 4 Jan 2021 13:45:49 +0000 (13:45 +0000)]
[AArch64] Add +pauth archictecture option, allowing the v8.3a pointer authentication extension.
Differential Revision: https://reviews.llvm.org/D94083
Alexander Belyaev [Fri, 8 Jan 2021 13:17:18 +0000 (14:17 +0100)]
Revert "Revert "Revert "Revert "Revert "[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis."""""
This reverts commit
6b0ee02747ed22d41e175d15f27025183341e6f8.
Circular dependency again.
Sanjay Patel [Fri, 8 Jan 2021 12:41:26 +0000 (07:41 -0500)]
[SLP] limit verifyFunction to debug build (PR48689)
As noted in PR48689, the verifier may have some kind
of exponential behavior that should be addressed
separately. For now, only run it in debug mode to
prevent problems for release+asserts.
That limit is what we had before D80401, and I'm
not sure if there was a reason to change it in that
patch.
Haojian Wu [Thu, 3 Dec 2020 08:42:46 +0000 (09:42 +0100)]
[clangd] go-to-implementation on a base class jumps to all subclasses.
Differential Revision: https://reviews.llvm.org/D92749
Alex Richardson [Fri, 8 Jan 2021 11:54:43 +0000 (11:54 +0000)]
[libc++] Add missing XFAIL to tests that need __atomic_* libcalls
FreeBSD did not provide the __atomic_* functions as part of the base
system until recently. They were added to libgcc_s in SVN revision r364753
(August 2020), so check for availability of 'non-lockfree-atomics' so that
these tests do not fail unexpectedly on older versions of FreeBSD.
This also removes the #ifndef __APPLE__ from atomic_helpers.h that was used
to work around lack of atomic runtime functions on older Apple platforms
and replaces it with XFAIL: !non-lockfree-atomics.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D88818
Alex Richardson [Fri, 8 Jan 2021 11:53:04 +0000 (11:53 +0000)]
[compiler-rt] Implement __atomic_is_lock_free
This function is called by the __atomic_is_lock_free() builtin if the value
cannot be resolved to true at compile time. Lack of this function is
causing the non-lockfree atomics tests in libc++ to not be run (see D91911)
This function is also added in D85044, but that review also adds support
for using lock-free atomics in more cases, whereas this is a minimal change
that just adds __atomic_is_lock_free() for the implementation of atomic.c.
Reviewed By: ldionne
Differential Revision: https://reviews.llvm.org/D92302
Kazushi (Jam) Marukawa [Thu, 7 Jan 2021 14:32:12 +0000 (23:32 +0900)]
[VE][NFC] Clean ISel patterns for LSV and LVS
Clean ISel patterns for LSV and LVS before upstream more hand-written
ISel patterns.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D94291
Haojian Wu [Fri, 8 Jan 2021 12:42:33 +0000 (13:42 +0100)]
[clangd] Cleanup a remaining Optional<SymbolID> usage, NFC.
Haojian Wu [Fri, 8 Jan 2021 12:29:11 +0000 (13:29 +0100)]
[clangd] NFC, avoid potential ODR violation.
Nicholas Guy [Thu, 7 Jan 2021 15:39:07 +0000 (15:39 +0000)]
[AArch64] Fix crash caused by invalid vector element type
Fixes a crash caused by D91255, when LLVMTy is null when
calling changeExtendedVectorElementType.
Differential Revision: https://reviews.llvm.org/D94234
David Sherwood [Fri, 2 Oct 2020 06:46:42 +0000 (07:46 +0100)]
[SVE] Add support to vectorize_width loop pragma for scalable vectors
This patch adds support for two new variants of the vectorize_width
pragma:
1. vectorize_width(X[, fixed|scalable]) where an optional second
parameter is passed to the vectorize_width pragma, which indicates if
the user wishes to use fixed width or scalable vectorization. For
example the user can now write something like:
#pragma clang loop vectorize_width(4, fixed)
or
#pragma clang loop vectorize_width(4, scalable)
In the absence of a second parameter it is assumed the user wants
fixed width vectorization, in order to maintain compatibility with
existing code.
2. vectorize_width(fixed|scalable) where the width is left unspecified,
but the user hints what type of vectorization they prefer, either
fixed width or scalable.
I have implemented this by making use of the LLVM loop hint attribute:
llvm.loop.vectorize.scalable.enable
Tests were added to
clang/test/CodeGenCXX/pragma-loop.cpp
for both the 'fixed' and 'scalable' optional parameter.
See this thread for context: http://lists.llvm.org/pipermail/cfe-dev/2020-November/067262.html
Differential Revision: https://reviews.llvm.org/D89031
Cullen Rhodes [Mon, 16 Nov 2020 11:02:14 +0000 (11:02 +0000)]
[LV] Legalize scalable VF hints
In the following loop:
void foo(int *a, int *b, int N) {
for (int i=0; i<N; ++i)
a[i + 4] = a[i] + b[i];
}
The loop dependence constrains the VF to a maximum of (4, fixed), which
would mean using <4 x i32> as the vector type in vectorization.
Extending this to scalable vectorization, a VF of (4, scalable) implies
a vector type of <vscale x 4 x i32>. To determine if this is legal
vscale must be taken into account. For this example, unless
max(vscale)=1, it's unsafe to vectorize.
For SVE, the number of bits in an SVE register is architecturally
defined to be a multiple of 128 bits with a maximum of 2048 bits, thus
the maximum vscale is 16. In the loop above it is therefore unfeasible
to vectorize with SVE. However, in this loop:
void foo(int *a, int *b, int N) {
#pragma clang loop vectorize_width(X, scalable)
for (int i=0; i<N; ++i)
a[i + 32] = a[i] + b[i];
}
As long as max(vscale) multiplied by the number of lanes 'X' doesn't
exceed the dependence distance, it is safe to vectorize. For SVE a VF of
(2, scalable) is within this constraint, since a vector of <16 x 2 x 32>
will have no dependencies between lanes. For any number of lanes larger
than this it would be unsafe to vectorize.
This patch extends 'computeFeasibleMaxVF' to legalize scalable VFs
specified as loop hints, implementing the following behaviour:
* If the backend does not support scalable vectors, ignore the hint.
* If scalable vectorization is unfeasible given the loop
dependence, like in the first example above for SVE, then use a
fixed VF.
* Accept scalable VFs if it's safe to do so.
* Otherwise, clamp scalable VFs that exceed the maximum safe VF.
Reviewed By: sdesmalen, fhahn, david-arm
Differential Revision: https://reviews.llvm.org/D91718
Simon Moll [Fri, 8 Jan 2021 10:47:55 +0000 (11:47 +0100)]
[VE] Expand single-element BUILD_VECTOR to INSERT_VECTOR_ELT
We do this mostly to be able to test the insert_vector_elt isel
patterns. As long as we don't, most single element insertions show up as
`BUILD_VECTOR` in the backend.
Reviewed By: kaz7
Differential Revision: https://reviews.llvm.org/D93759
Simon Moll [Fri, 8 Jan 2021 10:35:58 +0000 (11:35 +0100)]
[VE] Extract & insert vector element isel
Isel and tests for extract_vector_elt and insert_vector_elt.
Reviewed By: kaz7
Differential Revision: https://reviews.llvm.org/D93687
Christian Sigg [Thu, 7 Jan 2021 08:40:41 +0000 (09:40 +0100)]
Fix two pessimizing moves.
See https://en.cppreference.com/w/cpp/language/return#Automatic_move_from_local_variables_and_parameters
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D94218
Qiu Chaofan [Fri, 8 Jan 2021 09:50:53 +0000 (17:50 +0800)]
[NFC] Update some PPC tests marked as auto-generated
Update CodeGen regression tests with marker at first line telling it's
auto-generated by the script, under PowerPC directory. For some reason,
these tests are generated but manually written, which makes things
unclear when someone's change affecting them.
However, some tests only show simple change after re-generated, like
extra blank lines, disappearing '.localentry', etc. Besides, some tests
are generated but added checks for debug output. This commit doesn't try
updating them.
Jan Svoboda [Fri, 8 Jan 2021 09:53:12 +0000 (10:53 +0100)]
Revert "[clang][cli] Port DiagnosticOpts to new option parsing system"
This reverts commit
8e3230ff
David Green [Fri, 8 Jan 2021 09:50:10 +0000 (09:50 +0000)]
[LV] Don't sink into replication regions
The new test case here contains a first order recurrences and an
instruction that is replicated. The first order recurrence forces an
instruction to be sunk _into_, as opposed to after the replication
region. That causes several things to go wrong including registering
vector instructions multiple times and failing to create dominance
relations correctly.
Instead we should be sinking to after the replication region, which is
what this patch makes sure happens.
Differential Revision: https://reviews.llvm.org/D93629
Kazushi (Jam) Marukawa [Thu, 7 Jan 2021 14:27:39 +0000 (23:27 +0900)]
[VE] Add SVOB intrinsic instruction
Add SVOB intrinsic instruction and a regression test.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D94279
Jan Svoboda [Tue, 22 Dec 2020 14:05:16 +0000 (15:05 +0100)]
[clang][cli] Port DiagnosticOpts to new option parsing system
This patch introduces additional infrastructure necessary to accommodate DiagnosticOptions.
DiagnosticOptions are unique in that they are parsed by the same function in cc1 AND in the Clang driver. The call to the parsing function from the driver occurs early on in the compilation process, where no proper DiagnosticEngine exists, because the diagnostic options (passed through command line) are not known yet.
To preserve the current behavior, we need to be able to selectively parse:
* all options (for -cc1),
* only diagnostic options (for driver).
This patch achieves that in the following way:
* new MacroPrefix field is added to the Option TableGen class,
* new IsDiag TableGen mixin sets MacroPrefix to "DIAG_",
* TableGen backend serializes option records into a macro with the prefix,
* CompilerInvocation parse/generate methods define the [DIAG_]OPTION_WITH_MARSHALLING macros to handle diagnostic options separately.
Depends on D93700, D93701 & D93702.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D84673
Sjoerd Meijer [Fri, 8 Jan 2021 09:04:56 +0000 (09:04 +0000)]
[MachineLoop] New helper isLoopInvariant()
This factors out code from MachineLICM that determines whether an instruction
is loop-invariant, which is a generally useful function. Thus this allows to
use that helper elsewhere too.
Differential Revision: https://reviews.llvm.org/D94082
David Sherwood [Tue, 5 Jan 2021 15:53:06 +0000 (15:53 +0000)]
[AArch64][SVE] Add lowering for llvm abs intrinsic
Add functionality to permit lowering of the abs and neg intrinsics
using the passthru variants.
Differential Revision: https://reviews.llvm.org/D94160
Martin Storsjö [Sun, 15 Nov 2020 22:28:33 +0000 (00:28 +0200)]
[llvm-readobj] [ARMWinEH] Clearly print an invalid case of packed unwind info as such
As the actual windows unwinder doesn't support this case, don't
pretend that it is supported when dumping the generated unwind info
either, even if it would be possible to interpret it as something
sensible.
This should reduce the risk of us emitting such a case in code
(although it's unlikely as long as the unwind info is generated
through the SEH opcodes, as the opcodes can't describe this case).
Differential Revision: https://reviews.llvm.org/D91529
Wang, Pengfei [Fri, 8 Jan 2021 07:36:15 +0000 (15:36 +0800)]
[X86] Correct the comments about comparison intrinsics. NFCI.
Arthur Eubanks [Fri, 8 Jan 2021 04:20:46 +0000 (20:20 -0800)]
[NewPM] Don't error when there's an unrecognized pass name
This currently blocks --print-before/after with a legacy PM pass, for
example when we use the new PM for the optimization pipeline but the
legacy PM for the codegen pipeline. Also in the future when the codegen
pipeline works with the new PM there will be multiple places to specify
passes, so even when everything is using the new PM, there will still be
multiple places that can accept different pass names.
Reviewed By: hoy, ychen
Differential Revision: https://reviews.llvm.org/D94283
Raul Tambre [Thu, 7 Jan 2021 10:32:41 +0000 (12:32 +0200)]
[CMake] Don't enable BUILD_WITH_INSTALL_RPATH when using custom build rpath
When `BUILD_WITH_INSTALL_RPATH` is enabled it prevents using a custom rpath only
for the build tree as the install rpath will be used. This makes it impossible to run a
runtimes build when compiling with Clang and wanting the installed rpath to be
empty (i.e. `-DCMAKE_BUILD_RPATH="<some path>" -DCMAKE_SKIP_INSTALL_RPATH=ON`).
Disable `BUILD_WITH_INSTALL_RPATH` when `CMAKE_BUILD_RPATH` is non-empty to
allow for such build scenarios.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D93177
Christudasan Devadasan [Wed, 6 Jan 2021 05:52:23 +0000 (11:22 +0530)]
AMDGPU/GlobalISel: Enable sret demotion
Jonas Devlieghere [Fri, 8 Jan 2021 04:54:30 +0000 (20:54 -0800)]
[lldb] Make DoReadMemory a protected method.
DoReadMemory is LLDB's internal implementation and shouldn't be called
directly.
Differential revision: https://reviews.llvm.org/D94284
Jonas Devlieghere [Fri, 8 Jan 2021 04:12:01 +0000 (20:12 -0800)]
[lldb] Access the ModuleList through iterators where possible (NFC)
Replace uses of GetModuleAtIndexUnlocked and
GetModulePointerAtIndexUnlocked with the ModuleIterable and
ModuleIterableNoLocking where applicable.
Differential revision: https://reviews.llvm.org/D94271
Kazu Hirata [Fri, 8 Jan 2021 04:29:35 +0000 (20:29 -0800)]
[Target] Use llvm::find_if (NFC)
Kazu Hirata [Fri, 8 Jan 2021 04:29:34 +0000 (20:29 -0800)]
[llvm] Use *Set::contains (NFC)
Kazu Hirata [Fri, 8 Jan 2021 04:29:32 +0000 (20:29 -0800)]
[CodeGen] Remove unused function isCallerPreservedOrConstPhysReg (NFC)
The last use of the function was removed on Oct 20, 2018 in commit
8d6ff4c0af843e1a61b76d89812aed91e358de34.
LLVM GN Syncbot [Fri, 8 Jan 2021 04:23:02 +0000 (04:23 +0000)]
[gn build] Port
6b0ee02747e
Artem Dergachev [Fri, 8 Jan 2021 03:23:43 +0000 (19:23 -0800)]
Revert "Revert "Revert "Revert "[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis.""""
This reverts commit
b12f26733a4259c90e5f387aceb9f23c35e003b8.
Fix dead include that looked like another missed circular dependency.
David Blaikie [Fri, 8 Jan 2021 04:04:22 +0000 (20:04 -0800)]
lldb subprogram_ranges.test - remove dependence on temp file name
David Blaikie [Fri, 8 Jan 2021 03:57:14 +0000 (19:57 -0800)]
Fix print-dot-ddg.ll so it doesn't try to write to the source tree (& uses the test temp paths instead)
David Blaikie [Fri, 8 Jan 2021 03:52:48 +0000 (19:52 -0800)]
Fix subprogram_ranges.test by explicitly using lld
Seems consistent with the way other tests in this directory do linking
Alexandre Ganea [Fri, 8 Jan 2021 03:36:59 +0000 (22:36 -0500)]
[LLD][COFF] Simplify function. NFC.
Mehdi Amini [Fri, 8 Jan 2021 02:44:33 +0000 (02:44 +0000)]
Fix MLIR DRR matching when attributes are interleaved with operands
The ODSOperand indexing should ignore the attributes.
Differential Revision: https://reviews.llvm.org/D94281
Nico Weber [Fri, 8 Jan 2021 03:02:00 +0000 (22:02 -0500)]
[gn build] (manually) merge a whole bunch of libc++ header files
I noticed __availability was missing, so I manually diffed the
file lists and put all recently(ish) added headers:
* __availability from
2eadbc86142ba
* concepts from
601f7631827ae
* execution from
0a06eb911b830
* numbers from
4f6c4b473c4a5
Also remove libcxx_install_support_headers like the CMake build did in
6706342f48bea, and unconditionally copy
support/win32/{limits_msvc_win32.h,locale_win32.h} like the CMake
build always did as far as I can tell.
LLVM GN Syncbot [Fri, 8 Jan 2021 02:19:24 +0000 (02:19 +0000)]
[gn build] Port
b12f26733a4
David Blaikie [Fri, 8 Jan 2021 01:01:17 +0000 (17:01 -0800)]
Revert "Revert "Revert "[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis."""
This reverts commit
d2ddc694ff94743d9735aaf07edcaf6db8aaca04.
This still contains a circular dependency between Analysis and CrossTU:
$ grep -r include.*Analysis clang/include/clang/CrossTU
clang/include/clang/CrossTU/CrossTranslationUnit.h:
#include "clang/Analysis/CrossTUAnalysisHelper.h"
$ grep -r include.*CrossTU clang/lib/Analysis
clang/lib/Analysis/PlistHTMLPathDiagnosticConsumer.cpp:
#include "clang/CrossTU/CrossTranslationUnit.h"
clang/lib/Analysis/PlistPathDiagnosticConsumer.cpp:
#include "clang/Analysis/CrossTUAnalysisHelper.h"
Ryan Prichard [Fri, 8 Jan 2021 01:49:29 +0000 (17:49 -0800)]
[builtins] Add COMPILER_RT_BUILTINS_HIDE_SYMBOLS
On Android, when the builtins are linked into a binary, they are
typically linked using -Wl,--exclude-libs so that the symbols aren't
reexported. For the NDK, compiler-rt's default behavior (build the
builtins archive with -fvisibility=hidden) is better so that builtins
are hidden even without -Wl,--exclude-libs.
Android needs the builtins with non-hidden symbols only for a special
case: for backwards compatibility with old binaries, the libc.so and
libm.so DSOs in the platform need to export some builtins for arm32 and
32-bit x86. See D56977.
Control the behavior with a new flag,
`COMPILER_RT_BUILTINS_HIDE_SYMBOLS`, that behaves similarly to the
`*_HERMETIC_STATIC_LIBRARY` in libunwind/libcxx/libcxxabi, so that
Android can build a special builtins variant for libc.so/libm.so.
Unlike the hermetic flags for other projects, this new flag is enabled
by default.
Reviewed By: compnerd, MaskRay
Differential Revision: https://reviews.llvm.org/D93431
clementval [Fri, 8 Jan 2021 01:07:53 +0000 (20:07 -0500)]
[clang] Add powerpc64le-none-linux-gnu to gnu toolchain for PPC64
While trying to compile clang and openmp with a freshly built clang with the gcc/7.4.0
toolchain on the Summit supercomputer I face some error because of the triple under which
the GCC toolchain is installed was not present in for PPC64LE triples.
This patch add the powerpc64le-none-linux-gnu used on system like Summit and Ascent.
Reviewed By: jdenny
Differential Revision: https://reviews.llvm.org/D94261
Ruiling Song [Thu, 17 Dec 2020 00:03:20 +0000 (08:03 +0800)]
[Cloning] Copy metadata of global declarations
We have modules with metadata on declarations, and out-of-tree passes
use that metadata, and we need to clone those modules. We really expect
such metadata is kept during the clone operation.
Reviewed by: arsenm, aprantl
Differential Revision: https://reviews.llvm.org/D93451
Alexandre Ganea [Thu, 7 Jan 2021 23:51:51 +0000 (18:51 -0500)]
Fix build after
eaadb41db6233cf1c9e882d74a31c1f9d6e211ff when the MSVC libs are not in PATH.
Evandro Menezes [Wed, 23 Dec 2020 06:43:15 +0000 (00:43 -0600)]
[RISCV] Define the vfsqrt RVV intrinsics
Define the `vfsqrt` IR intrinsics for the respective V instructions.
Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com>
Co-Authored-by: Evandro Menezes <evandro.menezes@sifive.com>
Differential Revision: https://reviews.llvm.org/D93745
Roman Lebedev [Thu, 7 Jan 2021 22:12:30 +0000 (01:12 +0300)]
[SimplifyCFG] markAliveBlocks(): switch to non-permissive DomTree updates
No actual changes needed, invoke can't have the same block as an unwind
destination and a normal destination.
Roman Lebedev [Thu, 7 Jan 2021 22:08:23 +0000 (01:08 +0300)]
[SimplifyCFG] removeUnwindEdge(): switch to non-permissive DomTree updates
No actual changes needed, Catchswitch cannot unwind to one of its catchpads.
Roman Lebedev [Thu, 7 Jan 2021 21:58:49 +0000 (00:58 +0300)]
[SimplifyCFG] changeToCall(): switch to non-permissive DomTree updates
No actual changes needed, normal and unwind destinations of an invoke
can never be identical.
Roman Lebedev [Thu, 7 Jan 2021 21:52:20 +0000 (00:52 +0300)]
[SimplifyCFG] DeleteDeadBlocks(): switch to non-permissive DomTree updates
No actual changes needed, DetatchDeadBlocks() was already doing the right thing.
Roman Lebedev [Thu, 7 Jan 2021 21:51:29 +0000 (00:51 +0300)]
[SimplifyCFG] MergeBlockIntoPredecessor(): switch to non-permissive DomTree updates
... which requires not deleting edges that were just deleted already,
by not processing the same successor more than once.
Roman Lebedev [Thu, 7 Jan 2021 20:55:21 +0000 (23:55 +0300)]
[SimplifyCFG] changeToUnreachable(): switch to non-permissive DomTree updates
... which requires not deleting edges that were just deleted already,
by not processing the same predecessor more than once.
Roman Lebedev [Thu, 7 Jan 2021 21:10:50 +0000 (00:10 +0300)]
[NFC][SimplifyCFG] Add a test with an undef cond branch to identical destinations
Roman Lebedev [Thu, 7 Jan 2021 20:32:30 +0000 (23:32 +0300)]
[SimplifyCFG] removeUnreachableBlocks(): switch to non-permissive DomTree updates
... which requires not deleting edges that were just deleted already,
by not processing the same predecessor more than once.
Roman Lebedev [Thu, 7 Jan 2021 20:23:36 +0000 (23:23 +0300)]
[NFC][SimplifyCFG] Add test with an unreachable block with two identical successors
Roman Lebedev [Thu, 7 Jan 2021 20:10:43 +0000 (23:10 +0300)]
[SimplifyCFG] TryToSimplifyUncondBranchFromEmptyBlock(): switch to non-permissive DomTree updates
... which requires not deleting edges that were just deleted already,
by not processing the same predecessor more than once.
Roman Lebedev [Thu, 7 Jan 2021 19:32:04 +0000 (22:32 +0300)]
[SimplifyCFG] ConstantFoldTerminator(): switch to non-permissive DomTree updates in `indirectbr` handling
... which requires not deleting edges that were just deleted already.
Roman Lebedev [Thu, 7 Jan 2021 19:21:50 +0000 (22:21 +0300)]
[NFC][SimlifyCFG] Add some indirectbr-of-blockaddress tests
Roman Lebedev [Thu, 7 Jan 2021 18:51:19 +0000 (21:51 +0300)]
[SimplifyCFG] ConstantFoldTerminator(): switch to non-permissive DomTree updates in `SwitchInst` handling
... which requires not deleting edges that will still be present.
Roman Lebedev [Thu, 7 Jan 2021 18:18:50 +0000 (21:18 +0300)]
[SimplifyCFG] ConstantFoldTerminator(): handle matching destinations of condbr earlier
We need to handle this case before dealing with the case of constant
branch condition, because if the destinations match, latter fold
would try to remove the DomTree edge that would still be present.
This allows to make that particular DomTree update non-permissive
Roman Lebedev [Thu, 7 Jan 2021 18:16:48 +0000 (21:16 +0300)]
[NFC][SimplifyCFG] Add a test with cond br on constant w/ identical destinations
Arthur Eubanks [Wed, 30 Dec 2020 04:48:27 +0000 (20:48 -0800)]
[NewPM][NVPTX] Port NVPTX opt passes
There are only two used in the IR optimization pipeline.
Port these and add them to the default pipeline.
Similar to https://reviews.llvm.org/D93863.
I added -mtriple to some tests since under the new PM, the passes are
only available when the TargetMachine is specified.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D93930
Arthur O'Dwyer [Thu, 7 Jan 2021 23:04:41 +0000 (18:04 -0500)]
[libc++] Alphabetize generate_feature_test_macro_components.py. NFCI.
For ease of comparing our list with the official SD-6 list, which is alphabetized.
https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations#library-feature-test-macros
This also alphabetizes the lists of headers in which the macros are
defined, which harmlessly alters many comments in <version>.
Also drive-by-fix some trivial flake8 warnings.
Arthur Eubanks [Wed, 30 Dec 2020 03:54:32 +0000 (19:54 -0800)]
[NewPM][Hexagon] Fix HexagonVectorLoopCarriedReusePass position in pipeline
In https://reviews.llvm.org/D88138 this was incorrectly added with
registerOptimizerLastEPCallback(), when it should be
registerLoopOptimizerEndEPCallback(), matching the legacy PM's
EP_LoopOptimizerEnd.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D93929
Luís Marques [Thu, 7 Jan 2021 23:01:27 +0000 (23:01 +0000)]
[LLDB][RISCV] Add RISC-V ArchSpec and rv32/rv64 variant detection
Adds the RISC-V ArchSpec bits contributed by @simoncook as part of D62732,
plus logic to distinguish between riscv32 and riscv64 based on ELF class.
The patch follows the implementation approach previously used for MIPS.
It defines RISC-V architecture subtypes and inspects the ELF header,
namely the ELF class, to detect the right subtype.
Differential Revision: https://reviews.llvm.org/D86292
Joseph Huber [Thu, 7 Jan 2021 21:43:01 +0000 (16:43 -0500)]
[OpenMP] Always print error messages in libomptarget CUDA plugin
Summary:
Currently error messages from the CUDA plugins are only printed to the user if they have debugging enabled. Change this behaviour to always print the messages that result in offloading failure. This improves the error messages by indidcating what happened when the error occurs in the plugin library, such as a segmentation fault on the device.
Reviewed by: jdoerfert
Differential Revision: https://reviews.llvm.org/D94263
Michael Liao [Thu, 7 Jan 2021 10:24:12 +0000 (05:24 -0500)]
[hip] Enable HIP compilation with `<complex`> on MSVC.
- MSVC has different `<complex>` implementation which calls into functions
declared in `<ymath.h>`. Provide their device-side implementation to enable
`<complex>` compilation on HIP Windows.
Differential Revision: https://reviews.llvm.org/D93638
Matt Arsenault [Wed, 6 Jan 2021 04:25:18 +0000 (23:25 -0500)]
GlobalISel: Fail legalization on narrowing extload below memory size
Louis Dionne [Thu, 7 Jan 2021 22:37:09 +0000 (17:37 -0500)]
[libc++] Fix typo in run-buildbot
The installation directory was never meant to contain a brace.
David Blaikie [Tue, 5 Jan 2021 06:44:59 +0000 (22:44 -0800)]
lldb: Add support for DW_AT_ranges on DW_TAG_subprograms
gcc already produces debug info with this form
-freorder-block-and-partition
clang produces this sort of thing with -fbasic-block-sections and with a
coming-soon tweak to use ranges in DWARFv5 where they can allow greater
reuse of debug_addr than the low/high_pc forms.
This fixes the case of breaking on a function name, but leaves broken
printing a variable - a follow-up commit will add that and improve the
test case to match.
Differential Revision: https://reviews.llvm.org/D94063
Alexandre Ganea [Thu, 7 Jan 2021 21:32:47 +0000 (16:32 -0500)]
[LLD][COFF] When using PCH.OBJ, ensure func_id records indices are remapped under /DEBUG:GHASH
Before this patch, when using LLD with /DEBUG:GHASH and MSVC precomp.OBJ files, we had a bunch of:
lld-link: warning: S_[GL]PROC32ID record in blabla.obj refers to PDB item index 0x206ED1 which is not a LF[M]FUNC_ID record
This was caused by LF_FUNC_ID and LF_MFUNC_ID which didn't have correct mapping to the corresponding TPI records. The root issue was that the indexMapStorage was improperly re-assembled in UsePrecompSource::remapTpiWithGHashes.
After this patch, /DEBUG and /DEBUG:GHASH produce exactly the same debug infos in the PDB.
Differential Revision: https://reviews.llvm.org/D93732
Craig Topper [Thu, 7 Jan 2021 22:15:03 +0000 (14:15 -0800)]
[TableGen] Make CodeGenDAGPatterns::getSDNodeNamed take a StringRef instead of const std::string &.
All callers use a string literal and the getDef method the string
is passed to already takes a StringRef.