River Riddle [Wed, 24 Feb 2021 19:42:48 +0000 (11:42 -0800)]
[mlir][docs] Small fix to local Pass Manager reproduction documentation
Hanhan Wang [Wed, 24 Feb 2021 19:39:55 +0000 (11:39 -0800)]
[mlir][linalg] Reuse the symbol if attribute uses are identical.
Depends On D97312
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D97383
Hanhan Wang [Wed, 24 Feb 2021 19:37:18 +0000 (11:37 -0800)]
[mlir][linalg] Support for using output values in TC definitions.
This will allow us to define select(pred, in, out) for TC ops, which is useful
for pooling ops.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D97312
Jonas Devlieghere [Wed, 24 Feb 2021 19:04:47 +0000 (11:04 -0800)]
[lldb] Support debugging utility functions
LLDB uses utility functions to run code in the inferior for its own
internal purposes, such as reading classes from the Objective-C runtime
for example. Because these expressions should be transparent to the
user, we ignore breakpoints and unwind the stack on errors, which
makes them hard to debug.
This patch adds a new setting target.debug-utility-expression that, when
enabled, changes these options to facilitate debugging. It enables
breakpoints, disables unwinding and writes out the utility function
source code to disk so it shows up in the source view.
Differential revision: https://reviews.llvm.org/D97249
Fangrui Song [Wed, 24 Feb 2021 19:10:09 +0000 (11:10 -0800)]
[llvm-objcopy] If input=output, preserve umask bits, otherwise drop S_ISUID/S_ISGID bits
This makes the behavior similar to cp
```
chmod u+s,g+s,o+x a
sudo llvm-strip a -o b
// With this patch, b drops set-user-ID and set-group-ID bits.
// sudo cp a b => b does not have set-user-ID or set-group-ID bits.
```
This also changes the behavior for the following case:
```
chmod u+s,g+s,o+x a
llvm-strip a
// a preserves set-user-ID and set-group-ID bits.
// This matches binutils<2.36 and probably >=2.37. 2.36 and 2.36.1 have some compatibility issues.
```
Differential Revision: https://reviews.llvm.org/D97253
James Y Knight [Wed, 24 Feb 2021 18:51:00 +0000 (13:51 -0500)]
Remove a workaround for MSVC 2013, now that MSVC 2017 is the minimum.
In MSVC 2013, 'alignas(integer-template-arg)' didn't compile; verified
on godbolt that this now works properly.
Jessica Paquette [Tue, 23 Feb 2021 00:26:59 +0000 (16:26 -0800)]
[AArch64][GlobalISel] Fix manual selection for v4s16 and v8s8 G_DUP
The manual G_DUP selection code would produce DUPv16i8 for v8s8s and DUPv8i16
for v4s16.
This adds the missing cases to the manual selection code, and makes it return
false when there is an unexpected size.
Update select-dup.mir to reflect the change.
Differential Revision: https://reviews.llvm.org/D97240
Craig Topper [Wed, 24 Feb 2021 18:06:43 +0000 (10:06 -0800)]
[RISCV] Support fixed vector extract element. Use VL=1 for scalable vector extract element.
I've changed to use VL=1 for slidedown and shifts to avoid extra
element processing that we don't need.
The i64 fixed vector handling on i32 isn't great if the vector type
isn't legal due to an ordering issue in type legalization. If the
vector type isn't legal, we fall back to default legalization
which will bitcast the vector to vXi32 and use two independent extracts.
Doing better will require handling several different cases by
manually inserting insert_subvector/extract_subvector to adjust the type
to a legal vector before emitting custom nodes.
Reviewed By: frasercrmck
Differential Revision: https://reviews.llvm.org/D97319
Joel E. Denny [Wed, 24 Feb 2021 18:05:30 +0000 (13:05 -0500)]
[lit] Add --ignore-fail
For some build configurations, `check-all` calls lit multiple times to
run multiple lit test suites. Most recently, I've found this to be
true when configuring openmp as part of `LLVM_ENABLE_RUNTIMES`, but
this is not the first time.
If one test suite fails, none of the remaining test suites run, so you
cannot determine if your patch has broken them. It can then be
frustrating to try to determine which `check-` targets will run the
remaining tests without getting stuck on the failing tests.
When such cases arise, it is probably best to adjust the cmake
configuration for `check-all` to run all test suites as part of one
lit invocation. Because that fix will likely not be implemented and
land immediately, this patch introduces `--ignore-fail` to serve as a
workaround for developers trying to see test results until it does
land:
```
$ LIT_OPTS=--ignore-fail ninja check-all
```
One problem with `--ignore-fail` is that it makes it challenging to
detect test failures in a script, perhaps in CI. This problem should
serve as motivation to actually fix the cmake configuration instead of
continuing to use `--ignore-fail` indefinitely.
Reviewed By: jhenderson, thopre
Differential Revision: https://reviews.llvm.org/D96371
Weiwei Li [Wed, 24 Feb 2021 18:07:05 +0000 (13:07 -0500)]
[mlir][spirv] Define spv.GLSL.Ldexp
co-authored-by: Alan Liu <alanliu.yf@gmail.com>
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D97228
Craig Topper [Wed, 24 Feb 2021 17:36:28 +0000 (09:36 -0800)]
[LegalizeIntegerTypes] Further improve ExpandIntRes_SADDSUBO for targets where SADDO/SSUBO aren't supported.
Rather than converting 3 signbits to bools and comparing them,
we can do bitwise logic on the whole vector and convert the
resulting sign bit to a bool at the end.
This is still a different algorithm than what we do in LegalizeDAG
through expandSADDOSSUBO. That algorithm needs to know that the
RHS of SSUBO is > 0, but that's costly when the type is split.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D97325
Lei Zhang [Wed, 24 Feb 2021 17:53:28 +0000 (12:53 -0500)]
[mlir] Add constBuilderCall to TypeAttr to simplify builders
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D97344
Simon Pilgrim [Wed, 24 Feb 2021 18:03:05 +0000 (18:03 +0000)]
Revert rGd65ddca83ff85c7345fe9a0f5a15750f01e38420 - "[ValueTracking] ComputeKnownBits - minimum leading/trailing zero bits in LSHR/SHL (PR44526)"
This is causing sanitizer test failures that I haven't been able to fix yet.
Vyacheslav Zakharin [Wed, 24 Feb 2021 00:57:27 +0000 (16:57 -0800)]
[libomptarget] Fixed MSVC build fail caused by __attribute__((used)).
Differential Revision: https://reviews.llvm.org/D97348
Nick Desaulniers [Wed, 24 Feb 2021 17:47:18 +0000 (09:47 -0800)]
[MC][ARM] add .w suffixes for BL (T1) and DBG
F1.2 Standard assembler syntax fields
describes .w and .n suffixes for wide and narrow encodings.
arch/arm/probes/kprobes/test-thumb.c tests installing kprobes for
certain instructions using inline asm. There's a few instructions we
fail to assemble due to missing .w t2InstAliases.
Adds .w suffixes for:
* bl (F5.1.25 BL, BLX (immediate) T1)
* dbg (F5.1.42 DBG T1)
Reviewed By: DavidSpickett
Differential Revision: https://reviews.llvm.org/D97236
Amara Emerson [Thu, 21 Jan 2021 22:54:26 +0000 (14:54 -0800)]
[AArch64] Do not fold SP adjustments into pre-increment addr modes if it overflows the redzone.
Instead of outright disabling this completely with the noredzone attribute,
we only avoid doing the optimization if there are memory operations between
the adjustment and the load/store that the adjustment would be folded into.
This avoids the case of something like a stack cookie being corrupted if an
exception happens before the pre-increment to the SP occurs.
This also prevents the folding happening if we have a redzone, but the offset
being folded is above the redzone amount (128 bytes in this case).
rdar://
73269336
Differential Revision: https://reviews.llvm.org/D95179
Jean Perier [Wed, 24 Feb 2021 17:53:03 +0000 (18:53 +0100)]
[flang] add attribute to trim runtime implementation establish call
CFI allocatable attribute is needed so that the descriptor for the
result can be allocated/deallocated.
Reviewed By: klausler
Differential Revision: https://reviews.llvm.org/D97395
Philip Reames [Wed, 24 Feb 2021 17:50:33 +0000 (09:50 -0800)]
[tests] precommit tests for an upcoming AA improvement
Joachim Protze [Wed, 24 Feb 2021 17:45:47 +0000 (18:45 +0100)]
[OpenMP][Tests][NFC] rename macro to avoid naming clash
Rename a macro use missed in
e0f3acc5d34aa
Shilei Tian [Wed, 24 Feb 2021 17:37:22 +0000 (12:37 -0500)]
[OpenMP] Fixed a crash when offloading to x86_64 with target nowait
PR#49334 reports a crash when offloading to x86_64 with `target nowait`,
which is caused by referencing a nullptr. The root cause of the issue is, when
pushing a hidden helper task in `__kmp_push_task`, it also maps the gtid to its
shadow gtid, which is wrong.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D97329
Joachim Protze [Wed, 24 Feb 2021 17:32:16 +0000 (18:32 +0100)]
[OpenMP][Tests][NFC] lit might also be known as llvm-lit.py
Philip Reames [Wed, 24 Feb 2021 17:25:19 +0000 (09:25 -0800)]
Revert "[tests] Mark an autogened test as such"
This reverts commit
43a569faeb332ae8b355fffc33eec1ef6e33052e.
Unhelpfully, the tool just added the header and didn't actually update any of the tests. I didn't notice until after pushing.
serge-sans-paille [Thu, 11 Feb 2021 20:34:29 +0000 (21:34 +0100)]
Make sure some types are indeed trivially_copyable per llvm::is_trivially_copyable
Test a few types used as llvm::SmallVector parameter. It is important to ensure
we have a consistent behavior for these types to prevent ABI issues as the one
we met in https://bugs.llvm.org/show_bug.cgi?id=39427.
Differential Revision: https://reviews.llvm.org/D96536
Manoel Roemmer [Wed, 24 Feb 2021 17:14:35 +0000 (18:14 +0100)]
[libomptarget] Load images in order of registration
This makes sure that images are loaded in the order in which they are registered with libomptarget.
If a target can load multiple images and these images depend on each other (for example if one image contains the programs target regions and one image contains library code), then the order in which images are loaded can be important for symbol resolution (for example, in the VE plugin).
In this case: because the same code exist in the host binaries, the order in which the host linker loads them (which is also the order in which images are registered with libomptarget) is the order in which the images have to be loaded onto the device.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D95530
Philip Reames [Wed, 24 Feb 2021 17:15:02 +0000 (09:15 -0800)]
[tests] Mark an autogened test as such
Joachim Protze [Wed, 24 Feb 2021 17:12:06 +0000 (18:12 +0100)]
[OpenMP][Tests][NFC] rename macro to avoid naming clash
Rename a macro and macro use missed in
35ab6d6390ecd
Jay Foad [Wed, 24 Feb 2021 12:07:22 +0000 (12:07 +0000)]
[AMDGPU] Add a bit more gfx90a test coverage
Update the GlobalISel version of llvm.amdgcn.workitem.id.ll to mostly
match the SelctionDAG version.
Differential Revision: https://reviews.llvm.org/D97377
Joachim Protze [Wed, 24 Feb 2021 16:54:50 +0000 (17:54 +0100)]
[OpenMP][Tests][NFC] rename macro to avoid naming clash
When including <ostream>, the register_callback macro of the OMPT callback.h
clashes with a function defined in ostream. This patch renames the macro
and includes ompt into the macro name.
Siva Chandra Reddy [Wed, 24 Feb 2021 15:22:58 +0000 (07:22 -0800)]
[libc][NFC] Exclude few targets from the `all` target.
Louis Dionne [Wed, 24 Feb 2021 16:33:41 +0000 (11:33 -0500)]
[libc++] NFC: Fix a few tests in tuple that would succeed trivially
Louis Dionne [Wed, 24 Feb 2021 16:22:37 +0000 (11:22 -0500)]
[libc++] NFC: Fix a few tests in pair that would succeed trivially
Eric Schweitz [Tue, 23 Feb 2021 21:09:10 +0000 (13:09 -0800)]
[flang][fir] Add zero_bits operation.
This patch adds the new zero_bits operation and upstrams other changes
including the following:
- update tablegen syntax to newer forms
- update memory effects annotations
- update documentation [NFC]
- other NFC, such as whitespace and formatting
Differential revision: https://reviews.llvm.org/D97331
Nathan James [Wed, 24 Feb 2021 15:54:10 +0000 (15:54 +0000)]
[clang-tidy] Fix readability-avoid-const-params-in-decls removing const in template paramaters
Fixes https://bugs.llvm.org/show_bug.cgi?id=38035
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D96209
Eugene Zhulenev [Wed, 24 Feb 2021 14:59:28 +0000 (06:59 -0800)]
[mlir] Add polynomial approximation for math::LogOp (using builders API)
Replace math::LogOp with an approximations from the the Julien Pommier's SSE math library
Link: http://gruntthepeon.free.fr/ssemath
Reviewed By: asaadaldien
Differential Revision: https://reviews.llvm.org/D97304
Siva Chandra Reddy [Wed, 24 Feb 2021 08:05:53 +0000 (00:05 -0800)]
[libc][NFC] Remove headergen for the cacheline size macro.
We want to be able to build and test the string functions in contexts
like that of Fuchsia where LLVM pieces like tablegen are not available.
Since header generation uses tablegen, we are removing the dependency on
headergen here.
Reviewed By: gchatelet
Differential Revision: https://reviews.llvm.org/D97363
Nathan James [Wed, 24 Feb 2021 15:22:53 +0000 (15:22 +0000)]
[clang-tidy][test] Allow specifying potentially unused suffixes
If a check-suffix is only required for a CHECK-FIXES or CHECK-MESSAGES. check_clang_tidy will pass the prefixes CHECK-FIXES<...> and CHECK-MESSAGES<...> to FileCheck.
This will result in a FileCheck failing because of an unused prefix.
This addresses the problem by not passing unused prefixes. Its also possible to fix this be passing `--allow-unused-prefixes` flag to FileCheck, but seeing as we have already done the legwork in the script to see its unused, this fix seems the better way to go.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D97322
Jinsong Ji [Wed, 24 Feb 2021 14:27:23 +0000 (14:27 +0000)]
[Coverage][Unittest] Fix stringref issue
We will pass StringRef and change it in reader.
But we reuse the same Filename vector without clear it,
so in some systems, we may clobbeer previous results.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D97353
Jez Ng [Wed, 24 Feb 2021 14:42:52 +0000 (09:42 -0500)]
[lld-macho] Add REQUIRES to incompatible-arch-tapi test
Sander de Smalen [Wed, 24 Feb 2021 11:54:18 +0000 (11:54 +0000)]
[InstructionCost] NFC: Fix up missing cases in LoopVectorize and CodeGenPrep.
This fixes the types of a few more cost variables to be of type InstructionCost.
Nico Weber [Wed, 24 Feb 2021 14:06:12 +0000 (09:06 -0500)]
Revert "[ValueTracking] computeKnownBitsFromShiftOperator - remove non-zero shift amount handling."
This reverts commit
d37400168ce2f1f9ccc91847431f5b8c020a7d67.
Breaks Analysis/./AnalysisTests/ComputeKnownBitsTest.KnownNonZeroShift
Simon Pilgrim [Wed, 24 Feb 2021 13:49:00 +0000 (13:49 +0000)]
[ValueTracking] computeKnownBitsFromShiftOperator - remove non-zero shift amount handling.
This no longer affects any tests after the improvements to the KnownBits shift helpers.
Alexander Belyaev [Wed, 24 Feb 2021 10:39:25 +0000 (11:39 +0100)]
[mlir] Add a builder to `linalg.tiled_loop`.
https://llvm.discourse.group/t/rfc-add-linalg-tileop/2833
Differential Revision: https://reviews.llvm.org/D97372
Raphael Isemann [Wed, 24 Feb 2021 13:08:49 +0000 (14:08 +0100)]
[lldb] Prevent double new lines behind errors/warning/messages from LLDB commands
The current API for printing errors/warnings/messages from LLDB commands
sometimes adds newlines behind the messages for the caller. However, this
happens unconditionally so when the caller already specified a trailing newline
in the error message (or is trying to print a generated error message that ends
in a newline), LLDB ends up printing both the automatically added newline and
the one that was in the error message string. This leads to all the randomly
appearing new lines in error such as:
```
(lldb) command a
error: 'command alias' requires at least two arguments
(lldb) apropos a b
error: 'apropos' must be called with exactly one argument.
(lldb) why is there an empty line behind the second error?
```
This code adds a check that only appends the new line if the passed message
doesn't already contain a trailing new line.
Also removes the AppendRawWarning which had only one caller and doesn't serve
any purpose now.
Reviewed By: #lldb, mib
Differential Revision: https://reviews.llvm.org/D96947
Jay Foad [Fri, 29 Jan 2021 16:03:30 +0000 (16:03 +0000)]
[AMDGPU] Add more PAL metadata register names
Add all the registers that are currently used by
LLPC: https://github.com/GPUOpen-Drivers/llpc
This only affects disassembly of PAL metadata generated by LLPC and
similar frontends.
Differential Revision: https://reviews.llvm.org/D95619
Christian Sigg [Sat, 20 Feb 2021 21:16:56 +0000 (22:16 +0100)]
[mlir] Specify cuda-runner pass pipeline as command line options.
The cuda-runner registers two pass pipelines for nested passes,
so that we don't have to use verbose textual pass pipeline specification.
Reviewed By: herhut
Differential Revision: https://reviews.llvm.org/D97091
Jay Foad [Mon, 25 Jan 2021 17:40:56 +0000 (17:40 +0000)]
[AMDGPU] Update s_sendmsg messages
Update the list of s_sendmsg messages known to the assembler and
disassembler and validate the ones that were added or removed in gfx9
and gfx10.
Differential Revision: https://reviews.llvm.org/D97295
Raphael Isemann [Wed, 24 Feb 2021 13:03:30 +0000 (14:03 +0100)]
[lldb][NFC] Move trivial ValueObject getters/setters to the header
NFC refactoring that moves the definitions of all the trivial getters/setters to the header file
which is what we usually do in LLVM.
Reviewed By: #lldb, JDevlieghere
Differential Revision: https://reviews.llvm.org/D97298
Raphael Isemann [Wed, 24 Feb 2021 12:26:45 +0000 (13:26 +0100)]
[lldb][NFC] Rename the second ValueObjectManager to ValueObjectUpdater and remove the dead code
`ValueObject.h` contains the `ValueObject::ValueObjectManager` type which is
just a typedef for the ClusterManager that takes care of the whole ValueObject
memory management. However, there is also `ValueObjectManager` defined in the
same header which is only used in the curses UI implementation and consists
mostly of dead and completely untested code.
This code been around since a while (it was added in 2016 as
8369b28da0750129ababae357bea98940800a0e0), so I think we shouldn't just revert
the whole patch.
Instead this patch just moves the class to its own header that it isn't just
hiding in the ValueObject header and renames it to `ValueObjectUpdater` that it
at least has a unique name (which I hope also slightly better reflects the
purpose of this class). I also deleted all the dead code branches and functions.
Reviewed By: #lldb, mib, JDevlieghere
Differential Revision: https://reviews.llvm.org/D97287
Anastasia Stulova [Wed, 24 Feb 2021 12:27:15 +0000 (12:27 +0000)]
[OpenCL] Allow taking address of functions as an extension.
When '__cl_clang_function_pointers' extension is enabled
the parser should allow obtaining the function address.
This fixes PR49264!
Differential Revision: https://reviews.llvm.org/D97203
Raphael Isemann [Wed, 24 Feb 2021 12:25:18 +0000 (13:25 +0100)]
[lldb] Add asserts that prevent construction of cycles in the decl origin tracking
LLDB tracks where any imported `clang::Decl` originally came from via a simple
map from 'imported decl' to 'original decl'. That information is used to later
complete parts of the Decl when more information is requested about a certain
Decl (e.g., via the ExternalASTSource interface from Clang).
When finding the 'original decl' for a given decl, the ASTImporterDelegate
essentially just recursively follows the previously mentioned map from
'imported' to 'original decl' until it can find any further 'original decl'. The
final found decl is then the one that will be imported. The recursion is
necessary as in LLDB we don't just import decls from one ASTContext to another,
but also from one ASTContext to another via a (potentially temporary)
ASTContext. For example, the expression parser creates a temporary ASTContext
for parsing the current expression.
The problem with the recursion is however that if we somehow get a cycle into
our mapping, then the ASTImporterDelegate will just infinite recurse. As the
infinite recursion usually happens after the cycle was already created in a code
path such as completing a type, the crash backtraces we get for these bugs are
not very useful. However having the backtrace where the faulty map entry is
created usually makes the code trivial to fix (as there should be some rogue
CopyType call or something similar nearby. See for example D96366).
This patch tries to make these issues easier to track down by putting a bunch of
sanity asserts in the code that fills out the map. All the asserts are just
checking that there is no direct cycle (ASTContext maps to itself) when updating
the origin tracking map.
The assert in the ASTImportDelegate constructor is an `lldbassert` (which also
is getting checked in release builds with disabled asserts) as the code path
there is pretty cold and we can reliably detect a rogue CopyType call from
there.
I also had to update some code in
`ClangASTImporter::ASTImporterDelegate::Imported`. This code already had a
safety check for creating a cycle in the origin tracking map, but it still
constructed an ASTImporter while checking for the cycle (by requesting a
delegate via `GetDelegate` and passing two identical ASTContexts which looks
like a rogue CopyType call to the checks).
Reviewed By: shafik
Differential Revision: https://reviews.llvm.org/D97300
Simon Pilgrim [Wed, 24 Feb 2021 12:12:43 +0000 (12:12 +0000)]
[ValueTracking] ComputeKnownBits - minimum leading/trailing zero bits in LSHR/SHL (PR44526)
Followup to D72573 - as detailed in https://blog.regehr.org/archives/1709 we don't make use of the known leading/trailing zeros for shifted values in cases where we don't know the shift amount value.
Stop ValueTracking returning zero for poison shift patterns and use the KnownBits shift helpers directly.
Extend KnownBits::shl to combine all possible shifted combinations if both min/max shift amount values are in range.
Differential Revision: https://reviews.llvm.org/D90479
Pierre Gousseau [Wed, 24 Feb 2021 12:01:56 +0000 (12:01 +0000)]
[asan] Avoid putting globals in a comdat section when targetting elf.
Putting globals in a comdat for dead-stripping changes the semantic and
can potentially cause false negative odr violations at link time.
If odr indicators are used, we keep the comdat sections, as link time
odr violations will be dectected for the odr indicator symbols.
This fixes PR 47925
Simon Pilgrim [Wed, 24 Feb 2021 11:48:03 +0000 (11:48 +0000)]
[Utils] collectBitParts - add truncate() handling
Lang Hames [Wed, 24 Feb 2021 11:32:18 +0000 (22:32 +1100)]
[docs][JITLink] Remove the JITLink doc for now.
I'll reinstate and continue investigation tomorrow.
Lang Hames [Wed, 24 Feb 2021 11:22:16 +0000 (22:22 +1100)]
[docs][JITLink] Yet more experiments to try to understand sphinx error.
Lang Hames [Wed, 24 Feb 2021 11:14:17 +0000 (22:14 +1100)]
[docs][JITLink] More experiments to try to understand sphinx error.
OCHyams [Wed, 24 Feb 2021 11:09:18 +0000 (11:09 +0000)]
[dexter] Force dexter tests to use the host triple
If the default target and host triple don't match then print the following
message when the lit test runs:
Forcing dexter tests to use host triple {HOST_TRIPLE}.
If we can't target the host arch then, when lit runs, we mark
the dexter test directories as UNSUPPORTED and print the message:
Host triple {HOST_TRIPLE} not supported. Skipping dexter tests in
the debuginfo-tests project.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D96494
Kadir Cetinkaya [Wed, 24 Feb 2021 09:42:42 +0000 (10:42 +0100)]
[clangd] Fix a race
Differential Revision: https://reviews.llvm.org/D97366
Simon Pilgrim [Wed, 24 Feb 2021 11:08:49 +0000 (11:08 +0000)]
[DAG] Add basic mul-with-overflow constant folding support
As noticed on D97160
Lang Hames [Wed, 24 Feb 2021 11:04:14 +0000 (22:04 +1100)]
[docs][JITLink] Make ``ObjectLinkingLayer`` not a paragraph start.
More experiments as I try to placate sphinx.
Lang Hames [Wed, 24 Feb 2021 10:55:49 +0000 (21:55 +1100)]
[docs][JITLink] Return to `` for inline literals.
Also awkwardly reformat text to test whether the error is occurring
on the line with the '::', or the previous one.
Lang Hames [Wed, 24 Feb 2021 10:47:20 +0000 (21:47 +1100)]
[docs][JITLink] Try explicit literal blocks for monospace list elements.
Lang Hames [Wed, 24 Feb 2021 10:40:01 +0000 (21:40 +1100)]
[docs][JITLink] More attempted fixes for formatting issues in the JITLink doc.
Try using the literal domain for `ObjectLinkingLayer::Plugin` and literal
blocks for multi-line method names.
Florian Hahn [Wed, 24 Feb 2021 09:55:39 +0000 (09:55 +0000)]
Recommit "[LV] Allow tryToCreateWidenRecipe to return a VPValue, use for blends."
This reverts the revert commit
437f0bbcd509d0ed71b91ec1f86f48c2f4aae980.
It adds a new toVPRecipeResult, which forces VPRecipeOrVPValueTy to be
constructed with a VPRecipeBase *. This should address ambiguous
constructor issues for recipe sub-types that also inherit from VPValue.
Alexander Belyaev [Wed, 24 Feb 2021 10:22:10 +0000 (11:22 +0100)]
[mlir][linalg] Fix Linalg roundtrip test.
The test did not check whether the operations can be parsed again after
printing them once.
Differential Revision: https://reviews.llvm.org/D97368
Douglas Yung [Wed, 24 Feb 2021 10:24:26 +0000 (02:24 -0800)]
Update REQUIRES line in 4 tests that attempt to use arm64 which should be aarch64 not arm.
Lang Hames [Wed, 24 Feb 2021 10:23:10 +0000 (21:23 +1100)]
[docs][JITLink] Sphinx does not like '::' in monotype. Try using a
cpp domain expr instead.
Lang Hames [Wed, 24 Feb 2021 10:04:35 +0000 (21:04 +1100)]
[docs][JITLink] Add a JITLink design and API document.
Lang Hames [Wed, 24 Feb 2021 08:17:35 +0000 (19:17 +1100)]
[JITLink] Add assertions, fix a comment.
The new assertions check that Addressables removed when removing
external or absolute symbols are not referenced by another symbol.
A comment on post-fixup passes is updated: vmaddrs have all been
set up by the time the pre-fixup passes are run, post-fixup passes
run after fixups have been applied to content.
Lang Hames [Wed, 24 Feb 2021 08:16:16 +0000 (19:16 +1100)]
[JITLink] Fix comments about JITLink's generic link algorithm.
These comments had gotten out of date with the code.
Florian Hahn [Wed, 24 Feb 2021 09:30:30 +0000 (09:30 +0000)]
[AArch64] Use CMTST for != 0 vector compares (vnot (CMEQz A)).
(CMTST A, A) will only set elements to 0 if the element is 0 in A. Use
it for != 0 compares, which currently use (vnot (CMEQz A)). This saves a
mvn instruction.
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D97303
Sven van Haastregt [Wed, 24 Feb 2021 09:27:22 +0000 (09:27 +0000)]
[OpenCL] Add ndrange builtin functions to TableGen
Also ensure all kernel enqueue functions have CL 2.0 as minimum
version.
Differential Revision: https://reviews.llvm.org/D97060
Sven van Haastregt [Wed, 24 Feb 2021 09:27:13 +0000 (09:27 +0000)]
[OpenCL] Add declarations with enum/typedef args
Add the remaining missing builtin function declarations that have enum
or typedef argument or return types.
Differential Revision: https://reviews.llvm.org/D96860
Martin Storsjö [Thu, 22 Oct 2020 09:08:33 +0000 (09:08 +0000)]
[libcxx] [test] Don't pass INCLUDE to clang via -isystem
Passing the MSVC include dirs via -isystem makes them included before
clang's own include resource dir (<prefix>/lib/clang/<version>/include).
This causes includes of stddef.h to bypass clang's stddef.h which
defines max_align_t, which libc++ needs defined.
This was added in
4372f06d0fcaba1a6913e2f37be064e06a7b5b5b when the
initial windows testing support was added, and has been brought along
since. It's unclear if this was needed back then - now it no longer is
needed at least, and since libc++ started depending on max_align_t, this
became an issue.
Differential Revision: https://reviews.llvm.org/D97167
Martin Storsjö [Mon, 15 Feb 2021 11:30:18 +0000 (13:30 +0200)]
[LLD] [COFF] Allow invoking lib.exe mode via -lib in addition to /lib
Remove a stray -lib argument in guardcf-lto.ll; llvm-lib doesn't
support generating import libs from a def file unlike lib.exe.
Previously this worked because the -lib argument was ignored
(printing only a warning).
Differential Revision: https://reviews.llvm.org/D96699
David Green [Wed, 24 Feb 2021 08:46:15 +0000 (08:46 +0000)]
[ARM] Expand the range of allowed post-incs in load/store optimizer
Currently the load/store optimizer will only fold in increments of the
same size as the load/store. This patch expands that to any legal
immediate for the post-inc instruction.
This is a recommit of
3b34b06fc5908b with correctness fixes and extra
tests.
Differential Revision: https://reviews.llvm.org/D95885
Petr Hosek [Wed, 24 Feb 2021 08:37:54 +0000 (00:37 -0800)]
Revert "[InstrProfiling] Use nobits as __llvm_prf_cnts section type in ELF"
This reverts commit
6b286d93f7ec8518c685a302269e44b06a0a24f3 because
in some cases when the optimizer evaluates the global initializer,
__llvm_prf_cnts may not be entirely zero initialized.
Marek Kurdej [Wed, 24 Feb 2021 08:40:33 +0000 (09:40 +0100)]
[libc++] [docs] [C++2b] Update status page with papers adopted in February 2021 virtual meeting.
Douglas Yung [Wed, 24 Feb 2021 08:02:21 +0000 (00:02 -0800)]
Add REQUIRES aarch64 to test incompatible-arch.s since it fails if that target is not built.
This should fix the PS4 linux buildbot failure: http://lab.llvm.org:8011/#/builders/139/builds/63
Craig Topper [Wed, 24 Feb 2021 07:52:01 +0000 (23:52 -0800)]
[LegalizeIntegerTypes] Use GetExpandedInteger instead of SplitInteger in ExpandIntRes_XMULO.
We know the input is going to be expanded as well, so we should
just ask for the already expanded operands. Otherwise we create
nodes that are just going to need to be legalized.
Cassie Jones [Wed, 24 Feb 2021 07:40:58 +0000 (02:40 -0500)]
[Test][AArch64] Test SADDO/SSUBO narrowing legalization
Reviewed By: aemerson
Differential Revision: https://reviews.llvm.org/D96675
Vitaly Buka [Wed, 24 Feb 2021 00:44:00 +0000 (16:44 -0800)]
[asan] Increase CHECK limit in __sanitizer_annotate_contiguous_container
Asan allocator already support up to (1 << 40) bytes allocations.
Vitaly Buka [Wed, 10 Feb 2021 09:44:05 +0000 (01:44 -0800)]
[ThinLTO, NewPM] Run OptimizerLastEPCallbacks from buildThinLTOPreLinkDefaultPipeline
-O1 and above do dont call real optimizer pipeline in ThinLTO PreLink.
Also clang can't add PostLink OptimizerLastEPCallbacks for in-process ThinLTO.
This results in missing sanitizer passes with ThinLTO.
Simple working solution is just call OptimizerLastEPCallbacks
at the end of buildThinLTOPreLinkDefaultPipeline.
Differential Revision: https://reviews.llvm.org/D96320
Dávid Bolvanský [Wed, 24 Feb 2021 06:08:33 +0000 (07:08 +0100)]
Reduce the number of attributes attached to each function
Patch takes advantage of the implicit default behavior to reduce the number of attributes, which in turns reduces compilation time.
Reviewed By: serge-sans-paille
Differential Revision: https://reviews.llvm.org/D97116
xgupta [Wed, 24 Feb 2021 05:34:35 +0000 (11:04 +0530)]
Revert "patch" it wass my mistake inusing git
This reverts commit
3f30cd73795d17f071cc03926fea28943c65f05f.
Siva Chandra Reddy [Wed, 24 Feb 2021 05:19:05 +0000 (21:19 -0800)]
[libc][NFC] Merge llvmlibc and llvmlibm targets in to a single target.
The single target is called llvmlibc. We can add back smaller libm and
other targets in future if required.
xgupta [Wed, 24 Feb 2021 05:26:10 +0000 (10:56 +0530)]
[Docs] Mention clone depth feature of git in LLVM getting started
The current size of the llvm-project repository exceeds 1 GB. A shallow clone can save a lot of space and time. Some developers might not aware of this feature.
Reviewed By: awarzynski
Differential Revision: https://reviews.llvm.org/D97118
xgupta [Mon, 22 Feb 2021 18:44:18 +0000 (00:14 +0530)]
patch
Dan Liew [Wed, 10 Feb 2021 01:01:41 +0000 (17:01 -0800)]
[ASan] Introduce a way set different ways of emitting module destructors.
Previously there was no way to control how module destructors were emitted
by `ModuleAddressSanitizerPass`. However, we want language frontends (e.g. Clang)
to be able to decide how to emit these destructors (if at all).
This patch introduces the `AsanDtorKind` enum that represents the different ways
destructors can be emitted. There are currently only two valid ways to emit destructors.
* `Global` - Use `llvm.global_dtors`. This was the previous behavior and is the default.
* `None` - Do not emit module destructors.
The `ModuleAddressSanitizerPass` and the various wrappers around it have been updated
to take the `AsanDtorKind` as an argument.
The `-asan-destructor-kind=` command line argument has been introduced to make this
easy to test from `opt`. If this argument is specified it overrides the value passed
to the `ModuleAddressSanitizerPass` constructor.
Note that `AsanDtorKind` is not `bool` because we will introduce a new way to
emit destructors in a subsequent patch.
Note that `AsanDtorKind` is given its own header file because if it is declared
in `Transforms/Instrumentation/AddressSanitizer.h` it leads to compile error
(Module is ambiguous) when trying to use it in
`clang/Basic/CodeGenOptions.def`.
rdar://
71609176
Differential Revision: https://reviews.llvm.org/D96571
Yaxun (Sam) Liu [Fri, 5 Feb 2021 19:40:16 +0000 (14:40 -0500)]
[HIP] Fix managed variable linkage
Currently managed variables are emitted as undefined symbols, which
causes difficulty for diagnosing undefined symbols for non-managed
variables.
This patch transforms managed variables in device compilation so that
they can be emitted as normal variables.
Reviewed by: Artem Belevich
Differential Revision: https://reviews.llvm.org/D96195
Amara Emerson [Tue, 23 Feb 2021 23:43:29 +0000 (15:43 -0800)]
[AArch64][GlobalISel][PostSelectOpt] Constrain reg operands after mutating instructions.
The non-flag setting variants of instructions may have different regclass
requirements. If so, we need to constrain them.
Differential Revision: https://reviews.llvm.org/D97343
Chen Zheng [Wed, 24 Feb 2021 02:48:58 +0000 (21:48 -0500)]
[XCOFF] add C_FILE symbol at index 0 of symbol table.
This is for XCOFF DWARF support.
Seems when DWARF debug is enable, symbol 0 has special usage
for AIX binder. At least, symbol 0 can not be the .text
section. Otherwise, we get some binding time error.
Add correct C_FILE symbol at index 0 here to make AIX binder
work.
Reviewed By: hubert.reinterpretcast
Differential Revision: https://reviews.llvm.org/D97117
Nico Weber [Wed, 24 Feb 2021 03:10:02 +0000 (22:10 -0500)]
Revert "Add more historic DWARF vendor extensions"
This reverts commit
c4a91444689455a35db1e7f50bcd876a3eb86126.
Breaks check-llvm everywhere, see https://reviews.llvm.org/D97242#2583716
Jez Ng [Wed, 24 Feb 2021 02:42:02 +0000 (21:42 -0500)]
[lld-macho] Better deduplication of personality pointers
{D95809} introduced a mechanism for synthetic symbol creation of personality
pointers. When multiple section relocations referred to the same personality
pointer, it would deduplicate them. However, it neglected to consider that we
could have symbol relocations that also refer to the same personality pointer.
This diff fixes it.
In practice, this mix of relocations arises when there is a statically-linked
personality routine that is referenced from multiple object files. Within the
same object file, it will be referred to via section relocations, but
(obviously) other object files will refer to it via symbol relocations. Failing
to deduplicate these references resulted in us going over the
3-personality-pointer limit when linking some larger applications.
Fixes llvm.org/PR48389.
Reviewed By: #lld-macho, thakis, alexshap
Differential Revision: https://reviews.llvm.org/D97245
Jez Ng [Wed, 24 Feb 2021 02:42:00 +0000 (21:42 -0500)]
[lld-macho] Check for arch compatibility when loading ObjFiles and TBDs
The silent failures had confused me a few times.
I haven't added a similar check for platform yet as we don't yet have logic to
infer the platform automatically, and so adding that check would require
updating dozens of test files.
Reviewed By: #lld-macho, thakis, alexshap
Differential Revision: https://reviews.llvm.org/D97209
Jez Ng [Wed, 24 Feb 2021 02:41:54 +0000 (21:41 -0500)]
[lld-macho] Fix semantics & add tests for ARM64 GOT/TLV relocs
I've adjusted the RelocAttrBits to better fit the semantics of
the relocations. In particular:
1. *_UNSIGNED relocations are no longer marked with the `TLV` bit, even
though they can occur within TLV sections. Instead the `TLV` bit is
reserved for relocations that can reference thread-local symbols, and
*_UNSIGNED relocations have their own `UNSIGNED` bit. The previous
implementation caused TLV and regular UNSIGNED semantics to be
conflated, resulting in rebase opcodes being incorrectly emitted for TLV
relocations.
2. I've added a new `POINTER` bit to denote non-relaxable GOT
relocations. This distinction isn't important on x86 -- the GOT
relocations there are either relaxable or non-relaxable loads -- but
arm64 has `GOT_LOAD_PAGE21` which loads the page that the referent
symbol is in (regardless of whether the symbol ends up in the GOT). This
relocation must reference a GOT symbol (so must have the `GOT` bit set)
but isn't itself relaxable (so must not have the `LOAD` bit). The
`POINTER` bit is used for relocations that *must* reference a GOT
slot.
3. A similar situation occurs for TLV relocations.
4. ld64 supports both a pcrel and an absolute version of
ARM64_RELOC_POINTER_TO_GOT. But the semantics of the absolute version
are pretty weird -- it results in the value of the GOT slot being
written, rather than the address. (That means a reference to a
dynamically-bound slot will result in zeroes being written.) The
programs I've tried linking don't use this form of the relocation, so
I've dropped our partial support for it by removing the relevant
RelocAttrBits.
Reviewed By: alexshap
Differential Revision: https://reviews.llvm.org/D97031
Jez Ng [Wed, 24 Feb 2021 02:41:52 +0000 (21:41 -0500)]
[lld-macho] Use full input file name in invalid relocation error message
Just something I noticed while debugging arm relocations...
Reviewed By: #lld-macho, thakis
Differential Revision: https://reviews.llvm.org/D97078
River Riddle [Wed, 24 Feb 2021 02:43:55 +0000 (18:43 -0800)]
[mlir][Inliner] Don't optimize callees in async mode if there is only one to optimize
This avoids unnecessary async overhead in situations that won't benefit from it.
Chen Zheng [Wed, 24 Feb 2021 02:18:47 +0000 (21:18 -0500)]
[Debug-Info][NFC] move emitDwarfUnitLength to MCStreamer class
We may need to do some customization for DWARF unit length in DWARF
section headers for some targets for some code generation path.
For example, for XCOFF in assembly path, AIX assembler does not require
the debug section containing its debug unit length in the header.
Move emitDwarfUnitLength to MCStreamer class so that we can do
customization in different Streamers
Reviewed By: ikudrin
Differential Revision: https://reviews.llvm.org/D95932
Adrian Prantl [Wed, 24 Feb 2021 01:52:21 +0000 (17:52 -0800)]
Add more historic DWARF vendor extensions
The maintainer of libdwarf kindly provided this patch with a bunch of
historic DWARF extensions that are missing from Dwarf.def. This list
is helpful to avoid potential conflicts in the user-defined vendor
extension space in the future.
Patch by David Anderson!
Differential Revision: https://reviews.llvm.org/D97242