Stanislav Mekhanoshin [Mon, 21 Dec 2020 20:31:06 +0000 (12:31 -0800)]
[AMDGPU][GlobalISel] GlobalISel for flat scratch
It does not seem to fold offsets but this is not specific
to the flat scratch as getPtrBaseWithConstantOffset() does
not return the split for these tests unlike its SDag
counterpart.
Differential Revision: https://reviews.llvm.org/D93670
Stanislav Mekhanoshin [Mon, 21 Dec 2020 23:40:46 +0000 (15:40 -0800)]
[AMDGPU] Support unaligned flat scratch in TLI
Adjust SITargetLowering::allowsMisalignedMemoryAccessesImpl for
unaligned flat scratch support. Mostly needed for global isel.
Differential Revision: https://reviews.llvm.org/D93669
Peter Collingbourne [Tue, 15 Dec 2020 22:26:10 +0000 (14:26 -0800)]
scudo: Move the configuration for the primary allocator to Config. NFCI.
This will allow the primary and secondary allocators to share
the MaySupportMemoryTagging bool.
Differential Revision: https://reviews.llvm.org/D93728
Chris Lattner [Tue, 22 Dec 2020 18:35:15 +0000 (10:35 -0800)]
[IR] Add an ImplicitLocOpBuilder helper class for building IR with the same loc.
One common situation is to create a lot of IR at a well known location,
e.g. when doing a big rewrite from one dialect to another where you're expanding
ops out into lots of other ops.
For these sorts of situations, it is annoying to pass the location into
every create call. As we discused in a few threads on the forum, a way to help
with this is to produce a new sort of builder that holds a location and provides
it to each of the create<> calls automatically.
This patch implements an ImplicitLocOpBuilder class that does this. We've had
good experience with this in the CIRCT project, and it makes sense to upstream to
MLIR.
I picked a random pass to adopt it to show the impact, but I don't think there is
any particular need to force adopt it in the codebase.
Differential Revision: https://reviews.llvm.org/D93717
Joseph Huber [Tue, 22 Dec 2020 20:14:30 +0000 (15:14 -0500)]
[OpenMP] Add OpenMP Documentation for Libomptarget environment variables
Add support to the OpenMP web pages for environment variables supported
by Libomptarget and their usage.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D93723
Alex Zinenko [Tue, 22 Dec 2020 10:22:21 +0000 (11:22 +0100)]
[mlir] Remove instance methods from LLVMType
LLVMType contains multiple instance methods that were introduced initially for
compatibility with LLVM API. These methods boil down to `cast` followed by
type-specific call. Arguably, they are mostly used in an LLVM cast-follows-isa
anti-pattern. This doesn't connect nicely to the rest of the MLIR
infrastructure and actively prevents it from making the LLVM dialect type
system more open, e.g., reusing built-in types when appropriate. Remove such
instance methods and replaces their uses with apporpriate casts and methods on
derived classes. In some cases, the result may look slightly more verbose, but
most cases should actually use a stricter subtype of LLVMType anyway and avoid
the isa/cast.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D93680
Thomas Lively [Tue, 22 Dec 2020 22:29:06 +0000 (14:29 -0800)]
[WebAssembly][SIMD] Rename shuffle, swizzle, and load_splats
These instructions previously used prefixes like v8x16 to signify that they were
agnostic between float and int interpretations. We renamed these instructions to
remove this form of prefix in https://github.com/WebAssembly/simd/issues/297 and
https://github.com/WebAssembly/simd/issues/316 and this commit brings the names
in LLVM up to date.
Differential Revision: https://reviews.llvm.org/D93722
Sam McCall [Tue, 22 Dec 2020 21:58:39 +0000 (22:58 +0100)]
[clangd] Release notes for
b8c37153d5393aad96
Christian Sigg [Tue, 22 Dec 2020 16:42:59 +0000 (17:42 +0100)]
[mlir] Lower gpu.memcpy to GPU runtime calls.
Reviewed By: herhut
Differential Revision: https://reviews.llvm.org/D93204
Sam McCall [Tue, 22 Dec 2020 20:36:41 +0000 (21:36 +0100)]
[clangd] Use atomics instead of locks to track periodic memory trimming
Instead of always locking/unlocking a contended mutex, we now do one atomic read
in the common case, and one read + one exchange if the timer has expried.
Also use this for memory profiling which has similar/compatible requirements.
Differential Revision: https://reviews.llvm.org/D93726
Sanjay Patel [Tue, 22 Dec 2020 19:54:09 +0000 (14:54 -0500)]
[SLP] add reduction tests for maxnum/minnum intrinsics; NFC
Sanjay Patel [Tue, 22 Dec 2020 19:13:39 +0000 (14:13 -0500)]
[SLP] use operand index abstraction for number of operands
I think this is NFC currently, but the bug would be exposed
when we allow binary intrinsics (maxnum, etc) as candidates
for reductions.
The code in matchAssociativeReduction() is using
OperationData::getNumberOfOperands() when comparing whether
the "EdgeToVisit" iterator is in-bounds, so this code must
use the same (potentially offset) operand value to set
the "EdgeToVisit".
Nico Weber [Tue, 22 Dec 2020 16:00:57 +0000 (11:00 -0500)]
glld/mac] Don't add names of unreferenced symbols to string table
Before this, a hello world program would contain many many unnecessary
entries in its string table.
No behavior change, just makes the string table in the output smaller
and more like ld64's.
Differential Revision: https://reviews.llvm.org/D93711
Stephen Kelly [Tue, 22 Dec 2020 20:25:10 +0000 (20:25 +0000)]
Try to fix build on Windows
Craig Topper [Tue, 22 Dec 2020 19:40:51 +0000 (11:40 -0800)]
[RISCV] Remove unneeded !eq comparing a single bit value to 0/1 in RISCVInstrInfoVPseudos.td. NFC
Instead we can either use the bit directly. If it was checking for
0 we need to swap the operands or use !not.
Johannes Doerfert [Tue, 22 Dec 2020 19:05:45 +0000 (13:05 -0600)]
[OpenMP][Docs] Fix Typo
Shilei Tian [Tue, 22 Dec 2020 19:05:46 +0000 (14:05 -0500)]
[OpenMP][Docs] Fixed a typo in the doc that can mislead users to a CMake error
When setting `LLVM_ENABLE_RUNTIMES`, lower case word should be used;
otherwise, it can cause a CMake error that specific path is not found.
Reviewed By: ye-luo
Differential Revision: https://reviews.llvm.org/D93719
Johannes Doerfert [Tue, 22 Dec 2020 18:49:11 +0000 (12:49 -0600)]
[OpenMP][Docs] Add FAQ entry about math and complex on GPUs
Reviewed By: tianshilei1992
Differential Revision: https://reviews.llvm.org/D93718
Arnold Schwaighofer [Tue, 15 Dec 2020 21:28:52 +0000 (13:28 -0800)]
Add a llvm.coro.end.async intrinsic
The llvm.coro.end.async intrinsic allows to specify a function that is
to be called as the last action before returning. This function will be
inlined after coroutine splitting.
This function can contain a 'musttail' call to allow for guaranteed tail
calling as the last action.
Differential Revision: https://reviews.llvm.org/D93568
Stanislav Mekhanoshin [Fri, 18 Dec 2020 00:48:04 +0000 (16:48 -0800)]
[AMDGPU] Folding of FI operand with flat scratch
Differential Revision: https://reviews.llvm.org/D93501
Stephen Kelly [Tue, 27 Oct 2020 23:24:20 +0000 (23:24 +0000)]
[clang-tidy] Handle template instantiations in container size check
readability-container-size-empty currently modifies source code based on
AST nodes in template instantiations, which means that it makes
transformations based on substituted types. This can lead to
transforming code to be broken.
Change the matcher implementation to ignore template instantiations
explicitly, and add a matcher to explicitly handle template declarations
instead of instantiations.
Differential Revision: https://reviews.llvm.org/D91302
Arthur Eubanks [Tue, 22 Dec 2020 18:33:09 +0000 (10:33 -0800)]
Revert "[LLDB] Unbreak the build after recent clang changes"
This reverts commit
430d5d8429473c2b10b109991d7577a3cea41140.
Depends on a reverted change.
Arthur Eubanks [Tue, 22 Dec 2020 18:31:21 +0000 (10:31 -0800)]
Revert "[clangd] zap a few warnings"
This reverts commit
95c7b6cadbc9a3d4376ef44edbeb3c8bb5b8d7fc.
Depends on a reverted change.
sameeran joshi [Tue, 22 Dec 2020 18:16:51 +0000 (23:46 +0530)]
Revert "[Flang][openmp][5.0] Add task_reduction clause."
This reverts commit
9a7895dc20852b662a66976d06871ec2a0b968c8.
Reverting due to missing Co-author attribution.
https://reviews.llvm.org/D93105
Arthur Eubanks [Tue, 22 Dec 2020 18:12:44 +0000 (10:12 -0800)]
Revert "DR2064: decltype(E) is only a dependent type if E is type-dependent, not"
This reverts commit
638867afd4bce4a2c56dea041299428af3727d61.
This is part of 5 commits being reverted due to https://crbug.com/1161059. See bug for repro.
Arthur Eubanks [Tue, 22 Dec 2020 18:12:40 +0000 (10:12 -0800)]
Revert "Following up on PR48517, fix handling of template arguments that refer"
This reverts commit
8c1f2d15b826591cdf6bd6b468b8a7d23377b29e.
This is part of 5 commits being reverted due to https://crbug.com/1161059. See bug for repro.
Arthur Eubanks [Tue, 22 Dec 2020 18:12:37 +0000 (10:12 -0800)]
Revert "[c++20] P1907R1: Support for generalized non-type template arguments of scalar type."
This reverts commit
9e08e51a20d0d2b1c5724bb17e969d036fced4cd.
This is part of 5 commits being reverted due to https://crbug.com/1161059. See bug for repro.
Arthur Eubanks [Tue, 22 Dec 2020 18:12:33 +0000 (10:12 -0800)]
Revert "Fix MSVC "not all control paths return a value" warnings. NFCI."
This reverts commit
7e84aa1b81e72d44bcc58ffe1731bfc7abb73ce0.
This is part of 5 commits being reverted due to https://crbug.com/1161059. See bug for repro.
Arthur Eubanks [Tue, 22 Dec 2020 18:11:31 +0000 (10:11 -0800)]
Revert "Fix memory leak complicated non-type template arguments."
This reverts commit
ed13d8c66781b50ff007cb089c5905f9bb9e8af2.
This is part of 5 commits being reverted due to https://crbug.com/1161059. See bug for repro.
Shilei Tian [Tue, 22 Dec 2020 18:14:34 +0000 (13:14 -0500)]
[OpenMP][Docs] Updated the faq about building an OpenMP offloading capable compiler
After some issues about building runtimes along with LLVM were fixed,
building an OpenMP offloading capable compiler is pretty simple. This patch updates
the FAQ part in the doc.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D93671
Andy Yankovsky [Tue, 22 Dec 2020 18:07:44 +0000 (10:07 -0800)]
[lldb] Add SBType::GetEnumerationIntegerType method
Add a method for getting the enumeration underlying type.
Differential revision: https://reviews.llvm.org/D93696
Andy Yankovsky [Tue, 22 Dec 2020 18:06:46 +0000 (10:06 -0800)]
[lldb] Add SBType::IsScopedEnumerationType method
Add a method to check if the type is a scoped enumeration (i.e. "enum
class/struct").
Differential revision: https://reviews.llvm.org/D93690
Nathan James [Tue, 22 Dec 2020 18:06:19 +0000 (18:06 +0000)]
[ADT] Fix some tests after
5d10b8ad
Some bots were failing due to signed/unsigned comparison.
Florian Hahn [Tue, 22 Dec 2020 17:48:01 +0000 (17:48 +0000)]
[LoopDeletion] Add test case where outer loop needs to be deleted.
In the test case @test1, the inner loop cannot be removed, because it
has a live-out value. But the outer loop is a no-op and can be removed.
Philip Reames [Tue, 22 Dec 2020 17:47:11 +0000 (09:47 -0800)]
[tests] precommit a test mentioned in review for D93317
Nathan James [Tue, 22 Dec 2020 17:18:59 +0000 (17:18 +0000)]
[ADT] Add resize_for_overwrite method to SmallVector.
Analagous to the std::make_(unqiue|shared)_for_overwrite added in c++20.
If T is POD, and the container gets larger, any new values added wont be initialized.
This is useful when using SmallVector as a buffer where its planned to overwrite any potential new values added.
If T is not POD, `new (Storage) T` functions identically to `new (Storage) T()` so this will function identically to `resize(size_type)`.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D93532
Paul Walker [Tue, 22 Dec 2020 17:05:02 +0000 (17:05 +0000)]
Fix some misnamed variables in sve-fixed-length-int-minmax.ll.
Jonas Devlieghere [Mon, 21 Dec 2020 21:41:57 +0000 (13:41 -0800)]
[lldb] Abstract scoped timer logic behind LLDB_SCOPED_TIMER (NFC)
This patch introduces a LLDB_SCOPED_TIMER macro to hide the needlessly
repetitive creation of scoped timers in LLDB. It's similar to the
LLDB_LOG(F) macro.
Differential revision: https://reviews.llvm.org/D93663
Kamau Bridgeman [Tue, 22 Dec 2020 17:04:57 +0000 (12:04 -0500)]
[PowerPC][Power10] Exploit store rightmost vector element instructions
Using the store rightmost vector element instructions to do vector
element extraction and store. The rightmost vector element on little
endian is the zeroth vector element, with these patterns that element
can be extracted and stored in one instruction for all vector types.
Differential Revision: https://reviews.llvm.org/D89195
sameeran joshi [Tue, 22 Dec 2020 16:27:26 +0000 (21:57 +0530)]
[Flang][openmp][5.0] Add task_reduction clause.
See OMP-5.0 2.19.5.5 task_reduction Clause.
To add a positive test case we need `taskgroup` directive which is not added hence skipping the test.
This is a dependency for `taskgroup` construct.
Reviewed By: clementval
Differential Revision: https://reviews.llvm.org/D93105
Paul Walker [Fri, 18 Dec 2020 18:42:58 +0000 (18:42 +0000)]
[SVE] Lower vector BITREVERSE and BSWAP operations.
These operations are lowered to RBIT and REVB instructions
respectively. In the case of fixed-length support using SVE we
also lower BITREVERSE operating on NEON sized vectors as this
results in fewer instructions.
Differential Revision: https://reviews.llvm.org/D93606
Christian Sigg [Tue, 22 Dec 2020 16:39:00 +0000 (17:39 +0100)]
[mlir] Add gpu.memcpy op.
Reviewed By: herhut
Differential Revision: https://reviews.llvm.org/D93197
Prateek Gupta [Tue, 22 Dec 2020 16:10:17 +0000 (21:40 +0530)]
[MLIR] Fix lowering of affine operations with return values
This commit addresses the issue of lowering affine.for and
affine.parallel having return values. Relevant test cases are also
added.
Signed-off-by: Prateek Gupta <prateek@polymagelabs.com>
Differential Revision: https://reviews.llvm.org/D93090
Nandor Licker [Wed, 25 Nov 2020 14:01:19 +0000 (14:01 +0000)]
[RISCV] Basic jump table lowering
This patch enables jump table lowering in the RISC-V backend.
In addition to the test case included, the new lowering was
tested by compiling the OCaml runtime and running it under qemu.
Differential Revision: https://reviews.llvm.org/D92097
clementval [Tue, 22 Dec 2020 14:59:50 +0000 (09:59 -0500)]
[openacc][openmp][NFC] Fix typo in comments
Florian Hahn [Tue, 22 Dec 2020 14:44:09 +0000 (14:44 +0000)]
[LV] Use ScalarEvolution::getURemExpr to reduce duplication.
ScalarEvolution should be able to handle both constant and variable trip
counts using getURemExpr, so we do not have to handle them separately.
This is a small simplification of
a56280094e08.
Reviewed By: gilr
Differential Revision: https://reviews.llvm.org/D93677
Paul C. Anagnostopoulos [Tue, 15 Dec 2020 17:47:27 +0000 (12:47 -0500)]
[MCInstrDesc] [TableGen] Reduce size of MCOperandInfo instances.
Differential Revision: https://reviews.llvm.org/D93326
Jan Svoboda [Mon, 21 Dec 2020 12:50:09 +0000 (13:50 +0100)]
[clang] NFC: Refactor custom class into a lambda in CompilerInvocation
Change `makeFlagToValueNormalizer` so that one specialization converts all integral/enum arguments into `uint64_t` and forwards them to the more generic version.
This makes it easy to replace the custom `FlagToValueNormalizer` struct with a lambda, which is the common approach in other (de)normalizers.
Finally, drop custom `is_int_convertbile` in favor of `llvm::is_integral_or_enum`.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D93628
Andrzej Warzynski [Tue, 22 Dec 2020 13:38:13 +0000 (13:38 +0000)]
[flang][driver] Fix formatting in a test (nfc)
Jan Svoboda [Mon, 21 Dec 2020 13:28:09 +0000 (14:28 +0100)]
[clang][cli] Implement `getAllArgValues` marshalling
This infrastructure can be used ~30 more command line options.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D93631
Andrzej Warzynski [Tue, 22 Dec 2020 11:07:58 +0000 (11:07 +0000)]
[flang][driver] Refactor unit tests for frontend actions (nfc)
These patch implements a few non-functional-changes:
* switch to using test fixtures for better code sharing
* rename some variables (e.g. to communicate their purpose a bit better)
This patch doesn't change _what_ is being tested.
Differential Revision: https://reviews.llvm.org/D93544
mydeveloperday [Tue, 22 Dec 2020 12:44:57 +0000 (12:44 +0000)]
[clang-format] NFC keep the code clang-formatted
Sjoerd Meijer [Tue, 22 Dec 2020 12:10:43 +0000 (12:10 +0000)]
[AArch64] Add a test for MachineLICM SinkIntoLoop. NFC.
Stephen Kelly [Sun, 20 Dec 2020 01:32:50 +0000 (01:32 +0000)]
[ASTMatchers] Traverse-ignore range-for implementation details
Differential Revision: https://reviews.llvm.org/D93596
Alex Richardson [Tue, 22 Dec 2020 11:43:48 +0000 (11:43 +0000)]
[compiler-rt] Fix atomic_test.c on macOS
The macOS name mangling adds another underscore. Therefore, on macOS
the __atomic_* functions are actually ___atomic_* in libcompiler_rt.dylib.
To handle this case, prepend the asm() argument with __USER_LABEL_PREFIX__
in the same way that atomic.c does.
Reviewed By: ldionne
Differential Revision: https://reviews.llvm.org/D92833
Alex Richardson [Tue, 22 Dec 2020 11:42:07 +0000 (11:42 +0000)]
[libc++] Add a 'is-lockfree-runtime-function' lit feature
On macOS 10.14 /usr/lib/system/libcompiler_rt.dylib contains all the
`__atomic_load*`, etc. functions but does not include the `__atomic_is_lock_free`
function. The lack of this function causes the non-lockfree-atomics feature
to be set to false even though large atomic operations are actually
supported, it's just the is_lock_free() function that is missing.
This is required so that the !non-lockfree-atomics feature can be used
to XFAIL tests that require runtime library support (D88818).
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D91911
Nico Weber [Tue, 22 Dec 2020 11:51:19 +0000 (06:51 -0500)]
Revert "-fstack-clash-protection: Return an actual error when used on unsupported OS"
This reverts commit
4d59c8fdb955ea0d668b854f467e12bce05a8857.
Breaks tens of thousands of tests, and had pending review comments, see
comments on https://reviews.llvm.org/D92245 (and e.g.
http://lab.llvm.org:8011/#/builders/109/builds/5236 for failures).
Nemanja Ivanovic [Tue, 22 Dec 2020 11:43:33 +0000 (05:43 -0600)]
[PowerPC] Restore stack ptr from base ptr when available
On subtargets that have a red zone, we will copy the stack pointer to the base
pointer in the prologue prior to updating the stack pointer. There are no other
updates to the base pointer after that. This suggests that we should be able to
restore the stack pointer from the base pointer rather than loading it from the
back chain or adding the frame size back to either the stack pointer or the
frame pointer.
This came about because functions that call setjmp need to restore the SP from
the FP because the back chain might have been clobbered
(see https://reviews.llvm.org/D92906). However, if the stack is realigned, the
restored SP might be incorrect (which is what caused the failures in the two
ASan test cases).
This patch was tested quite extensivelly both with sanitizer runtimes and
general code.
Differential revision: https://reviews.llvm.org/D93327
Nico Weber [Tue, 22 Dec 2020 11:35:40 +0000 (06:35 -0500)]
[gn build] (manually) port
b8c37153d5393
Nathan James [Tue, 22 Dec 2020 11:30:55 +0000 (11:30 +0000)]
[clangd] Reuse buffer for JSONTransport::sendMessage
Allocate a Buffer in the JSONTransport to be used when sending messages to the client.
This gets reused each time a message is sent, reducing in fewer malloc, which is always a bonus.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D93531
David Spickett [Thu, 17 Dec 2020 10:52:37 +0000 (10:52 +0000)]
[llvm][Arm/AArch64] Format extension flags in CPU test failures
Previously you just two hex numbers you had to decode manually.
This change adds a predicate formatter for extension flags
to produce failure messages like:
```
[ RUN ] AArch64CPUTests/AArch64CPUTestFixture.testAArch64CPU/2
<...>llvm/unittests/Support/TargetParserTest.cpp:862:
Failure
Expected extension flags: +fp-armv8, +crc, +crypto (0xe)
Got extension flags: +fp-armv8, +neon, +crc, +crypto (0x1e)
[ FAILED ] AArch64CPUTests/AArch64CPUTestFixture.testAArch64CPU/2,
where GetParam() = "cortex-a34", "armv8-a", <...>
```
From there you can take the feature name and map it back
to the enum in ARM/AArch64TargetParser.def.
(which isn't perfect but you've probably got both files
open if you're editing these tests)
Note that AEK_NONE is not meant to be user facing in the compiler
but here it is part of the tests. So failures may show an
extension "none" where the normal target parser wouldn't.
The formatter is implemented as a template on ARM::ISAKind
because the predicate formatters assume all parameters are used
for comparison.
(e.g. PRED_FORMAT3 is for comparing 3 values, not having 3
arguments in general)
Reviewed By: MarkMurrayARM
Differential Revision: https://reviews.llvm.org/D93448
Sylvestre Ledru [Mon, 30 Nov 2020 17:29:55 +0000 (18:29 +0100)]
-fstack-clash-protection: Return an actual error when used on unsupported OS
$ clang-12: error: -fstack-clash-protection is not supported on Windows or Mac OS X
Differential Revision: https://reviews.llvm.org/D92245
Siddhesh Poyarekar [Tue, 22 Dec 2020 09:51:41 +0000 (10:51 +0100)]
Fold comparison of __builtin_object_size expression with -1 for non-const size
When __builtin_dynamic_object_size returns a non-constant expression, it cannot
be -1 since that is an invalid return value for object size. However since
passes running after the substitution don't know this, they are unable to
optimize away the comparison and hence the comparison and branch stays in there.
This change generates an appropriate call to llvm.assume to help the optimizer
folding the test.
glibc is considering adopting __builtin_dynamic_object_size for additional
protection[1] and this change will help reduce branching overhead in fortified
implementations of all of the functions that don't have the __builtin___*_chk
type builtins, e.g. __ppoll_chk.
Also remove the test limit-max-iterations.ll because it was deemed unnecessary
during review.
[1] https://sourceware.org/pipermail/libc-alpha/2020-November/120191.html
Differential Revision: https://reviews.llvm.org/D93015
Florian Hahn [Tue, 22 Dec 2020 09:20:47 +0000 (09:20 +0000)]
[VPlan] Make VPInstruction a VPDef
This patch turns updates VPInstruction to manage the value it defines
using VPDef. The VPValue is used during VPlan construction and
codegeneration instead of the plain IR reference where possible.
Reviewed By: gilr
Differential Revision: https://reviews.llvm.org/D90565
Sjoerd Meijer [Tue, 22 Dec 2020 09:13:51 +0000 (09:13 +0000)]
[MachineLICM] Add llvm debug messages to SinkIntoLoop. NFC.
I am investigating sinking instructions back into the loop under high
register pressure. This is just a first NFC step to add some debug
messages that allows tracing of the decision making.
Pavel Labath [Tue, 24 Nov 2020 09:24:29 +0000 (10:24 +0100)]
[DebugInfo] Don't use DW_OP_implicit_value for fragments
Currently using DW_OP_implicit_value in fragments produces invalid DWARF
expressions. (Such a case can occur in complex floats, for example.)
This problem manifests itself as a missing DW_OP_piece operation after
the last fragment. This happens because the function for printing
constant float value skips printing the accompanying DWARF expression,
as that would also print DW_OP_stack_value (which is not desirable in
this case). However, this also results in DW_OP_piece being skipped.
The reason that DW_OP_piece is missing only for the last piece is that
the act of printing the next fragment corrects this. However, it does
that for the wrong reason -- the code emitting this DW_OP_piece thinks
that the previous fragment was missing, and so it thinks that it needs
to skip over it in order to be able to print itself.
In a simple scenario this works out, but it's likely that in a more
complex setup (where some pieces are in fact missing), this logic would
go badly wrong. In a simple setup gdb also seems to not mind the fact
that the DW_OP_piece is missing, but it would also likely not handle
more complex use cases.
For this reason, this patch disables the usage of DW_OP_implicit_value
in the frament scenario (we will use DW_OP_const*** instead), until we
figure out the right way to deal with this. This guarantees that we
produce valid expressions, and gdb can handle both kinds of inputs
anyway.
Differential Revision: https://reviews.llvm.org/D92013
Pavel Labath [Fri, 18 Dec 2020 20:26:25 +0000 (21:26 +0100)]
[lldb/test] Add GdbRemoteTestCaseFactory to avoid duplication in lldb-server tests
This uses the same approach as the debug info tests to avoid needing to
explicitly spell out the two kinds of tests. I convert a handful of
tests to the new mechanism. The rest will be converted in follow-up
patches.
David Spickett [Tue, 15 Dec 2020 15:49:26 +0000 (15:49 +0000)]
[llvm][ARM/AArch64] Convert Target Parser CPU tests to fixtures
Also convert the test function to use EXPECT_EQ and
remove the special case for the AEK_NONE extension.
This means that each test is marked as failing separatley
and the accumultated EXPECT failures are printed next
to that test, with its parameters.
Before they would be hidden by the "pass &=" pattern
and failures would print in one block since it was a
"single" test.
Example of the new failure messages:
```
ARMCPUTestsPart1/ARMCPUTestFixture.ARMCPUTests/6
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from ARMCPUTestsPart1/ARMCPUTestFixture
[ RUN ] ARMCPUTestsPart1/ARMCPUTestFixture.ARMCPUTests/6
/work/open_source/nightly-llvm/llvm-project/llvm/unittests/Support/TargetParserTest.cpp:66:
Failure
Expected: params.ExpectedFlags
Which is:
3405705229
To be equal to: default_extensions
Which is: 1
[ FAILED ] ARMCPUTestsPart1/ARMCPUTestFixture.ARMCPUTests/6, where
GetParam() = "arm8", "armv4", "none", 0xcafef00d, "4" (0 ms)
```
Reviewed By: MarkMurrayARM
Differential Revision: https://reviews.llvm.org/D93392
sameeran joshi [Mon, 21 Dec 2020 17:14:22 +0000 (22:44 +0530)]
[Flang][openmp][5/5] Make dist_schedule clause part of OmpClause
After discussion in `D93482` we found that the some of the clauses were not
following the common OmpClause convention.
The benefits of using OmpClause:
- Functionalities from structure checker are mostly aligned to work with
`llvm::omp::Clause`.
- The unparsing as well can take advantage.
- Homogeneity with OpenACC and rest of the clauses in OpenMP.
- Could even generate the parser with TableGen, when there is homogeneity.
- It becomes confusing when to use `flangClass` and `flangClassValue` inside
TableGen, if incase we generate parser using TableGen we could have only a
single `let expression`.
This patch makes `OmpDistScheduleClause` clause part of `OmpClause`.
The unparse function for `OmpDistScheduleClause` is adapted since the keyword
and parenthesis are issued by the corresponding unparse function for
`parser::OmpClause::DistSchedule`.
Reviewed By: clementval, kiranktp
Differential Revision: https://reviews.llvm.org/D93644
Alex Zinenko [Mon, 21 Dec 2020 11:16:30 +0000 (12:16 +0100)]
[mlir] remove deprecated string-based OpBuilder from ODS
It has been deprecated with a warning for two months, removing.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D93623
sameeran joshi [Mon, 21 Dec 2020 14:04:12 +0000 (19:34 +0530)]
[Flang][openmp][4/5] Make nowait clause part of OmpClause
After discussion in `D93482` we found that the some of the clauses were not
following the common OmpClause convention.
The benefits of using OmpClause:
- Functionalities from structure checker are mostly aligned to work with
`llvm::omp::Clause`.
- The unparsing as well can take advantage.
- Homogeneity with OpenACC and rest of the clauses in OpenMP.
- Could even generate the parser with TableGen, when there is homogeneity.
- It becomes confusing when to use `flangClass` and `flangClassValue` inside
TableGen, if incase we generate parser using TableGen we could have only a
single `let expression`.
This patch makes `OmpNoWait` clause part of `OmpClause`.
Reviewed By: clementval, kiranktp
Differential Revision: https://reviews.llvm.org/D93643
Gil Rapaport [Tue, 15 Dec 2020 20:47:12 +0000 (22:47 +0200)]
[LV] Avoid needless fold tail
When the trip-count is provably divisible by the maximal/chosen VF, folding the
loop's tail during vectorization is redundant. This commit extends the existing
test for constant trip-counts to any trip-count known to be divisible by
maximal/selected VF by SCEV.
Differential Revision: https://reviews.llvm.org/D93615
sameeran joshi [Mon, 21 Dec 2020 13:13:44 +0000 (18:43 +0530)]
[Flang][openmp][3/5] Make ProcBind clause part of OmpClause
After discussion in `D93482` we found that the some of the clauses were not
following the common OmpClause convention.
The benefits of using OmpClause:
- Functionalities from structure checker are mostly aligned to work with
`llvm::omp::Clause`.
- The unparsing as well can take advantage.
- Homogeneity with OpenACC and rest of the clauses in OpenMP.
- Could even generate the parser with TableGen, when there is homogeneity.
- It becomes confusing when to use `flangClass` and `flangClassValue` inside
TableGen, if incase we generate parser using TableGen we could have only a
single `let expression`.
This patch makes `OmpProcBindClause` clause part of `OmpClause`.
The unparse function is dropped as the unparsing is done by `WALK_NESTED_ENUM`
for `OmpProcBindClause`.
Reviewed By: clementval, kiranktp
Differential Revision: https://reviews.llvm.org/D93642
Quentin Chateau [Tue, 22 Dec 2020 07:44:20 +0000 (08:44 +0100)]
[clangd] Trim memory periodically when using glibc malloc
This diff addresses the issue of the ever increasing memory usage of clangd. The key to understand what happens is to use `malloc_stats()`: malloc arenas keep getting bigger, although the actual memory used does not. It seems some operations while bulding the indices (both dynamic and background) create this problem. Specifically, 'FileSymbols::update' and 'FileSymbols::buildIndex' seem especially affected.
This diff adds a call to `malloc_trim()` periodically in
ClangdLSPServer.
Fixes: https://github.com/clangd/clangd/issues/251
Fixes: https://github.com/clangd/clangd/issues/115
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D93452
sameeran joshi [Mon, 21 Dec 2020 08:40:27 +0000 (14:10 +0530)]
[Flang][openmp][2/5] Make Default clause part of OmpClause
After discussion in `D93482` we found that the some of the clauses were not
following the common OmpClause convention.
The benefits of using OmpClause:
- Functionalities from structure checker are mostly aligned to work with
`llvm::omp::Clause`.
- The unparsing as well can take advantage.
- Homogeneity with OpenACC and rest of the clauses in OpenMP.
- Could even generate the parser with TableGen, when there is homogeneity.
- It becomes confusing when to use `flangClass` and `flangClassValue` inside
TableGen, if incase we generate parser using TableGen we could have only a
single `let expression`.
This patch makes `OmpDefaultClause` clause part of `OmpClause`.
The unparse function is dropped as the unparsing is done by `WALK_NESTED_ENUM`
for `OmpDefaultClause`.
Reviewed By: clementval, kiranktp
Differential Revision: https://reviews.llvm.org/D93641
sameeran joshi [Fri, 18 Dec 2020 18:33:45 +0000 (00:03 +0530)]
[Flang][openmp][1/5] Make Allocate clause part of OmpClause
After discussion in `D93482` we found that the some of the clauses were not
following the common OmpClause convention.
The benefits of using OmpClause:
- Functionalities from structure checker are mostly aligned to work with
`llvm::omp::Clause`.
- The unparsing as well can take advantage.
- Homogeneity with OpenACC and rest of the clauses in OpenMP.
- Could even generate the parser with TableGen, when there is homogeneity.
- It becomes confusing when to use `flangClass` and `flangClassValue` inside
TableGen, if incase we generate parser using TableGen we could have only a
single `let expression`.
This patch makes `allocate` clause part of `OmpClause`.The unparse function for
`OmpAllocateClause` is adapted since the keyword and parenthesis are issued by
the corresponding unparse function for `parser::OmpClause::Allocate`.
Reviewed By: clementval
Differential Revision: https://reviews.llvm.org/D93640
Hsiangkai Wang [Tue, 15 Dec 2020 23:06:07 +0000 (07:06 +0800)]
[RISCV] Define vector compare intrinsics.
Define vector compare intrinsics and lower them to V instructions.
We work with @rogfer01 from BSC to come out this patch.
Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com>
Co-Authored-by: Hsiangkai Wang <kai.wang@sifive.com>
Differential Revision: https://reviews.llvm.org/D93368
Zakk Chen [Fri, 18 Dec 2020 08:14:53 +0000 (00:14 -0800)]
[RISCV] Define vleff intrinsics.
Define vleff intrinsics and lower to V instructions.
We work with @rogfer01 from BSC to come out this patch.
Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com>
Co-Authored-by: Zakk Chen <zakk.chen@sifive.com>
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D93516
Bing1 Yu [Tue, 22 Dec 2020 05:09:22 +0000 (13:09 +0800)]
[LegalizeType] When LegalizeType procedure widens a masked_gather, set MemoryType's EltNum equal to Result's EltNum
When LegalizeType procedure widens a masked_gather, set MemoryType's EltNum equal to Result's EltNum.
As I mentioned in https://reviews.llvm.org/D91092, in previous code, If we have a v17i32's masked_gather in avx512, we widen it to a v32i32's masked_gather with a v17i32's MemoryType. When the SplitVecRes_MGATHER process this v32i32's masked_gather, GetSplitDestVTs will assert fail since what you are going to split is v17i32.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D93610
Zi Xuan Wu [Tue, 22 Dec 2020 02:56:43 +0000 (10:56 +0800)]
[CSKY 3/n] Add bare-bones C-SKY MCTargetDesc
Add basis of CSKY MCTargetDesc and it's enough to compile and link but doesn't yet do anything particularly useful.
Once an ASM parser and printer are added in the next two patches, the whole thing can be usefully tested.
Differential Revision: https://reviews.llvm.org/D93372
Tom Stellard [Mon, 21 Dec 2020 23:24:45 +0000 (15:24 -0800)]
scan-view: Remove Reporter.py and associated AppleScript files
I'm not exactly sure what this is, but it appears to be a tool for reporting
internal issues at Apple. These files haven't been meaningfully updated in
12 years, and it doesn't seem like there is any reason to keep them in tree.
Reviewed By: NoQ
Differential Revision: https://reviews.llvm.org/D93565
Nico Weber [Thu, 17 Dec 2020 18:30:18 +0000 (13:30 -0500)]
[lld/mac] Implement support for private extern symbols
Private extern symbols are used for things scoped to the linkage unit.
They cause duplicate symbol errors (so they're in the symbol table,
unlike TU-scoped truly local symbols), but they don't make it into the
export trie. They are created e.g. by compiling with
-fvisibility=hidden.
If two weak symbols have differing privateness, the combined symbol is
non-private external. (Example: inline functions and some TUs that
include the header defining it were built with
-fvisibility-inlines-hidden and some weren't).
A weak private external symbol implicitly has its "weak" dropped and
behaves like a regular strong private external symbol: Weak is an export
trie concept, and private symbols are not in the export trie.
If a weak and a strong symbol have different privateness, the strong
symbol wins.
If two common symbols have differing privateness, the larger symbol
wins. If they have the same size, the privateness of the symbol seen
later during the link wins (!) -- this is a bit lame, but it matches
ld64 and this behavior takes 2 lines less to implement than the less
surprising "result is non-private external), so match ld64.
(Example: `int a` in two .c files, both built with -fcommon,
one built with -fvisibility=hidden and one without.)
This also makes `__dyld_private` a true TU-local symbol, matching ld64.
To make this work, make the `const char*` StringRefZ ctor to correctly
set `size` (without this, writing the string table crashed when calling
getName() on the __dyld_private symbol).
Mention in CommonSymbol's comment that common symbols are now disabled
by default in clang.
Mention in -keep_private_externs's HelpText that the flag only has an
effect with `-r` (which we don't implement yet -- so this patch here
doesn't regress any behavior around -r + -keep_private_externs)). ld64
doesn't explicitly document it, but the commit text of
http://reviews.llvm.org/rL216146 does, and ld64's
OutputFile::buildSymbolTable() checks `_options.outputKind() ==
Options::kObjectFile` before calling `_options.keepPrivateExterns()`
(the only reference to that function).
Fixes PR48536.
Differential Revision: https://reviews.llvm.org/D93609
ShihPo Hung [Mon, 21 Dec 2020 06:41:47 +0000 (22:41 -0800)]
[RISCV] Add intrinsics for vmacc/vnmsac/vmadd/vnmsub instructions
This defines vmadd, vmacc, vnmsub, and vnmsac intrinsics and
lower to V instructions.
Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com>
Co-Authored-by: ShihPo Hung <shihpo.hung@sifive.com>
Differential Revision: https://reviews.llvm.org/D93632
Tres Popp [Tue, 22 Dec 2020 01:19:31 +0000 (02:19 +0100)]
Revert "[mlir] Add SmallVector sizes"
This reverts commit
83274a0773f6a20abdc848b448009e0195c42166.
Fixed in
a555ca8b3d67
Fangrui Song [Tue, 22 Dec 2020 01:18:28 +0000 (17:18 -0800)]
[MC][test] Reorganize .cfi_* tests
Delete tests which are covered by others.
Ta-Wei Tu [Tue, 22 Dec 2020 00:42:52 +0000 (08:42 +0800)]
[LoopNest] Extend `LPMUpdater` and adaptor to handle loop-nest passes
This is a follow-up patch of D87045.
The patch implements "loop-nest mode" for `LPMUpdater` and `FunctionToLoopPassAdaptor` in which only top-level loops are operated.
`createFunctionToLoopPassAdaptor` decides whether the returned adaptor is in loop-nest mode or not based on the given pass. If the pass is a loop-nest pass or the pass is a `LoopPassManager` which contains only loop-nest passes, the loop-nest version of adaptor is returned; otherwise, the normal (loop) version of adaptor is returned.
Reviewed By: Whitney
Differential Revision: https://reviews.llvm.org/D87531
Craig Topper [Mon, 21 Dec 2020 23:16:57 +0000 (15:16 -0800)]
[RISCV] Use more precise type constraints for the vmv.v.v and vmv.v.x intrinsics.
We can infer the input type from the result type. For vmv.v.v its
the same. For vmv.v.x its the element type.
Craig Topper [Mon, 21 Dec 2020 22:59:45 +0000 (14:59 -0800)]
[RISCV] Update vmv.v.v-rv32.ll and vmv.v.v-rv64.ll to test the correct intrinsics.
These were accidentally identical to the vmv.v.x tests. I must
have fumbled when I copied them from our downstream repo.
Tres Popp [Mon, 21 Dec 2020 21:57:34 +0000 (22:57 +0100)]
[mlir] Add SmallVector sizes
This is a temporary fix until figuring out how to correct the forward
declare in mlir/include/mlir/Support/LLVM.h
Differential Revision: https://reviews.llvm.org/D93666
Congzhe Cao [Mon, 21 Dec 2020 18:33:58 +0000 (13:33 -0500)]
[InstCombine] Add check of i1 types in select-to-zext/sext transformation
When doing select-to-zext/sext transformations, we should
not handle TrueVal and FalseVal of i1 type otherwise it
would result in zext/sext i1 to i1.
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D93272
Fangrui Song [Mon, 21 Dec 2020 23:32:35 +0000 (15:32 -0800)]
[Driver] Default Generic_GCC ppc/ppc64/ppc64le to -fasynchronous-unwind-tables
GCC made the switch on 2018-04-10 ("rs6000: Enable -fasynchronous-unwind-tables by default").
In Clang, FreeBSD/NetBSD powerpc have already defaulted to -fasynchronous-unwind-tables.
This patch defaults Generic_GCC powerpc (which affects Linux) to use -fasynchronous-unwind-tables.
Reviewed By: #powerpc, nemanjai
Differential Revision: https://reviews.llvm.org/D92054
Tom Stellard [Mon, 21 Dec 2020 23:16:09 +0000 (15:16 -0800)]
HowToReleaseLLVM: Update document to match the current release process
Change Summary:
* Clarify that release manager can commit without code owner approval
(but are still highly encouraged to get approval).
* Clarify that there is no official release criteria.
* Document what types of changes are allowed in each release phase.
This is update is based on the RFC submitted here:
http://lists.llvm.org/pipermail/llvm-dev/2020-May/141730.html
Reviewed By: hans
Differential Revision: https://reviews.llvm.org/D93493
Tom Stellard [Mon, 21 Dec 2020 21:29:56 +0000 (13:29 -0800)]
llvm-profgen: Parse command line arguments after initializing targets
I am experimenting with turning backends into loadable modules and in
that scenario, target specific command line arguments won't be available
until after the targets are initialized.
Also, most other tools initialize targets before parsing arguments.
Reviewed By: wlei
Differential Revision: https://reviews.llvm.org/D93348
George Mitenkov [Mon, 21 Dec 2020 22:44:31 +0000 (01:44 +0300)]
[MLIR][SPIRVToLLVM] Updated documentation on spirv-cpu-runner
This patch adds documentation for the `mlir-spirv-cpu-runner`.
It provides an overview of applied transformations and passes, as
well as an example walk-through.
Some typos in the documentation have been fixed as well.
Reviewed By: mravishankar
Differential Revision: https://reviews.llvm.org/D93620
Arthur Eubanks [Mon, 21 Dec 2020 22:39:19 +0000 (14:39 -0800)]
[NFC] Remove unused function
Evandro Menezes [Sat, 19 Dec 2020 02:34:55 +0000 (20:34 -0600)]
[RISCV] Define the vand, vor and vxor RVV intrinsics
Define the `vand`, `vor` and `vxor` 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/D93574
Aart Bik [Mon, 21 Dec 2020 21:42:38 +0000 (13:42 -0800)]
[mlir][sparse] adjust output tensor to synthetic tensor
Fixes a merge conflict with previous two CLs.
Reviewed By: mravishankar
Differential Revision: https://reviews.llvm.org/D93664
Fangrui Song [Mon, 21 Dec 2020 22:04:13 +0000 (14:04 -0800)]
[MC] Split MCContext::createTempSymbol, default AlwaysAddSuffix to true, and add comments
CanBeUnnamed is rarely false. Splitting to a createNamedTempSymbol makes the
intention clearer and matches the direction of reverted r240130 (to drop the
unneeded parameters).
No behavior change.
Fangrui Song [Mon, 21 Dec 2020 21:46:45 +0000 (13:46 -0800)]
Migrate MCContext::createTempSymbol call sites to AlwaysAddSuffix=true
Most call sites set AlwaysAddSuffix to true. The two use cases do not really
need false and can be more consistent with other temporary symbol usage.
Arthur Eubanks [Tue, 15 Dec 2020 02:06:10 +0000 (18:06 -0800)]
[NewPM] Add TargetMachine method to add alias analyses
AMDGPUTargetMachine::adjustPassManager() adds some alias analyses to the
legacy PM. We need a way to do the same for the new PM in order to port
AMDGPUTargetMachine::adjustPassManager() to the new PM.
Currently the new PM adds alias analyses by creating an AAManager via
PassBuilder and overriding the AAManager a PassManager uses via
FunctionAnalysisManager::registerPass().
We will continue to respect a custom AA pipeline that specifies an exact
AA pipeline to use, but for "default" we will now add alias analyses
that backends specify. Most uses of PassManager use the "default"
AAManager created by PassBuilder::buildDefaultAAPipeline(). Backends can
override the newly added TargetMachine::registerAliasAnalyses() to add custom
alias analyses.
Reviewed By: ychen
Differential Revision: https://reviews.llvm.org/D93261