Louis Dionne [Tue, 14 Jun 2022 13:52:49 +0000 (09:52 -0400)]
Add __config formatting to .git-blame-ignore-revs
Daniel Bertalan [Tue, 14 Jun 2022 13:41:28 +0000 (09:41 -0400)]
[lld-macho] Print the name of functions containing undefined references
The error used to look like this:
ld64.lld: error: undefined symbol: _foo
>>> referenced by /path/to/bar.o
Now it displays the name of the function that contains the undefined
reference as well:
ld64.lld: error: undefined symbol: _foo
>>> referenced by /path/to/bar.o:(symbol _baz+0x4)
Differential Revision: https://reviews.llvm.org/
D127696
Lucas Prates [Tue, 14 Jun 2022 13:16:38 +0000 (14:16 +0100)]
[NFC][Thumb] Update frame-chain codegen test to use thumbv6m
The `llvm/test/CodeGen/Thumb/frame-chain.ll`, recently added by
D125094,
currently fails when expensive checks are enabled due to a tMOVr
instruction that is only valid from V6 onwards.
The use of the invalid instruction is unrelated to the contents of the
original patch, and continues to be triggered by this test if its
CodeGen changes are reverted, so this patch updates the test to use V6-M
while the issue is not resolved.
Joe Nash [Mon, 13 Jun 2022 20:38:18 +0000 (16:38 -0400)]
[AMDGPU] gfx11 support add_f16
The instruction was skipped in the earlier large patch adding
VOP2, https://reviews.llvm.org/
D126917.
Reviewed By: rampitec, #amdgpu
Differential Revision: https://reviews.llvm.org/
D127697
Serguei Katkov [Tue, 14 Jun 2022 12:58:55 +0000 (19:58 +0700)]
Revert "[MachineSSAUpdater] compile time improvement in GetValueInMiddleOfBlock"
It looks like it causes buildbot failures.
As an example: https://lab.llvm.org/buildbot/#/builders/121/builds/20364
Revert to investigate...
This reverts commit
6bf27918144cb843cf5ae9a93cb5f936730f3cce.
Joseph Huber [Mon, 13 Jun 2022 17:41:50 +0000 (13:41 -0400)]
[OpenMP] Fix offload packager not writing to temps correctly
The offloading packager doesn't have a normal offloading kind. This
would result in its output being sent to the executable name when in
save-temps mode. This would then get overwritten by the actual output.
This patch adds specific checks to make sure that it gets the correct
name.
Reviewed By: tra
Differential Revision: https://reviews.llvm.org/
D127673
Louis Dionne [Mon, 13 Jun 2022 15:21:16 +0000 (11:21 -0400)]
[libc++] Remove macros for IBM compiler
It's not tested or used anymore -- instead a Clang-based compiler is
used on IBM nowadays.
Differential Revision: https://reviews.llvm.org/
D127650
Vir Narula [Tue, 14 Jun 2022 13:13:12 +0000 (14:13 +0100)]
[AArch64] Add cost tests for fadd reductions with fast math flags.
Add test coverage showing how the costs of fadd reductions is
overestimated at the moment.
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/
D127682
David Green [Tue, 14 Jun 2022 13:08:43 +0000 (14:08 +0100)]
[ARM] Add more opaque pointer gather/scatter tests. NFC
Some of the newly added tests are incorrect, fixed in
D127733.
David Sherwood [Wed, 8 Jun 2022 14:05:10 +0000 (15:05 +0100)]
[AArch64][SME] Add ldr/str (fill/spill) intrinsics
This patch adds implementations for the fill/spill SME ACLE intrinsics:
@llvm.aarch64.sme.ldr
@llvm.aarch64.sme.str
Differential Revision: https://reviews.llvm.org/
D127317
Jay Foad [Tue, 14 Jun 2022 12:39:11 +0000 (13:39 +0100)]
[AMDGPU] Add a GFX11 MCA test
This mostly just tests that DPFP is 1/32 rate on GFX11, instead of 1/16
rate as on GFX10.
Jean Perier [Tue, 14 Jun 2022 12:32:39 +0000 (14:32 +0200)]
[flang] Support PDT declaration with initial comp value in internal procedure
Lowering was crashing with "fatal internal error: node has not been analyzed"
if a PDT with initial component value was defined inside an internal
procedure. This is because the related expression cannot be analyzed
without the component values (which happens at the instatiation).
These expression do not need to be visited (the instantiations, if any
will be). Use the form of GetExpr that tolerates the parse tree expression
to not be analyzed into an evaluate::Expr when looking through the
symbols used in an internal procedure.
Note that the PDTs TODO will then fire (it happens after the PFT
analysis) as expected if the derived type is used.
Differential Revision: https://reviews.llvm.org/
D127735
Lucas Prates [Fri, 6 May 2022 09:31:11 +0000 (10:31 +0100)]
[ARM][Thumb] Command-line option to ensure AAPCS compliant Frame Records
Currently the a AAPCS compliant frame record is not always created for
functions when it should. Although a consistent frame record might not
be required in some cases, there are still scenarios where applications
may want to make use of the call hierarchy made available trough it.
In order to enable the use of AAPCS compliant frame records whilst keep
backwards compatibility, this patch introduces a new command-line option
(`-mframe-chain=[none|aapcs|aapcs+leaf]`) for Aarch32 and Thumb backends.
The option allows users to explicitly select when to use it, and is also
useful to ensure the extra overhead introduced by the frame records is
only introduced when necessary, in particular for Thumb targets.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/
D125094
Florian Hahn [Tue, 14 Jun 2022 12:15:23 +0000 (13:15 +0100)]
[InterleavedLoadComb] Rename uses when inserting new uses.
This fixes a crash due to uses needing to be renamed.
Jun Zhang [Tue, 14 Jun 2022 11:52:06 +0000 (19:52 +0800)]
Revert "Reland "[CodeGen] Keep track info of lazy-emitted symbols in ModuleBuilder""
This reverts commit
781ee538da1855876b085989a37ec959e3f2ecd1.
Asan build is still broken :(
Balazs Benics [Tue, 14 Jun 2022 11:43:04 +0000 (13:43 +0200)]
[analyzer][Casting] Support isa, cast, dyn_cast of SVals
This change specializes the LLVM RTTI mechanism for SVals.
After this change, we can use the well-known `isa`, `cast`, `dyn_cast`.
Examples:
// SVal V = ...;
// Loc MyLoc = ...;
bool IsInteresting = isa<loc::MemRegionVal, loc::GotoLabel>(MyLoc);
auto MRV = cast<loc::MemRegionVal>(MyLoc);
Optional<loc::MemRegionVal> MaybeMRV = dyn_cast<loc::MemRegionVal>(V)
The current `SVal::getAs` and `castAs` member functions are redundant at
this point, but I believe that they are still handy.
The member function version is terse and reads left-to-right, which IMO
is a great plus. However, we should probably add a variadic `isa` member
function version to have the same casting API in both cases.
Thanks for the extensive TMP help @bzcheeseman!
Reviewed By: bzcheeseman
Differential Revision: https://reviews.llvm.org/
D125709
Serguei Katkov [Thu, 26 May 2022 04:51:36 +0000 (11:51 +0700)]
[MachineSSAUpdater] compile time improvement in GetValueInMiddleOfBlock
GetValueInMiddleOfBlock uses result of GetValueAtEndOfBlockInternal if there is no value
defined for current basic block.
If there is already a value it tries (in this order):
to find single register coming from all predecessors
find existing phi node which matches our incoming registers
build new phi.
The compile time improvement is to use current available value if
it is defined out of current BB or it is a PHI register.
This is due to it can be used in the middle basic block.
Reviewed By: sameerds
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/
D126523
Guillaume Chatelet [Tue, 14 Jun 2022 09:55:55 +0000 (09:55 +0000)]
[NFC] Remove dead code
Guillaume Chatelet [Tue, 14 Jun 2022 09:55:27 +0000 (09:55 +0000)]
[NFC][Alignment] Use MaybeAlign in CGCleanup/CGExpr
Guillaume Chatelet [Tue, 14 Jun 2022 09:52:45 +0000 (09:52 +0000)]
[NFC][Alignment] Use Align in CoroFrame
Guillaume Chatelet [Tue, 14 Jun 2022 09:50:54 +0000 (09:50 +0000)]
[NFC][Alignment] Use Align in SafeStack
Guillaume Chatelet [Tue, 14 Jun 2022 09:46:14 +0000 (09:46 +0000)]
[NFC][Alignment] Use Align in shouldAlignPointerArgs
Guillaume Chatelet [Tue, 14 Jun 2022 08:45:20 +0000 (08:45 +0000)]
[NFC][Alignment] use getAlign in AddressSanitizer
Jay Foad [Tue, 14 Jun 2022 10:33:09 +0000 (11:33 +0100)]
[AMDGPU] Add GFX11 llvm-objdump tests
Jun Zhang [Tue, 14 Jun 2022 09:36:41 +0000 (17:36 +0800)]
Reland "[CodeGen] Keep track info of lazy-emitted symbols in ModuleBuilder"
This reverts commits:
d3ddc251acae631bf5ab4da13878f7e8b5b5a451
d90eecff5c9e7e9f8263de6cd72d70322400829f
This relands below commit with asan fix:
The intent of this patch is to selectively carry some states over to
the Builder so we won't lose the information of the previous symbols.
This used to be several downstream patches of Cling, it aims to fix
errors in Clang Interpreter when trying to use inline functions.
Before this patch:
clang-repl> inline int foo() { return 42;}
clang-repl> int x = foo();
JIT session error: Symbols not found: [ _Z3foov ]
error: Failed to materialize symbols:
{ (main, { x, $.incr_module_1.__inits.0, __orc_init_func.incr_module_1 }) }
Co-authored-by: Axel Naumann <Axel.Naumann@cern.ch>
Signed-off-by: Jun Zhang <jun@junz.org>
Differential Revision: https://reviews.llvm.org/
D127730
Rosie Sumpter [Mon, 6 Jun 2022 15:06:43 +0000 (16:06 +0100)]
[AArch64][SME] Add load/store intrinsics
This patch adds implementations for the load/store SME ACLE intrinsics:
- @llvm.aarch64.sme.ld1*
- @llvm.aarch64.sme.st1*
Differential Revision: https://reviews.llvm.org/
D127210
Dmitry Preobrazhensky [Tue, 14 Jun 2022 09:56:38 +0000 (12:56 +0300)]
[AMDGPU][MC][GFX11] Correct ds_swizzle_b32
Enable offset parsing.
Differential Revision: https://reviews.llvm.org/
D127404
Alon Kom [Tue, 14 Jun 2022 09:50:22 +0000 (10:50 +0100)]
[SCEV] Add tests where assumes can be used to improve trip multiple.
Add tests combing assume on trip count divisibility (tc % vf) and minimum values (tc > N).
Github issue #55645
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/
D126460
Pavel Labath [Tue, 14 Jun 2022 09:38:45 +0000 (11:38 +0200)]
[lldb] Fix TestDyldExecLinux with xml enabled
NativeProcessLinux is not able to properly read libraries-svr4 data when
running with ld.so as the "main" executable. Normally, this is not a big
problem, as it returns an error message, and lldb can fallback to manual
library loading.
Unfortunately, lldb-server also does not clear cached svr4 data on exec,
which means that it does *not* return an error when the application
execs from the "regular" to the "ld.so" mode. Instead it returns
incorrect data (it is missing the main executable) and causes
TestDyldExecLinux to fail (but only when building with xml support
enabled).
This patch makes ensures that cached process data is cleared on exec,
fixing the test. Since TestDyldExecLinux has shown to be sensitive to
the way we read library info, I fork it into two (with svr4 enabled and
disabled).
Florian Hahn [Tue, 14 Jun 2022 09:37:12 +0000 (10:37 +0100)]
[ConstraintElimination] Support constraints with only const ops.
Remove the early exit if both constraints contain no variables. This
restriction is unnecessayr for correctness and removing it simplifies
handling of trivial constant conditions in follow-up changes.
gbreynoo [Tue, 14 Jun 2022 09:32:56 +0000 (10:32 +0100)]
[llvm-cxxfilt] Add description for --types in help text
It appears that in the move to tablegen the description of --types was
lost:
https://reviews.llvm.org/
D105605
This change adds the missing description.
Differential revision: https://reviews.llvm.org/
D127656
Jean Perier [Tue, 14 Jun 2022 08:47:40 +0000 (10:47 +0200)]
Add lowering TODO for bindings returning derived types or arrays
Codegen does not support fir.addressof of functions returning derived
types, arrays are descriptors inside GlobalOp region.
This is because the abstract-result-opt is required to rewrite such
functions (a hidden argument must be added), but this pass is meant to
run in GlobalOp currently.
Such fir.address_of may be created when lowering procedure pointers
initial value (TODO), or when creating derived type descriptors for
types with bindings.
Add a TODO in lowering until abstract-result-opt is modified to run
on GlobalOp too.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/
D127722
Balazs Benics [Tue, 14 Jun 2022 08:22:37 +0000 (10:22 +0200)]
Reland "[analyzer] Deprecate the unused 'analyzer-opt-analyze-nested-blocks' cc1 flag"
It was previously reverted by
8406839d1926486de900c7cabeea9f841bd3edf2.
---
This flag was introduced by
https://github.com/llvm/llvm-project/commit/
6818991d7165f68fe196922d9e5c6648dd57cc47
commit
6818991d7165f68fe196922d9e5c6648dd57cc47
Author: Ted Kremenek <kremenek@apple.com>
Date: Mon Dec 7 22:06:12 2009 +0000
Add clang-cc option '-analyzer-opt-analyze-nested-blocks' to treat
block literals as an entry point for analyzer checks.
The last reference was removed by this commit:
https://github.com/llvm/llvm-project/commit/
5c32dfc5fb1cfcff8ae3671284e17daa8da3a188
commit
5c32dfc5fb1cfcff8ae3671284e17daa8da3a188
Author: Anna Zaks <ganna@apple.com>
Date: Fri Dec 21 01:19:15 2012 +0000
[analyzer] Add blocks and ObjC messages to the call graph.
This paves the road for constructing a better function dependency graph.
If we analyze a function before the functions it calls and inlines,
there is more opportunity for optimization.
Note, we add call edges to the called methods that correspond to
function definitions (declarations with bodies).
Consequently, we should remove this dead flag.
However, this arises a couple of burning questions.
- Should the `cc1` frontend still accept this flag - to keep
tools/users passing this flag directly to `cc1` (which is unsupported,
unadvertised) working.
- If we should remain backward compatible, how long?
- How can we get rid of deprecated and obsolete flags at some point?
Reviewed By: martong
Differential Revision: https://reviews.llvm.org/
D126067
Denis Antrushin [Wed, 8 Jun 2022 13:53:54 +0000 (20:53 +0700)]
[Statepoints] FixupStatepoint: Clear isKill flag if COPY is not deleted.
When spilling CSRs, FixupStatepoint pass does simple copy propagation,
trying to find COPY instruction which defines register being spilled
and spill COPY source instead. I.e., if we have CSR $x and found
$x = COPY $y
we will spill $y instead.
But we may be unable to delete COPY instruction for some reason.
Then, spill will be inserted after it, adding another use of $y.
If COPY instruction was last use of $y (killed it), after insertion of
the spill it is not, so `isKill` flag must be cleared. We failed to do
so and this patch fixes this issue.
Reviewed By: skatkov
Differential Revision: https://reviews.llvm.org/
D127308
Balazs Benics [Tue, 14 Jun 2022 07:42:58 +0000 (09:42 +0200)]
[analyzer][NFC] Inline AnalyzerOptions::getUserMode()
When I read the code I found it easier to reason about if `getUserMode`
is inlined. It might be a personal preference though.
Reviewed By: martong
Differential Revision: https://reviews.llvm.org/
D127486
Balazs Benics [Tue, 14 Jun 2022 07:20:41 +0000 (09:20 +0200)]
Reland "[analyzer] Deprecate `-analyzer-store region` flag"
I'm trying to remove unused options from the `Analyses.def` file, then
merge the rest of the useful options into the `AnalyzerOptions.def`.
Then make sure one can set these by an `-analyzer-config XXX=YYY` style
flag.
Then surface the `-analyzer-config` to the `clang` frontend;
After all of this, we can pursue the tablegen approach described
https://discourse.llvm.org/t/rfc-tablegen-clang-static-analyzer-engine-options-for-better-documentation/61488
In this patch, I'm proposing flag deprecations.
We should support deprecated analyzer flags for exactly one release. In
this case I'm planning to drop this flag in `clang-16`.
In the clang frontend, now we won't pass this option to the cc1
frontend, rather emit a warning diagnostic reminding the users about
this deprecated flag, which will be turned into error in clang-16.
Unfortunately, I had to remove all the tests referring to this flag,
causing a mass change. I've also added a test for checking this warning.
I've seen that `scan-build` also uses this flag, but I think we should
remove that part only after we turn this into a hard error.
Reviewed By: martong
Differential Revision: https://reviews.llvm.org/
D126215
Kai Luo [Tue, 14 Jun 2022 06:55:28 +0000 (14:55 +0800)]
[PowerPC] Correct test RUN line. NFC.
Pavel Labath [Tue, 14 Jun 2022 06:44:48 +0000 (08:44 +0200)]
[lldb] Fix TCPSocket::Connect when getaddrinfo returns multiple addrs
TCPSocket::Connect() calls SocketAddress::GetAddressInfo() and tries to
connect any of them (in a for loop).
This used to work before commit
4f6d3a376c9f("[LLDB] Fix setting of
success in Socket::Close()") https://reviews.llvm.org/
D116768.
As a side effect of that commit, TCPSocket can only connect to the first
address returned by SocketAddress::GetAddressInfo().
1. If the attempt to connect to the first address fails,
TCPSocket::Connect(), calls CLOSE_SOCKET(GetNativeSocket()), which
closes the fd, but DOES NOT set m_socket to kInvalidSocketValue.
2. On the second attempt, TCPSocket::CreateSocket() calls
Socket::Close().
3. Socket::Close() proceeds, because IsValid() is true (m_socket was not
reset on step 1).
4. Socket::Close() calls ::close(m_socket), which fails
5. Since commit
4f6d3a376c9f("[LLDB] Fix setting of success in
Socket::Close()"), this is error is detected. Socket::Close() returns
an error.
6. TCPSocket::CreateSocket() therefore returns an error.
7. TCPSocket::Connect() detects the error and continues, skipping the
second (and the third, fourth...) address.
This commit fixes the problem by changing step 1: by calling
Socket::Close, instead of directly calling close(m_socket), m_socket is
also se to kInvalidSocketValue. On step 3, Socket::Close() is going to
return immediately and, on step 6, TCPSocket::CreateSocket() does not
fail.
How to reproduce this problem:
On my system, getaddrinfo() resolves "localhost" to "::1" (first) and to
"127.0.0.1" (second).
Start a gdbserver that only listens on 127.0.0.1:
```
gdbserver 127.0.0.1:2159 /bin/cat
Process /bin/cat created; pid =
2146709
Listening on port 2159
```
Start lldb and make it connect to "localhost:2159"
```
./bin/lldb
(lldb) gdb-remote localhost:2159
```
Before
4f6d3a376c9f("[LLDB] Fix setting of success in Socket::Close()"),
this used to work. After that commit, it stopped working. This commit
fixes the problem.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/
D126702
Chuanqi Xu [Tue, 14 Jun 2022 06:44:51 +0000 (14:44 +0800)]
[NFC] Fix Wswitch warning triggered by 735e6c
Kai Luo [Tue, 14 Jun 2022 06:22:29 +0000 (14:22 +0800)]
[PowerPC][AtomicExpand] Precommit IR tests for
D127609. NFC.
Chuanqi Xu [Fri, 10 Jun 2022 03:37:09 +0000 (11:37 +0800)]
[Coroutines] Convert coroutine.presplit to enum attr
This is required by @nikic in https://reviews.llvm.org/
D127383 to
decrease the cost to check whether a function is a coroutine and this
fixes a FIXME too.
Reviewed By: rjmccall, ezhulenev
Differential Revision: https://reviews.llvm.org/
D127471
Kazu Hirata [Tue, 14 Jun 2022 06:08:49 +0000 (23:08 -0700)]
[CodeGen] Remove addSEHCatchHandler and addSEHCleanupHandler (NFC)
The last uses of these functions are removed on Oct 9, 2015 in commit
14e773500e036de57ed0ca4af6fddc1f8b6767d8.
Kazu Hirata [Tue, 14 Jun 2022 06:08:48 +0000 (23:08 -0700)]
[CodeGen] Remove restrictRef (NFC)
The last use was removed on Apr 14, 2017 in commit
4fe9d6c640e81457db1350766bf6dfef118bcacd.
zhongyunde [Tue, 14 Jun 2022 05:54:49 +0000 (13:54 +0800)]
[AArch64][NFC] Fix a comment error
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/
D127708
Thomas Raoux [Tue, 7 Jun 2022 02:34:35 +0000 (02:34 +0000)]
[mlir][vector] Add pattern to distribute vector reduction to GPU shuffles
Add a pattern to do ad hoc lowering of vector.reduction to a sequence of
warp shuffles. This allow distributing reduction on a warp for GPU targets.
Also add an execution test for warp reduction.
co-authored with @springerm
Differential Revision: https://reviews.llvm.org/
D127176
Thomas Raoux [Tue, 14 Jun 2022 04:59:08 +0000 (04:59 +0000)]
[mlir][vector] Add patterns to ppropagate vector distribution
Add patterns to propagate vector distribution and remove dead
arguments. This handles propagation for several vector operations.
recommit after minor bug fix.
Differential Revision: https://reviews.llvm.org/
D127167
Mogball [Tue, 14 Jun 2022 05:04:56 +0000 (05:04 +0000)]
[mlir][ods] Make Attr/Type def accessors match the dialect
The generated attribute and type def accessors are changed to match the setting on the dialect. Most importantly, "prefixed" will now correctly convert snake case to camel case (e.g. `weight_zp` -> `getWeightZp`)
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/
D127688
Sunho Kim [Tue, 14 Jun 2022 05:06:08 +0000 (14:06 +0900)]
[JITLink][ELF][AArch64] Implement R_AARCH64_MOVW_UABS_G*_NC.
Implements R_AARCH64_MOVW_UABS_G*_NC fixup edges. These relocation entries can be generated when code is compiled without a PIC flag. With this patch, clang-repl can printf Hello World with ObjectLinkerLayer on aarch64 linux.
Reviewed By: lhames
Differential Revision: https://reviews.llvm.org/
D127585
Serguei Katkov [Wed, 8 Jun 2022 09:21:01 +0000 (16:21 +0700)]
[Greedy RegAlloc] Fix the handling of split register in last chance re-coloring.
This is a fix for https://github.com/llvm/llvm-project/issues/55827.
When register we are trying to re-color is split the original register (we tried to recover)
has no uses after the split. However in rollback actions we assign back physical register to it.
Later it causes different assertions. One of them is in attached test.
This CL fixes this by avoiding assigning physical register back to register which has no usage
or its live interval now is empty.
Reviewed By: arsenm, qcolombet
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/
D127281
Sunho Kim [Tue, 14 Jun 2022 04:50:47 +0000 (13:50 +0900)]
[JITLink][AArch64] Implement MoveWide16 generic edge.
Implements MoveWide16 generic edge kind that can be used to patch MOVZ/MOVK (imm16) instructions.
Reviewed By: lhames
Differential Revision: https://reviews.llvm.org/
D127584
Nikolas Klauser [Mon, 13 Jun 2022 15:25:23 +0000 (17:25 +0200)]
[libc++][NFC] clang-format <__config>
It's not perfect, but it's a lot better than the status quo.
Reviewed By: ldionne, #libc
Spies: EricWF, aheejin, libcxx-commits, dschuff, krytarowski, fedor.sergeev, mstorsjo, phosek, abrachet
Differential Revision: https://reviews.llvm.org/
D127644
Argyrios Kyrtzidis [Thu, 9 Jun 2022 05:00:58 +0000 (22:00 -0700)]
[Lex] Keep track of skipped preprocessor blocks and advance the lexer directly if they are revisited
This speeds up preprocessing, specifically for preprocessing the clang sources time is reduced by about -36%,
using measurements on M1Pro with a release+thinLTO build.
Differential Revision: https://reviews.llvm.org/
D127379
Kai Luo [Tue, 14 Jun 2022 04:44:20 +0000 (12:44 +0800)]
[PowerPC] Update cfence tests to avoid using undef. NFC.
Mogball [Tue, 14 Jun 2022 04:37:07 +0000 (04:37 +0000)]
[mlir][sparse_tensor] fix windows build
Jacques Pienaar [Tue, 14 Jun 2022 04:30:59 +0000 (21:30 -0700)]
[mlir] Include attributes in ML program dialect ops def
I considered adding a new dialect top-level file with all ops,
attributes & types included, but didn't see practical benefit to it.
Sunho Kim [Tue, 14 Jun 2022 01:58:06 +0000 (10:58 +0900)]
[JITLink][AArch64] Lift fixup functions from aarch64.cpp to aarch64.h. (NFC)
Lift fixup functions from aarch64.cpp to aarch64.h so that they have better chance of getting inlined. Also, adds some comments documenting the purpose of functions.
Reviewed By: sgraenitz
Differential Revision: https://reviews.llvm.org/
D127559
Sunho Kim [Tue, 14 Jun 2022 01:58:05 +0000 (10:58 +0900)]
[JITLink][AArch64] Unify table managers of ELF and MachO.
Unifies GOT/PLT table managers of ELF and MachO on aarch64 architecture. Additionally, it migrates table managers from PerGraphGOTAndPLTStubsBuilder to generic crtp TableManager.
Reviewed By: lhames
Differential Revision: https://reviews.llvm.org/
D127558
Jacques Pienaar [Tue, 14 Jun 2022 04:01:31 +0000 (21:01 -0700)]
[mlir][doc] Move pass to passes list and remove redundant doc
The types are already included in the dialect doc (the attributes is not
properly yet, so retaining).
jacquesguan [Fri, 20 May 2022 06:40:14 +0000 (06:40 +0000)]
[mlir][Arithmetic] Fold NegF in MulF and DivF.
This patch adds the following combination:
mulf(negf(x), negf(y)) -> mulf(x, y)
divf(negf(x), negf(y)) -> divf(x, y)
Differential Revision: https://reviews.llvm.org/
D126044
jacquesguan [Mon, 6 Jun 2022 09:15:36 +0000 (09:15 +0000)]
[mlir][Vector] Support vectorize to vector.reduction or/and.
This patch supports to vectorize affine.for of ori/andi to vector.reduction or/and.
Differential Revision: https://reviews.llvm.org/
D127090
chenglin.bi [Tue, 14 Jun 2022 03:06:10 +0000 (11:06 +0800)]
[InstCombine] Optimize lshr+shl+and conversion pattern
if `C1` and `C3` are pow2 and `Log2(C3) >= C2`:
((C1 >> X) << C2) & C3 -> X == (Log2(C1)+C2-Log2(C3)) ? C3 : 0
https://alive2.llvm.org/ce/z/zvrkKF
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/
D127469
Chenbing Zheng [Tue, 14 Jun 2022 03:02:18 +0000 (11:02 +0800)]
[InstCombine] add tests for compare-signs
Fangrui Song [Tue, 14 Jun 2022 02:52:21 +0000 (19:52 -0700)]
[CodeGen] Initialize ISD after
800d222e53dabfe1e242bd06ab70f58c36e768ed
In the Intrinsic::fptosi_sat branch, ISD was uninitialized when Tys.empty().
Fangrui Song [Tue, 14 Jun 2022 02:44:24 +0000 (19:44 -0700)]
[Driver][test] Make ananas.c and solaris-ld.c robust
`{{.*}}crt{{[^.]+}}.o` may match `"-r" "/tmp/lit-tmp-9ur5crtx/solaris-ld-4fa504.o"`
in a lit invocation.
Peixin-Qiao [Tue, 14 Jun 2022 02:34:38 +0000 (10:34 +0800)]
[flang] Complement one-to-one association check of bind name and entity name
As Fortran 2018 C802 and C873, if bind name is specified, there can only
be only one entity. The check for common block is missed before. As
Fortran 2018 8.5.5 point 2, the bind name is one identifier, which is
unique. That is, one entity can not have multiple bind names. Also add
this check.
Reviewed By: klausler, Jean Perier
Differential Revision: https://reviews.llvm.org/
D126961
Peixin-Qiao [Tue, 14 Jun 2022 02:17:44 +0000 (10:17 +0800)]
[flang] Add semantic check for multiple part-ref with nonzero rank for TBP
As Fortran 2018 C919, there shall not be more than one part-ref with
nonzero rank. Support this semantic check for type-bound procedure to
address the issue https://github.com/llvm/llvm-project/issues/55811.
Reviewed By: klausler
Differential Revision: https://reviews.llvm.org/
D127602
Fangrui Song [Tue, 14 Jun 2022 02:12:13 +0000 (19:12 -0700)]
[sanitizer] Add -lresolv only for non-Android non-musl Linux
Refine the
D127145 logic with my original suggestion.
It turns out that many OSes don't have libresolv.
Jake Egan [Tue, 14 Jun 2022 01:44:58 +0000 (21:44 -0400)]
[libcxx][AIX] Switch build compiler to clang
This patch switches the build compiler for AIX from ibm-clang to clang. ibm-clang++_r has `-pthread` by default, but clang for AIX doesn't, so `-pthread` had to be added to the test config. A bunch of tests now pass, so the `XFAIL` was removed. This patch also switch the build to use the visibility support available in clang-15 to control symbols exported by the shared library (AIX traditionally uses explicit export lists for this purpose).
Reviewed By: #libc, #libc_abi, daltenty, #libunwind, ldionne
Differential Revision: https://reviews.llvm.org/
D127470
Heejin Ahn [Sat, 11 Jun 2022 04:51:16 +0000 (21:51 -0700)]
[InstCombine] Don't slice up PHIs when pred BB has catchswitch
If an integer PHI has an illegal type (according to the data layout) and
it is only used by `trunc` or `trunc(lshr)` operations, we split the PHI
into various instructions in its predecessors:
https://github.com/llvm/llvm-project/blob/
6d1543a16797fa07eecea7e542df5b42422fc721/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp#L1536-L1543
So this can produce code like the following:
Before:
```
pred:
...
bb:
%p = phi i8 [ %somevalue, %pred ], ...
...
%tobool = trunc i8 %p to i1
use %tobool
...
```
In this code, `%p` has an illegal integer type, `i8`, and its only used
in a `trunc` instruction later. In this case this pass puts extraction
code in its predecessors:
After:
```
pred:
...
%t = and i8 %somevalue, 1
%extract = icmp ne i8 %t, 0
bb:
%p.new = phi i1 [ %extract, %pred ], ...
use %p.new instead of %tobool
```
But this doesn't work if `pred` is a `catchswitch` BB because it cannot
have any non-PHI instructions. This CL ensures we bail out in that case.
Fixes https://github.com/llvm/llvm-project/issues/55803.
Reviewed By: dschuff
Differential Revision: https://reviews.llvm.org/
D127699
Ben Shi [Tue, 14 Jun 2022 01:23:05 +0000 (01:23 +0000)]
[Driver] Improve linking options for target AVR
1. Support user specified linker (-fuse-ld)
2. Support user specified linker script (-T)
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/
D126192
Philip Reames [Tue, 14 Jun 2022 01:19:50 +0000 (18:19 -0700)]
[BasicTTI] Remove unused support for multiple opcodes in getTypeBasedIntrinsicInstrCost [nfc]
ISDs only ever contains a single ISD opcode. We can simplify the code under this assumption. The code being removed was added back in 2016 in
0f26b0aeb4a91 to support FMAXNAN/FMINNAN, but at some point since then the motivating case was rewritten not to use the ISDs mechanism. No reason to keep the false generality around now.
Ben Shi [Tue, 14 Jun 2022 01:12:21 +0000 (09:12 +0800)]
Revert "[Driver] Improve linking options for target AVR"
This reverts commit
d7599be9e84fb205b7f50de406dc87858aebc0f4.
Lang Hames [Tue, 14 Jun 2022 00:14:23 +0000 (17:14 -0700)]
[C-API][ORC] Add C API to suspend lookups during definition generation.
Slow definition generators may suspend lookups to temporarily release the
session lock, allowing unrelated lookups to proceed.
Using this functionality is discouraged: it is best to make definition
generation fast, rather than suspending the lookup. As a last resort where
this is not possible, suspension may be used.
Kazu Hirata [Tue, 14 Jun 2022 00:10:23 +0000 (17:10 -0700)]
[CodeGen] Remove futureWeight (NFC)
The last use was removed on Jun 5, 2022 in
commit
5c06f7168fd1bd589b831cacd5f1cb8a928446fb, which itself was
a patch to remove unused code.
Ben Shi [Mon, 23 May 2022 10:22:51 +0000 (10:22 +0000)]
[Driver] Improve linking options for target AVR
1. Support linking with lld
2. Support user specifed linker script
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/
D126192
Lang Hames [Mon, 13 Jun 2022 23:30:24 +0000 (16:30 -0700)]
[C-API][ORC] Add LLVMOrcExecutionSessionLookup -- generic async symbol lookup.
An API to wrap ExecutionSession::lookup, this allows C API clients to use async
lookup.
The immediate motivation for adding this is to simplify upcoming
definition-generator unit tests.
As we're adding more tests that need to convert between C and C++ flag values
this commit adds helper functions to support this. This patch also updates the
CAPIDefinitionGenerator to use these new utilities.
Peter Klausler [Wed, 8 Jun 2022 22:23:56 +0000 (15:23 -0700)]
[flang][runtime] Skip remainder of bad input record even with ADVANCE='NO'
After a recoverable error condition in a READ statement with ADVANCE='NO',
skip the remainder of the current record.
Differential Revision: https://reviews.llvm.org/
D127433
V Donaldson [Mon, 13 Jun 2022 22:16:07 +0000 (15:16 -0700)]
[flang] Intrinsic module procedure pure prefixes
Per 7.11.1p1 - All [ieee_arithmetic and ieee_exceptions] functions are
pure and all the subroutines are impure unless otherwise stated. Most of
these functions are elemental (and not impure), which implies pure.
Several of the remaining non-elemental functions are missing pure prefixes;
add them.
Peter Klausler [Wed, 8 Jun 2022 21:52:01 +0000 (14:52 -0700)]
[flang][runtime] Don't loop in runtime if blank appears in BOZ input
The code for scanning BOZ input allows for blanks and tabs to appear,
but can hang if they do and the BOZ input value is not followed by
extra valid digits; the repositioning for the second sweep simply
needed to be done in units of character, not valid digits.
Differential Revision: https://reviews.llvm.org/
D127431
Peter Klausler [Wed, 8 Jun 2022 21:11:07 +0000 (14:11 -0700)]
[flang] Handle USE association in parse tree rewriting
f18 was treating "f() = 1" as a statement function definition
if it could be viewed as being in the specification part and
"f" was a USE-associated function returning a data pointer.
(The non-USE-associated case is fine.) Fix to allow for "f"
to be USE associated.
Differential Revision: https://reviews.llvm.org/
D127430
Peter Klausler [Wed, 8 Jun 2022 20:50:43 +0000 (13:50 -0700)]
[flang] Fix crash on USE error
Handle the case of a non-generic procedure that is USE associated
into a scope that has a generic interface of the same name with an
appropriate error rather than crashing.
Differential Revision: https://reviews.llvm.org/
D127429
Peter Klausler [Wed, 8 Jun 2022 19:44:12 +0000 (12:44 -0700)]
[flang][runtime] Detect overflow of fixed-sized exponent output field
When Ew.dEe or Gw.dEe output has an exponent requiring more than 'e'
digits, the whole output field must overflow to asterisks. The runtime
was detecting short fields and padding them with zeroes, but not
overflow.
Differential Revision: https://reviews.llvm.org/
D127428
Peter Klausler [Thu, 9 Jun 2022 18:39:18 +0000 (11:39 -0700)]
[flang][runtime] Fix overflow detection for REAL input
The test for an overflow during decimal->binary conversion was taking
place too late, causing the data not to be rescanned from the beginning.
Differential Revision: https://reviews.llvm.org/
D127427
Peter Klausler [Wed, 8 Jun 2022 17:42:40 +0000 (10:42 -0700)]
[flang][runtime] Don't emit any leading blanks for G0/E0 output editing
There were cases where E0.d output editing (or G0.d editing that is converted
to E0.d) would emit one or more leading blank characters; fix them.
Differential Revision: https://reviews.llvm.org/
D127426
Craig Topper [Mon, 13 Jun 2022 22:28:29 +0000 (15:28 -0700)]
[RISCV] Fix use of texternalsym in output pattern where input was tglobaladdr. NFC
I don't think the name used in the output pattern is used to control
anything about the isel table emission, but it should match the input.
Mogball [Mon, 13 Jun 2022 22:35:51 +0000 (22:35 +0000)]
[mlir] Fix CMake file
Benjamin Kramer [Mon, 13 Jun 2022 22:23:17 +0000 (00:23 +0200)]
[bazel] Unbreak the build after
cf6a7c194793
Mogball [Mon, 13 Jun 2022 22:02:02 +0000 (22:02 +0000)]
[mlir] Support getSuccessorInputs from parent op
Ops that implement `RegionBranchOpInterface` are allowed to indicate that they can branch back to themselves in `getSuccessorRegions`, but there is no API that allows them to specify the forwarded operands. This patch enables that by changing `getSuccessorEntryOperands` to accept `None`.
Fixes #54928
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/
D127239
Florian Hahn [Mon, 13 Jun 2022 21:57:53 +0000 (22:57 +0100)]
[ConstraintElimination] Add tests with cmps with constant ops only.
Add extra test coverage for conditions with constant ops.
Stanislav Mekhanoshin [Fri, 10 Jun 2022 19:13:40 +0000 (12:13 -0700)]
[AMDGPU] Use null for dead sdst operand
Differential Revision: https://reviews.llvm.org/
D127542
Amir Ayupov [Mon, 13 Jun 2022 21:26:14 +0000 (14:26 -0700)]
[BOLT][NFC] Pass Function to BC.printInstructions in BinaryBasicBlock::dump
BC::printInstruction(s) has many uses of Function ptr if it's available:
# printing CFI instructions (unconditional)
# printing debug line information (-print-debug-info)
# printing instruction relocations (-print-relocations)
Enable these uses by passing Function ptr from the primary printing entry point:
BinaryBasicBlock::dump.
Reviewed By: maksfb
Differential Revision: https://reviews.llvm.org/
D126916
Kazu Hirata [Mon, 13 Jun 2022 21:26:20 +0000 (14:26 -0700)]
[Analysis] Remove getUniqueInstruction (NFC)
The last use was removed on Apr 7, 2022 in commit
5cefe7d9f531fe6eac4cd22978861752498b2265.
Mitch Phillips [Mon, 13 Jun 2022 21:22:43 +0000 (14:22 -0700)]
Fix-forward broken ASan test on Windows.
Hopefully the final whack-a-mole.
Relevant differential revision: https://reviews.llvm.org/
D126929
Florian Hahn [Mon, 13 Jun 2022 21:20:58 +0000 (22:20 +0100)]
[LV] Replace OrigPHIsToFix in native with VPlan traversal. (NFC)
OrigPHIsToFix is only used in the native path. Collecting phis can be
replaced by iterating over the plan. This also removes another
unnecessary use of a late getVPValue.
This also reduces the coupling between ILV and the VPlan utilities.
Alex Brachet [Mon, 13 Jun 2022 21:06:27 +0000 (21:06 +0000)]
[libc] Add explicit casts for string functions
This fixes warnings from `-Wimplicit-int-conversion`
Differential revision: https://reviews.llvm.org/
D127694
Peter Collingbourne [Mon, 13 Jun 2022 21:02:58 +0000 (14:02 -0700)]
Revert "gn build: Add support for building the standalone ubsan runtime."
As well as followup commits.
Build is still failing on mac. I'll debug it locally.
http://45.33.8.238/macm1/37269/step_4.txt
This reverts commit
ee21411107aa18e191a25380b9e4679f3909a0c7.
This reverts commit
6ef9af6386fe7cd9d5d93342c430528baa8d1026.
This reverts commit
b49bd8e07faf0f4d04e6cdfe33d901a2cd8b2346.
Alex Brachet [Mon, 13 Jun 2022 21:03:51 +0000 (21:03 +0000)]
[libc] Add Fuchsia implementation of ::testing::Test
Hubert Tong [Mon, 13 Jun 2022 02:36:32 +0000 (22:36 -0400)]
[NFC] Undo AIX build compiler workaround
Removes the workaround from https://reviews.llvm.org/D98509#
2732628 for
an AIX build compiler issue.
The AIX build compiler product that caused the issue has since been
fixed. Also, the AIX build compiler has been changed to one based on
LLVM.
Peter Collingbourne [Mon, 13 Jun 2022 20:52:27 +0000 (13:52 -0700)]
gn build: Don't define an action for gen_version_script on mac/win.
Nothing should depend on the action on those platforms,
as they don't use version scripts.
Should fix mac build:
http://45.33.8.238/macm1/37264/step_4.txt
Lang Hames [Mon, 13 Jun 2022 20:48:00 +0000 (13:48 -0700)]
[C-API][ORC] Add missing error check to unit test.