David Blaikie [Mon, 25 Jan 2021 23:03:38 +0000 (15:03 -0800)]
Fix -Wmissing-override in lldb
Walter Erquinigo [Mon, 25 Jan 2021 22:45:39 +0000 (14:45 -0800)]
Fix runInTerminal errors on ARM
Caused by https://reviews.llvm.org/D93951
This feature is not needed on ARM, so let's just disable the tests on
ARM.
Harald van Dijk [Mon, 25 Jan 2021 22:34:49 +0000 (22:34 +0000)]
Restore GNU , ## __VA_ARGS__ behavior in MSVC mode
As noted in D91913, MSVC implements the GNU behavior for
, ## __VA_ARGS__ as well. Do the same when `-fms-compatibility` is used.
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D95392
Jim Ingham [Mon, 25 Jan 2021 22:23:11 +0000 (14:23 -0800)]
Follow on to:
f05dc40c31d1883b46b8bb60547087db2f4c03e3
When you pass in a bogus ArchSpec, TargetList.CreateTarget
makes a target with the arch of the executable. That wasn't the
case with a bogus triple, so this change caused one of the bogus
input data tests to fail. So check that the ArchSpec is valid
before passing it to CreateTarget.
Sam McCall [Wed, 20 Jan 2021 17:35:11 +0000 (18:35 +0100)]
[clangd] Allow configuration database to be specified in config.
This allows for more flexibility than -compile-commands-dir or ancestor
discovery.
See https://github.com/clangd/clangd/issues/116
Differential Revision: https://reviews.llvm.org/D95057
Nikita Popov [Sat, 23 Jan 2021 11:27:22 +0000 (12:27 +0100)]
[LSR] Drop potentially invalid nowrap flags when switching to post-inc IV (PR46943)
When LSR converts a branch on the pre-inc IV into a branch on the
post-inc IV, the nowrap flags on the addition may no longer be valid.
Previously, a poison result of the addition might have been ignored,
in which case the program was well defined. After branching on the
post-inc IV, we might be branching on poison, which is undefined behavior.
Fix this by discarding nowrap flags which are not present on the SCEV
expression. Nowrap flags on the SCEV expression are proven by SCEV
to always hold, independently of how the expression will be used.
This is essentially the same fix we applied to IndVars LFTR, which
also performs this kind of pre-inc to post-inc conversion.
I believe a similar problem can also exist for getelementptr inbounds,
but I was not able to come up with a problematic test case. The
inbounds case would have to be addressed in a differently anyway
(as SCEV does not track this property).
Fixes https://bugs.llvm.org/show_bug.cgi?id=46943.
Differential Revision: https://reviews.llvm.org/D95286
Fraser Cormack [Mon, 11 Jan 2021 17:42:05 +0000 (17:42 +0000)]
[RISCV] Add RVV insertelt/extractelt scalable-vector patterns
Original patch by @rogfer01.
This patch adds support for insertelt and extractelt operations on
scalable vectors.
Special care must be taken on RV32 when dealing with i64 vectors as
there are no straightforward ways to insert a 64-bit element without a
register of that size. To that end, both are custom-lowered to different
sequences.
Authored-by: Roger Ferrer Ibanez <rofirrim@gmail.com>
Co-Authored-by: Fraser Cormack <fraser@codeplay.com>
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D94615
Walter Erquinigo [Mon, 25 Jan 2021 22:05:04 +0000 (14:05 -0800)]
Fix
0f0462cacf34aa88ae71a13c4199c1b1e70f3ee6
This fails on Windows because std::future<llvm::Error> fail to compile.
Now switching to SBError as a workaround.
Failed buildbot: http://lab.llvm.org:8011/#/builders/83/builds/3021
Eugene Zhulenev [Mon, 18 Jan 2021 18:58:34 +0000 (10:58 -0800)]
[mlir:Async] Add intermediate async.coro and async.runtime operations to simplify Async to LLVM lowering
[NFC] No new functionality, mostly a cleanup and one more abstraction level between Async and LLVM IR.
Instead of lowering from Async to LLVM coroutines and Async Runtime API in one shot, do it progressively via async.coro and async.runtime operations.
1. Lower from async to async.runtime/coro (e.g. async.execute to function with coro setup and runtime calls)
2. Lower from async.runtime/coro to LLVM intrinsics and runtime API calls
Intermediate coro/runtime operations will allow to run transformations on a higher level IR and do not try to match IR based on the LLVM::CallOp properties.
Although async.coro is very close to LLVM coroutines, it is not exactly the same API, instead it is optimized for usability in async lowering, and misses a lot of details that are present in @llvm.coro intrinsic.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D94923
Quentin Chateau [Mon, 25 Jan 2021 21:56:03 +0000 (22:56 +0100)]
[clangd] ignore parallelism level for quick tasks
This allows quick tasks without dependencies that
need to run fast to run ASAP. This is mostly useful
for code formatting.
----------------------------
This fixes something that's been annoying me:
- Open your IDE workspace and its 20 open files
- Clangd spends 5 minutes parsing it all
- In the meantime you start to work
- Save a file, trigger format-on-save, which hangs because clangd is busy
- You're stuck waiting until clangd is done parsing your files before the formatting and save takes place
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D94875
Cassie Jones [Mon, 25 Jan 2021 21:57:20 +0000 (16:57 -0500)]
Recommit "[AArch64][GlobalISel] Implement widenScalar for signed overflow"
Implement widening for G_SADDO and G_SSUBO.
Add legalize-add/sub tests for narrow overflowing add/sub on AArch64.
Differential Revision: https://reviews.llvm.org/D95034
Richard Smith [Mon, 25 Jan 2021 21:30:12 +0000 (13:30 -0800)]
Revert "[ObjC][ARC] Annotate calls with attributes instead of emitting retainRV"
This reverts commit
53176c168061d6f26dcf3ce4fa59288b7d67255e, which
introduceed a layering violation. LLVM's IR library can't include
headers from Analysis.
peter klausler [Mon, 25 Jan 2021 20:25:55 +0000 (12:25 -0800)]
[flang] Fix errors in ISO_FORTRAN_ENV module for REAL128
Some parameters of 128-bit IEEE floating-point numbers were
incorrect, leading to a failure to define REAL128 to 16.
Differential Revision: https://reviews.llvm.org/D95387
peter klausler [Mon, 25 Jan 2021 20:29:10 +0000 (12:29 -0800)]
[flang] Search for #include "file" in right directory
Make the #include "file" preprocessing directive begin its
search in the same directory as the file containing the directive,
as other preprocessors and our Fortran INCLUDE statement do.
Avoid current working directory for all source files after the original.
Differential Revision: https://reviews.llvm.org/D95388
Jonas Devlieghere [Mon, 25 Jan 2021 21:02:20 +0000 (13:02 -0800)]
[YAML I/O] Fix bug in emission of empty sequence
Don't emit an output dash for an empty sequence. Take emitting a vector
of strings for example:
std::vector<std::string> Strings = {"foo", "bar"};
LLVM_YAML_IS_SEQUENCE_VECTOR(std::string)
yout << Strings;
This emits the following YAML document.
---
- foo
- bar
...
When the vector is empty, this generates the following result:
---
- []
...
Although this is valid YAML, it does not match what we meant to emit.
The result is a one-element sequence consisting of an empty list.
Indeed, if we were to try to read this again we get an error:
YAML:2:4: error: not a mapping
- []
The problem is the output dash before the empty list. The correct output
would be:
---
[]
...
This patch fixes that by not emitting the output dash for an empty
sequence.
Differential revision: https://reviews.llvm.org/D95280
Julian Lettner [Mon, 25 Jan 2021 21:31:27 +0000 (13:31 -0800)]
Revert "[lit] Use os.cpu_count() to cleanup TODO"
A bot owner contacted me. I will re-land after confirming that this
doesn't break anyone (since it's low priority).
This reverts commit
9946b169c379daee603436a4753acfef8be373dd.
Walter Erquinigo [Mon, 25 Jan 2021 21:24:01 +0000 (13:24 -0800)]
Fix
0f0462cacf34aa88ae71a13c4199c1b1e70f3ee6
This test fails on ARM, but this feature won't be used on ARM, so we can
disable it for that architecture.
Konstantin Zhuravlyov [Mon, 25 Jan 2021 20:49:49 +0000 (15:49 -0500)]
Revert "[IndirectFunctions] Skip propagating attributes to address taken functions"
This reverts commit
dd8ae42674b494e46ec40a22f40068db2b4a8b60.
This commit causes infinite loop when compiling rocThrust and hipCUB.
Differential Revision: https://reviews.llvm.org/D95389
Jim Ingham [Thu, 21 Jan 2021 20:32:07 +0000 (12:32 -0800)]
Fix SBDebugger::CreateTargetWithFileAndArch to accept LLDB_ARCH_DEFAULT.
The API docs in SBDebugger.i claim this should work but it doesn't. This
should fix it.
Differential Revision: https://reviews.llvm.org/D95164
Walter Erquinigo [Mon, 28 Dec 2020 20:00:47 +0000 (12:00 -0800)]
[vscode] Improve runInTerminal and support linux
Depends on D93874.
runInTerminal was using --wait-for, but it was some problems because it uses process polling looking for a single instance of the debuggee:
- it gets to know of the target late, which renders breakpoints in the main function almost impossible
- polling might fail if there are already other processes with the same name
- polling might also fail on some linux machine, as it's implemented with the ps command, and the ps command's args and output are not standard everywhere
As a better way to implement this so that it works well on Darwin and Linux, I'm using now the following process:
- lldb-vscode notices the runInTerminal, so it spawns lldb-vscode with a special flag --launch-target <target>. This flags tells lldb-vscode to wait to be attached and then it execs the target program. I'm using lldb-vscode itself to do this, because it makes finding the launcher program easier. Also no CMAKE INSTALL scripts are needed.
- Besides this, the debugger creates a temporary FIFO file where the launcher program will write its pid to. That way the debugger will be sure of which program to attach.
- Once attach happend, the debugger creates a second temporary file to notify the launcher program that it has been attached, so that it can then exec. I'm using this instead of using a signal or a similar mechanism because I don't want the launcher program to wait indefinitely to be attached in case the debugger crashed. That would pollute the process list with a lot of hanging processes. Instead, I'm setting a 20 seconds timeout (that's an overkill) and the launcher program seeks in intervals the second tepmorary file.
Some notes:
- I preferred not to use sockets because it requires a lot of code and I only need a pid. It would also require a lot of code when windows support is implemented.
- I didn't add Windows support, as I don't have a windows machine, but adding support for it should be easy, as the FIFO file can be implemented with a named pipe, which is standard on Windows and works pretty much the same way.
The existing test which didn't pass on Linux, now passes.
Differential Revision: https://reviews.llvm.org/D93951
Nathan James [Mon, 25 Jan 2021 20:19:50 +0000 (20:19 +0000)]
Reland"[clangd][NFC] Simplify handing on methods with no params"
This reverts commit
9d9ceb37453ffe0186d04f4e9e4ba9fb41200b57.
First time round caused some build bot failures due to older compilers not patched with the Defect Report about full specialization being allowed at class scope.
LLVM GN Syncbot [Mon, 25 Jan 2021 20:11:10 +0000 (20:11 +0000)]
[gn build] Port
e123cd674c02
Nico Weber [Mon, 25 Jan 2021 20:10:41 +0000 (15:10 -0500)]
libcxx: Try to fix build after D92044
Björn Schäpers [Mon, 25 Jan 2021 19:54:17 +0000 (20:54 +0100)]
[clang-format] [NFC] Rerun dump_format_style.py
Albertas Vyšniauskas [Mon, 25 Jan 2021 19:47:22 +0000 (20:47 +0100)]
[clang-format] PR16518 Add flag to suppress empty line insertion before access modifier
Add new option called InsertEmptyLineBeforeAccessModifier. Empty line
before access modifier is inerted if this option is set to true (which
is the default value, because clang-format always inserts empty lines
before access modifiers), otherwise empty lines are removed.
Fixes issue #16518.
Differential Revision: https://reviews.llvm.org/D93846
Björn Schäpers [Thu, 21 Jan 2021 12:53:27 +0000 (13:53 +0100)]
[clang-format] [NFC] Remove unsued arguments
Björn Schäpers [Wed, 20 Jan 2021 20:48:19 +0000 (21:48 +0100)]
[clang-format] [NFC] Restructure getLineCommentIndentPrefix
When sorting the known prefixes after length the if in the loop will hit
at most once, so we can return from there.
Also replace the inner loop with an algorithm, that makes it more
readable.
Differential Revision: https://reviews.llvm.org/D95081
Björn Schäpers [Wed, 20 Jan 2021 20:35:19 +0000 (21:35 +0100)]
[clang-format] [NFC] Use some constexpr StringRef
Instead of const char*.
Differential Revision: https://reviews.llvm.org/D95078
Akira Hatanaka [Mon, 25 Jan 2021 19:56:33 +0000 (11:56 -0800)]
[ObjC][ARC] Annotate calls with attributes instead of emitting retainRV
or claimRV calls in the IR
Background:
This patch makes changes to the front-end and middle-end that are
needed to fix a longstanding problem where llvm breaks ARC's autorelease
optimization (see the link below) by separating calls from the marker
instructions or retainRV/claimRV calls. The backend changes are in
https://reviews.llvm.org/D92569.
https://clang.llvm.org/docs/AutomaticReferenceCounting.html#arc-runtime-objc-autoreleasereturnvalue
What this patch does to fix the problem:
- The front-end annotates calls with attribute "clang.arc.rv"="retain"
or "clang.arc.rv"="claim", which indicates the call is implicitly
followed by a marker instruction and a retainRV/claimRV call that
consumes the call result. This is currently done only when the target
is arm64 and the optimization level is higher than -O0.
- ARC optimizer temporarily emits retainRV/claimRV calls after the
annotated calls in the IR and removes the inserted calls after
processing the function.
- ARC contract pass emits retainRV/claimRV calls after the annotated
calls. It doesn't remove the attribute on the call since the backend
needs it to emit the marker instruction. The retainRV/claimRV calls
are emitted late in the pipeline to prevent optimization passes from
transforming the IR in a way that makes it harder for the ARC
middle-end passes to figure out the def-use relationship between the
call and the retainRV/claimRV calls (which is the cause of PR31925).
- The function inliner removes the autoreleaseRV call in the callee that
returns the result if nothing in the callee prevents it from being
paired up with the calls annotated with "clang.arc.rv"="retain/claim"
in the caller. If the call is annotated with "claim", a release call
is inserted since autoreleaseRV+claimRV is equivalent to a release. If
it cannot find an autoreleaseRV call, it tries to transfer the
attributes to a function call in the callee. This is important since
ARC optimizer can remove the autoreleaseRV call returning the callee
result, which makes it impossible to pair it up with the retainRV or
claimRV call in the caller. If that fails, it simply emits a retain
call in the IR if the call is annotated with "retain" and does nothing
if it's annotated with "claim".
- This patch teaches dead argument elimination pass not to change the
return type of a function if any of the calls to the function are
annotated with attribute "clang.arc.rv". This is necessary since the
pass can incorrectly determine nothing in the IR uses the function
return, which can happen since the front-end no longer explicitly
emits retainRV/claimRV calls in the IR, and change its return type to
'void'.
Future work:
- Use the attribute on x86-64.
- Fix the auto upgrader to convert call+retainRV/claimRV pairs into
calls annotated with the attributes.
rdar://
71443534
Differential Revision: https://reviews.llvm.org/D92808
Keith Smiley [Mon, 25 Jan 2021 19:54:46 +0000 (11:54 -0800)]
Revert "[clangd][NFC] Simplify handing on methods with no params"
This broke the build http://lab.llvm.org:8011/#/builders/7/builds/1405
This reverts commit
f05b492aae4d4a741ec59f19518df91a3012824c.
Differential Revision: https://reviews.llvm.org/D95385
Julian Lettner [Fri, 15 Jan 2021 01:04:39 +0000 (17:04 -0800)]
[lit] Use os.cpu_count() to cleanup TODO
We can now use Python3. Let's use `os.cpu_count()` to cleanup this
helper.
Differential Revision: https://reviews.llvm.org/D94734
Florian Hahn [Mon, 25 Jan 2021 19:34:59 +0000 (19:34 +0000)]
[VPlan] Replace uses with new value in VPInstructionsToVPRecipe (NFC).
Now that VPRecipeBase inherits from VPDef, we can always use the new
VPValue for replacement, if the recipe defines one. Given the recipes
that are supported at the moment, all new recipes must have either 0 or
1 defined values.
Walter Erquinigo [Fri, 22 Jan 2021 18:22:26 +0000 (10:22 -0800)]
[ThreadPlan] fix exec on Linux
Nick Desaulniers [Mon, 25 Jan 2021 19:12:17 +0000 (11:12 -0800)]
[GVN] do not repeat PRE on failure to split critical edge
Fixes an infinite loop encountered in GVN.
GVN will delay PRE if it encounters critical edges, attempt to split
them later via calls to SplitCriticalEdge(), then restart.
The caller of GVN::splitCriticalEdges() assumed a return value of true
meant that critical edges were split, that the IR had changed, and that
PRE should be re-attempted, upon which we loop infinitely.
This was exposed after D88438, by compiling the Linux kernel for s390,
but the test case is reproducible on x86.
Fixes: https://github.com/ClangBuiltLinux/linux/issues/1261
Reviewed By: void
Differential Revision: https://reviews.llvm.org/D94996
Alex Zinenko [Mon, 25 Jan 2021 16:12:35 +0000 (17:12 +0100)]
[mlir] Add C API for IntegerSet
Depends On D95357
Reviewed By: stellaraccident
Differential Revision: https://reviews.llvm.org/D95368
Shilei Tian [Mon, 25 Jan 2021 19:14:23 +0000 (14:14 -0500)]
[OpenMP][NVPTX] Rewrite CUDA intrinsics with NVVM intrinsics
This patch makes prep for dropping CUDA when compiling `deviceRTLs`.
CUDA intrinsics are replaced by NVVM intrinsics which refers to code in
`__clang_cuda_intrinsics.h`. We don't want to directly include it because in the
near future we're going to switch to OpenMP and by then the header cannot be
used anymore.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D95327
Nathan James [Mon, 25 Jan 2021 19:08:10 +0000 (19:08 +0000)]
[clangd][NFC] Simplify handing on methods with no params
Add bind methods handling the case when a method has an empty params interface and when it has no parameters.
Remove ShutdownParams and ExitParams from Protocol, In LSP they aren't defined, instead the methods are defined to have void as the params. This signature now better reflects that.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D95270
Craig Topper [Mon, 25 Jan 2021 17:35:14 +0000 (09:35 -0800)]
[RISCV] Custom type legalize i8/i16 UDIV/UREM/SDIV on RV64 so we can use divuw/remuw/divw.
This makes our i8/i16 codegen more similar to the i32 codegen.
I've also added computeKnownBits support for DIVUW/REMUW so
that we can remove zero extending ANDs from the output. Without
this we end up turning DIVUW/REMUW back into DIVU/REMU via some
isel patterns.
Reviewed By: frasercrmck, luismarques
Differential Revision: https://reviews.llvm.org/D95322
Ruslan Arutyunyan [Mon, 25 Jan 2021 18:34:03 +0000 (13:34 -0500)]
[libc++] Fix build after
51faba35fd81fbd3af407a29c136895a718ccd96
Differential Revision: https://reviews.llvm.org/D95372
Reid Kleckner [Mon, 25 Jan 2021 18:26:51 +0000 (10:26 -0800)]
[Win64] Ensure all stack frames are 8 byte aligned
The unwind info format requires that all adjustments are 8 byte aligned,
and the bottom three bits are masked out. Most Win64 calling conventions
have 32 bytes of shadow stack space for spilling parameters, and I
believe that constructing these fixed stack objects had the side effect
of ensuring an alignment of 8. However, the Intel regcall convention
does not have this shadow space, so when using that convention, it was
possible to make a 4 byte stack frame, which was impossible to describe
with unwind info.
Fixes pr48867
Diego Caballero [Wed, 20 Jan 2021 22:41:51 +0000 (00:41 +0200)]
[mlir][Affine] Add support for multi-store producer fusion
This patch adds support for producer-consumer fusion scenarios with
multiple producer stores to the AffineLoopFusion pass. The patch
introduces some changes to the producer-consumer algorithm, including:
* For a given consumer loop, producer-consumer fusion iterates over its
producer candidates until a fixed point is reached.
* Producer candidates are gathered beforehand for each iteration of the
consumer loop and visited in reverse program order (not strictly guaranteed)
to maximize the number of loops fused per iteration.
In general, these changes were needed to simplify the multi-store producer
support and remove some of the workarounds that were introduced in the past
to support more fusion cases under the single-store producer limitation.
This patch also preserves the existing functionality of AffineLoopFusion with
one minor change in behavior. Producer-consumer fusion didn't fuse scenarios
with escaping memrefs and multiple outgoing edges (from a single store).
Multi-store producer scenarios will usually (always?) have multiple outgoing
edges so we couldn't fuse any with escaping memrefs, which would greatly limit
the applicability of this new feature. Therefore, the patch enables fusion for
these scenarios. Please, see modified tests for specific details.
Reviewed By: andydavis1, bondhugula
Differential Revision: https://reviews.llvm.org/D92876
Wei Mi [Fri, 22 Jan 2021 23:09:21 +0000 (15:09 -0800)]
[SampleFDO] Report error when reading a bad/incompatible profile instead of
turning off SampleFDO silently.
Currently sample loader pass turns off SampleFDO optimization silently when
it sees error in reading the profile. This behavior will defeat the tests
which could have caught those bad/incompatible profile problems. This patch
change the behavior to report error.
Differential Revision: https://reviews.llvm.org/D95269
Sam Clegg [Mon, 18 Jan 2021 19:39:28 +0000 (11:39 -0800)]
[lld] Consistent help text for `--save-temps`
I noticed that this option was not appearing at all in the `--help`
messages for `wasm-ld` or `ld.lld`.
Add help text and make it consistent across all ports.
Differential Revision: https://reviews.llvm.org/D94925
Nemanja Ivanovic [Mon, 25 Jan 2021 18:22:19 +0000 (12:22 -0600)]
[PowerPC] Add missing negate for VPERMXOR on little endian subtargets
This intrinsic is supposed to have the permute control vector complemented on
little endian systems (as the ABI specifies and GCC implements). With the
current code gen, the result vector is byte-reversed.
Differential revision: https://reviews.llvm.org/D95004
Alex Zinenko [Mon, 25 Jan 2021 14:22:16 +0000 (15:22 +0100)]
[mlir] Use more C99 comments in C API header files
These were left over from the original reformatting commit.
Reviewed By: stellaraccident
Differential Revision: https://reviews.llvm.org/D95357
Keith Smiley [Mon, 25 Jan 2021 18:03:07 +0000 (10:03 -0800)]
[clang] Add -fprofile-prefix-map
This flag allows you to re-write absolute paths in coverage data analogous to -fdebug-prefix-map. This flag is also implied by -ffile-prefix-map.
Arthur O'Dwyer [Thu, 17 Dec 2020 05:01:08 +0000 (00:01 -0500)]
[libc++] [P0879] constexpr std::reverse, partition, *_permutation.
After this patch, the only parts of P0879 that remain missing will be
std::nth_element, std::sort, and the heap/partial_sort algorithms.
Differential Revision: https://reviews.llvm.org/D93443
Erik Pilkington [Mon, 25 Jan 2021 15:53:25 +0000 (10:53 -0500)]
[Sema] Fix an assertion failure in -Wcompletion-handler
NamedDecl::getName() was being called on a constructor.
Arthur O'Dwyer [Sat, 26 Dec 2020 06:39:03 +0000 (01:39 -0500)]
[libc++] Implement [P0769] "Add shift to algorithm" (shift_left, shift_right)
I believe this is a complete implementation of std::shift_left and std::shift_right from
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0769r2.pdf
Some test cases copied-with-modification from D60027.
Differential Revision: https://reviews.llvm.org/D93819
Lukas Barth [Mon, 25 Jan 2021 17:37:54 +0000 (18:37 +0100)]
[clang-format] add case aware include sorting
* Adds an option to [clang-format] which sorts
headers in an alphabetical manner using case
only for tie-breakers. The options is off by
default in favor of the current ASCIIbetical
sorting style.
Reviewed By: curdeius, HazardyKnusperkeks
Differential Revision: https://reviews.llvm.org/D95017
David Green [Mon, 25 Jan 2021 17:50:19 +0000 (17:50 +0000)]
[ARM] Use half directly for args/return types in test. NFC
Until fairly recently the calling convention for IR half was not handled
correctly in the ARM backend, meaning we needed to pass pointers that
were loaded/stored. Now that that is fixed we can switch to using the
type directly instead.
Joseph Huber [Mon, 25 Jan 2021 17:07:09 +0000 (12:07 -0500)]
[OpenMP][NFC] Fix SourceInfo.h variable names
Summary:
Fix the names to use Pascal case to comply with the LLVM coding guidelines. `ident_t` is required for compatibility with the rest of libomp.
Craig Topper [Mon, 25 Jan 2021 17:16:45 +0000 (09:16 -0800)]
[RISCV] Use sign extend for i32 arguments and returns in makeLibCall on RV64.
As far as I know 32 bits arguments and returns on RV64 are always
sign extended to i64. So I think we should be taking this into
account around libcalls.
Reviewed By: luismarques
Differential Revision: https://reviews.llvm.org/D95285
Mark de Wever [Fri, 22 Jan 2021 18:03:14 +0000 (19:03 +0100)]
[libc++][doc] Update the release notes.
Updates the libc++ release notes with the changes since the last
release.
Differential Revision: https://reviews.llvm.org/D95248
Kostya Kortchinsky [Sat, 9 Jan 2021 16:40:17 +0000 (08:40 -0800)]
[scudo][standalone] Enable death tests on Fuchsia
zxtest doesn't have `EXPECT_DEATH` and the Scudo unit-tests were
defining it as a no-op.
This enables death tests on Fuchsia by using `ASSERT_DEATH` instead.
I used a lambda to wrap the expressions as this appears to not be
working the same way as `EXPECT_DEATH`.
Additionnally, a death test using `alarm` was failing with the change,
as it's currently not implemented in Fuchsia, so move that test within
a `!SCUDO_FUCHSIA` block.
Differential Revision: https://reviews.llvm.org/D94362
Anton Zabaznov [Mon, 25 Jan 2021 16:23:58 +0000 (19:23 +0300)]
[OpenCL] Refactor of targets OpenCL option settings
Currently, there is some refactoring needed in existing interface of OpenCL option
settings to support OpenCL C 3.0. The problem is that OpenCL extensions and features
are not only determined by the target platform but also by the OpenCL version.
Also, there are core extensions/features which are supported unconditionally in
specific OpenCL C version. In fact, these rules are not being followed for all targets.
For example, there are some targets (as nvptx and r600) which don't support
OpenCL C 2.0 core features (nvptx.languageOptsOpenCL.cl, r600.languageOptsOpenCL.cl).
After the change there will be explicit differentiation between optional core and core
OpenCL features which allows giving diagnostics if target doesn't support any of
necessary core features for specific OpenCL version.
This patch also eliminates `OpenCLOptions` instance duplication from `TargetOptions`.
`OpenCLOptions` instance should take place in `Sema` as it's going to be modified
during parsing. Removing this duplication will also allow to generally simplify
`OpenCLOptions` class for parsing purposes.
Reviewed By: Anastasia
Differential Revision: https://reviews.llvm.org/D92277
Xun Li [Mon, 25 Jan 2021 16:37:18 +0000 (08:37 -0800)]
Revert "Fix unused variable in CoroFrame.cpp when building Release with GCC 10"
This reverts commit
ff5e896425577f445ed080d88b582aab0896fba0.
Ruslan Arutyunyan [Mon, 25 Jan 2021 16:12:25 +0000 (11:12 -0500)]
[libc++] Implement P0655R1 visit<R>: Explicit Return Type for visit
Differential Revision: https://reviews.llvm.org/D92044
Jon Chesterfield [Mon, 25 Jan 2021 16:12:56 +0000 (16:12 +0000)]
[libomptarget] Compile with older cuda, revert D95274
[libomptarget] Compile with older cuda, revert D95274
Fixes regression reported in comments of D95274.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D95367
Dmitry Preobrazhensky [Mon, 25 Jan 2021 16:01:19 +0000 (19:01 +0300)]
[AMDGPU][MC] Improved errors handling for SDWA operands
Reviewers: rampitec
Differential Revision: https://reviews.llvm.org/D95212
Nico Weber [Mon, 25 Jan 2021 16:00:38 +0000 (11:00 -0500)]
Revert "[JITLink] Enable exception handling for ELF."
This reverts commit
6884fbc2c4fb46d0528c02d16d510f4f725fac11.
Breaks tests on Windows: http://45.33.8.238/win/31981/step_11.txt
Muhammad Omair Javaid [Mon, 25 Jan 2021 15:29:22 +0000 (20:29 +0500)]
[LLDB] Skip TestPlatformProcessConnect on arm/aarch64 buildbot
TestPlatformProcessConnect is randomly failing on LLDB Arm/AArch64
buildbot. I am disabling it temporarily untill problem is fixed.
Muhammad Omair Javaid [Mon, 25 Jan 2021 12:04:38 +0000 (17:04 +0500)]
[LLDB] Define AUXV_AT_HWCAP2 in AuxVector.h
This patch defines AUXV_AT_HWCAP2 for accessing Aux extensions.
Muhammad Omair Javaid [Mon, 25 Jan 2021 11:41:24 +0000 (16:41 +0500)]
[LLDB] Remove leftovers and typos from RegisterInfos_arm64_sve.h
This patch removes a couple of left-overs and a typo from
RegisterInfos_arm64_sve.h and RegisterInfoPOSIX_arm64.h.
Jeroen Dobbelaere [Mon, 25 Jan 2021 15:40:01 +0000 (16:40 +0100)]
[Verifier] disable llvm.experimental.noalias.scope.decl dominance check.
This was enabled in https://reviews.llvm.org/D95335 but it breaks the stage2 fuchsia build
(See http://lab.llvm.org:8011/#/builders/98/builds/4105/steps/9/logs/stdio)
Simon Pilgrim [Mon, 25 Jan 2021 14:48:40 +0000 (14:48 +0000)]
[X86][AVX] Generalize vperm2f128/vperm2i128 patterns to support all legal 256-bit vector types
Remove bitcasts to/from v4x64 types through vperm2f128/vperm2i128 ops to help improve shuffle combining and demanded vector elts folding.
Jeroen Dobbelaere [Mon, 25 Jan 2021 15:19:12 +0000 (16:19 +0100)]
[Verifier] enable and limit llvm.experimental.noalias.scope.decl dominance checking
Checking the llvm.experimental.noalias.scope.decl dominance can be worstcase O(N^2).
Limit the dominance check to N=32.
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D95335
Sam McCall [Mon, 25 Jan 2021 13:03:13 +0000 (14:03 +0100)]
[clangd] Allow diagnostics to be suppressed with configuration
This has been specifically requested:
https://github.com/clangd/vscode-clangd/issues/114
and various issues can be addressed with this as a workaround, e.g.:
https://github.com/clangd/clangd/issues/662
Differential Revision: https://reviews.llvm.org/D95349
Adam Czachorowski [Mon, 18 Jan 2021 17:17:52 +0000 (18:17 +0100)]
[clangd] Fix a crash when indexing invalid ObjC method declaration
This fix will make us not crash, but ideally we would handle this case
better.
Differential Revision: https://reviews.llvm.org/D94919
xgupta [Mon, 25 Jan 2021 14:28:03 +0000 (19:58 +0530)]
[Doc][NFC] Fix Kaleidoscope links, typos and add blog posts for MCJIT
Florian Hahn [Mon, 25 Jan 2021 11:17:56 +0000 (11:17 +0000)]
[VPlan] Handle scalarized values in VPTransformState.
This patch adds plumbing to handle scalarized values directly in
VPTransformState.
Reviewed By: gilr
Differential Revision: https://reviews.llvm.org/D92282
Nicolas Vasilache [Mon, 25 Jan 2021 14:16:01 +0000 (14:16 +0000)]
[mlir] Generalize OpFoldResult usage in ops with offsets, sizes and operands.
This revision starts evolving the APIs to manipulate ops with offsets, sizes and operands towards a ValueOrAttr abstraction that is already used in folding under the name OpFoldResult.
The objective, in the future, is to allow such manipulations all the way to the level of ODS to avoid all the genuflexions involved in distinguishing between values and attributes for generic constant foldings.
Once this evolution is accepted, the next step will be a mechanical OpFoldResult -> ValueOrAttr.
Differential Revision: https://reviews.llvm.org/D95310
xgupta [Mon, 25 Jan 2021 14:08:32 +0000 (19:38 +0530)]
[NFC] Fix title comment typo and provide description for LLJIT example.
Nicolas Vasilache [Mon, 25 Jan 2021 14:04:06 +0000 (14:04 +0000)]
[mlir][Linalg] Fix incorrect erase order
Adam Czachorowski [Thu, 21 Jan 2021 16:51:13 +0000 (17:51 +0100)]
[clang] Fix a nullptr dereference bug on invalid code
When working with invalid code, we would try to dereference a nullptr
while deducing template arguments in some dependend code operating on a
lambda with invalid return type.
Differential Revision: https://reviews.llvm.org/D95145
Nicolas Vasilache [Mon, 25 Jan 2021 13:41:50 +0000 (13:41 +0000)]
[mlir][Linalg] Address missed review item
This revision addresses a remaining comment that was overlooked in https://reviews.llvm.org/D95243:
the pad hoisting transformation is made to additionally bail out on side effecting ops other than LoopLikeOps.
Simon Pilgrim [Mon, 25 Jan 2021 13:45:19 +0000 (13:45 +0000)]
[X86][AVX] combineX86ShuffleChainWithExtract - widen to at least original root size. NFCI.
We're relying on the source inputs for shuffle combining having already been widened to the root size (otherwise the offset logic falls over) - we're going to be supporting different sized shuffle inputs soon, so we need to explicitly make the minimum widened width the original root size.
Abhina Sreeskantharajan [Mon, 25 Jan 2021 13:02:41 +0000 (08:02 -0500)]
Revert "[SystemZ][z/OS] Fix No such file or directory expression error"
This reverts commit
06f8a49693957bc27b83e0ab5f429ff874941a07.
Abhina Sreeskantharajan [Mon, 25 Jan 2021 13:02:27 +0000 (08:02 -0500)]
Revert "[SystemZ][z/OS] Fix No such file or directory expression error matching in lit tests - continued"
This reverts commit
520b5ecf856152f35ee38207eec39f5674dd2bd4.
Tom Ritter [Mon, 25 Jan 2021 13:06:54 +0000 (08:06 -0500)]
Add a --use-color option to clang-query to allow forcing the behavior
D62056 makes the output color if clang auto-detects a tty, but if it
does not, there is no way to force it to use colors anyway.
This patch adjusts the command-lines given to ClangTool which will
force color on or off if --use-color is specified.
Sanjay Patel [Sun, 24 Jan 2021 17:57:11 +0000 (12:57 -0500)]
[InstCombine] narrow min/max intrinsics with extended inputs
We can sink extends after min/max if they match and would
not change the sign-interpreted compare. The only combo
that doesn't work is zext+smin/smax because the zexts
could change a negative number into positive:
https://alive2.llvm.org/ce/z/D6sz6J
Sext+umax/umin works:
define i32 @src(i8 %x, i8 %y) {
%0:
%sx = sext i8 %x to i32
%sy = sext i8 %y to i32
%m = umax i32 %sx, %sy
ret i32 %m
}
=>
define i32 @tgt(i8 %x, i8 %y) {
%0:
%m = umax i8 %x, %y
%r = sext i8 %m to i32
ret i32 %r
}
Transformation seems to be correct!
Sanjay Patel [Sun, 24 Jan 2021 17:37:38 +0000 (12:37 -0500)]
[InstCombine] add tests for min/max intrinsics with extended values; NFC
Sven van Haastregt [Mon, 25 Jan 2021 12:43:30 +0000 (12:43 +0000)]
Revert "[clang] Fix signedness in vector bitcast evaluation"
This reverts commit
14947cd04701d923a57a0161fd1967b81e00ff5e because
it broke clang-cmake-armv7-quick.
Nicolas Vasilache [Mon, 25 Jan 2021 11:48:39 +0000 (11:48 +0000)]
[mlir][Linalg] Add a hoistPaddingOnTensors transformation
This transformation anchors on a padding op whose result is only used as an input
to a Linalg op and pulls it out of a given number of loops.
The result is a packing of padded tailes of ops that is amortized just before
the outermost loop from which the pad operation is hoisted.
Differential revision: https://reviews.llvm.org/D95243
Faris Rehman [Mon, 25 Jan 2021 12:07:17 +0000 (12:07 +0000)]
[flang][driver] Update PP tests to use the new driver
Update the preprocessor regression tests to use the new driver if the new driver is built (FLANG_BUILD_NEW_DRIVER=On), otherwise the tests will still run using f18.
Summary of changes:
- Introduce %flang to the regression tests, which points to the new driver if it is built or otherwise points to f18
- Update all tests in flang/test/Preprocessing/ to use %flang
Differential Revision: https://reviews.llvm.org/D94805
Sander de Smalen [Wed, 20 Jan 2021 09:10:24 +0000 (09:10 +0000)]
[SLPVectorizer] NFC: Migrate getVectorCallCosts to use InstructionCost.
This change also changes getReductionCost to return InstructionCost,
and it simplifies two expressions by removing a redundant 'isValid' check.
Simon Pilgrim [Mon, 25 Jan 2021 12:10:12 +0000 (12:10 +0000)]
[X86][AVX] LowerTRUNCATE - avoid bitcasts around extract_subvectors.
We allow extract_subvector lowering of all legal types, so pre-bitcast the source type to try and reduce bitcast pollution.
Sven van Haastregt [Mon, 25 Jan 2021 12:01:42 +0000 (12:01 +0000)]
[clang] Fix signedness in vector bitcast evaluation
The included test case triggered a sign assertion on the result in
`Success()`. This was caused by the APSInt created for a bitcast
having its signedness bit inverted. The second APSInt constructor
argument is `isUnsigned`, so invert the result of
`isSignedIntegerType`.
Differential Revision: https://reviews.llvm.org/D95135
Faris Rehman [Mon, 25 Jan 2021 11:58:52 +0000 (11:58 +0000)]
[flang][driver] Remove newline in CompilerInvocation
Remove a new line in CompilerInvocation, to now follow the style when clang-format is applied.
Simon Pilgrim [Mon, 25 Jan 2021 11:10:17 +0000 (11:10 +0000)]
[X86][AVX] combineX86ShuffleChain - avoid bitcasts around insert_subvector() shuffle patterns.
We allow insert_subvector lowering of all legal types, so don't always cast to the vXi64/vXf64 shuffle types - this is only necessary for X86ISD::SHUF128/X86ISD::VPERM2X128 patterns later.
Simon Pilgrim [Sat, 23 Jan 2021 18:01:12 +0000 (18:01 +0000)]
[TableGen] RuleMatcher::defineComplexSubOperand avoid std::string copy. NFCI.
Use const reference to avoid std::string copy - accordingly to the style guide we shouldn't be using auto anyway.
Fixes MSVC analyzer warning.
Sander de Smalen [Thu, 21 Jan 2021 16:37:09 +0000 (16:37 +0000)]
[InstructionCost] Prevent InstructionCost being created with CostState.
For a function that returns InstructionCost, it is very tempting to write:
return InstructionCost::Invalid;
But that actually returns InstructionCost(1 /* int value of Invalid */))
which has a totally different meaning. By marking this constructor as
`delete`, this can no longer happen.
Anastasia Stulova [Mon, 25 Jan 2021 11:17:03 +0000 (11:17 +0000)]
[OpenCL][Docs] Describe tablegen BIFs declarations.
Added documentation for the fast builtin
function declarations with -fdeclare-opencl-builtins.
Tags: #clang
Differential Revision: https://reviews.llvm.org/D95038
Fraser Cormack [Fri, 8 Jan 2021 09:32:15 +0000 (09:32 +0000)]
[SelectionDAG] Support scalable-vector splats in more cases
This patch adds support for scalable-vector splats in DAGCombiner's
`isConstantOrConstantVector` and `ISD::matchUnaryPredicate` functions,
which enable the SelectionDAG div/rem-by-constant optimizations for
scalable vector types.
It also fixes up one case where the UDIV optimization was generating a
SETCC without first consulting the target for its preferred SETCC result
type.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D94501
Philip Pfaffe [Mon, 25 Jan 2021 10:05:13 +0000 (11:05 +0100)]
[llvm-dwp] Automatically set the target triple
The llvm-dwp tool hard-codes the target triple to x86. Instead, deduce the
target triple from the object files being read.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D93749
Benjamin Kramer [Mon, 25 Jan 2021 10:48:58 +0000 (11:48 +0100)]
[mlir] Perfectly forward ImplicitLocOpBuilder ctors to OpBuilder
This is both cleaner and less prone to creating a mess out of overload
resolution.
Georgii Rymar [Mon, 25 Jan 2021 10:23:58 +0000 (13:23 +0300)]
[ObjectYAML] - An attempt to fix BB after commit of D95140.
D95140 introduced `static constexpr StringRef TypeStr = "SectionHeaderTable";` member
of `SectionHeaderTable` with in-class initialized. BB reports the link error:
/usr/bin/ld: lib/libLLVMObjectYAML.a(ELFYAML.cpp.o): in function
`llvm::yaml::MappingTraits<std::unique_ptr<llvm::ELFYAML::Chunk, std::default_delete<llvm::ELFYAML::Chunk> > >::mapping(llvm::yaml::IO&, std::unique_ptr<llvm::ELFYAML::Chunk, std::default_delete<llvm::ELFYAML::Chunk> >&)':
ELFYAML.cpp:(.text._ZN4llvm4yaml13MappingTraitsISt10unique_ptrINS_7ELFYAML5ChunkESt14default_deleteIS4_EEE7mappingERNS0_2IOERS7_+0x58): undefined reference to `llvm::ELFYAML::SectionHeaderTable::TypeStr'
/usr/bin/ld: ELFYAML.cpp:(.text._ZN4llvm4yaml13MappingTraitsISt10unique_ptrINS_7ELFYAML5ChunkESt14default_deleteIS4_EEE7mappingERNS0_2IOERS7_+0x353):undefined reference to `llvm::ELFYAML::SectionHeaderTable::TypeStr'
/usr/bin/ld: ELFYAML.cpp:(.text._ZN4llvm4yaml13MappingTraitsISt10unique_ptrINS_7ELFYAML5ChunkESt14default_deleteIS4_EEE7mappingERNS0_2IOERS7_+0x6e5): undefined reference to `llvm::ELFYAML::SectionHeaderTable::TypeStr'
This patch adds a definition to cpp file, I guess it should fix the issue.
Kirill Bobyrev [Mon, 25 Jan 2021 10:09:56 +0000 (11:09 +0100)]
[clang] NFC: Remove else-after-return pattern from some files
Follow-up on D95336. A bunch of these cases were found manually, the
rest made sense to be included to eliminate llvm-else-after-return
Clang-Tidy warnings.
Georgii Rymar [Tue, 19 Jan 2021 14:02:08 +0000 (17:02 +0300)]
[yaml2obj, obj2yaml] - Implement section header table as a special Chunk.
This was discussed in D93678 thread.
Currently we have one special chunk - Fill.
This patch re implements the "SectionHeaderTable" key to become a special chunk too.
With that we are able to place the section header table at any location,
just like we place sections.
Differential revision: https://reviews.llvm.org/D95140
Marek Kurdej [Mon, 25 Jan 2021 09:59:47 +0000 (10:59 +0100)]
[clang-format] [docs] Fix RST indentation.