Mogball [Mon, 13 Jun 2022 21:54:52 +0000 (21:54 +0000)]
[mlir] Add a generic data-flow analysis framework
This patch introduces a generic data-flow analysis framework to MLIR. The framework implements a fixed-point iteration algorithm and a dependency graph between lattice states and analysis. Lattice states and points are fully extensible to support highly-customizable analyses.
Reviewed By: phisiart, rriddle
Differential Revision: https://reviews.llvm.org/
D126751
Danila Malyutin [Tue, 14 Jun 2022 14:32:15 +0000 (17:32 +0300)]
freeze does not change the constant property
Traverse through freeze when checking if base is constant
Differential Revision: https://reviews.llvm.org/
D127744
Stefan Pintilie [Tue, 14 Jun 2022 14:27:03 +0000 (09:27 -0500)]
[PowerPC] Fix combine step for shufflevector.
The combine step for shufflevector will sometimes replace undef in the mask
with a defined value. This can cause an infinite loop in some cases as another
combine will then put the undef back in the mask.
This patch fixes the issue so that undefs are not replaced when doing a combine.
Reviewed By: ZarkoCA, amyk, quinnp, saghir
Differential Revision: https://reviews.llvm.org/
D127439
Benjamin Kramer [Mon, 13 Jun 2022 20:03:56 +0000 (22:03 +0200)]
[mlir][linalg] Add named ops for depthwise 3d convolution
Also complete the set by adding a variant of depthwise 1d convolution
with the multiplier != 1.
Differential Revision: https://reviews.llvm.org/
D127687
Matheus Izvekov [Sun, 29 May 2022 23:22:23 +0000 (01:22 +0200)]
[clang] AST/Print: honor AlwaysIncludeTypeForTemplateArgument policy
This redoes
D103040 in a way that `AlwaysIncludeTypeForTemplateArgument = false`
policy is honored for printing template specialization types.
This can be seen for example when printing a canonicalized
dependent TemplateSpecializationType which has integral arguments.
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Reviewed By: v.g.vassilev
Differential Revision: https://reviews.llvm.org/
D126620
Jay Foad [Tue, 14 Jun 2022 16:00:13 +0000 (17:00 +0100)]
[AMDGPU] Regenerate MIR checks for image instructions
Alex Zinenko [Tue, 14 Jun 2022 16:04:00 +0000 (18:04 +0200)]
[mlir] fix compiler error due to commit landing race
Alex Zinenko [Tue, 14 Jun 2022 15:49:47 +0000 (17:49 +0200)]
[mlir] Introduce transform.alternatives op
Introduce a transform dialect op that allows one to attempt different
transformation sequences on the same piece of payload IR until one of them
succeeds. This op fundamentally expands the scope of possibilities in the
transform dialect that, until now, could only propagate transformation failure,
at least using in-tree operations. This requires a more detailed specification
of the execution model for the transform dialect that now indicates how failure
is handled and propagated.
Transformations described by transform operations now have tri-state results,
with some errors being fundamentally irrecoverable (e.g., generating malformed
IR) and some others being recoverable by containing ops. Existing transform ops
directly implementing the `apply` interface method are updated to produce this
directly. Transform ops with the `TransformEachTransformOpTrait` are currently
considered to produce only irrecoverable failures and will be updated
separately.
Reviewed By: springerm
Differential Revision: https://reviews.llvm.org/
D127724
Sanjay Patel [Mon, 13 Jun 2022 17:38:46 +0000 (13:38 -0400)]
[InstCombine] add tests for sub with extended operands; NFC
Jin Xin Ng [Tue, 14 Jun 2022 14:52:36 +0000 (07:52 -0700)]
[inliner] Add per-SCC-pass InlineAdvisor printing option
Adds option to print the contents of the Inline Advisor after each SCC Inliner pass
Reviewed By: mtrofin
Differential Revision: https://reviews.llvm.org/
D127689
Alex Brachet [Tue, 14 Jun 2022 15:05:16 +0000 (15:05 +0000)]
[libc] Guard common macro names
Differential revision: https://reviews.llvm.org/
D127692
Serge Pavlov [Tue, 14 Jun 2022 05:25:35 +0000 (12:25 +0700)]
[NFC] Remove unused function parameter
Philip Reames [Tue, 14 Jun 2022 14:45:40 +0000 (07:45 -0700)]
[RISCV] simplify emitVSETVLIs handling of vsetvli xN, phi(), vtype case [NFC]
This is possibly somewhat subjective, but having an explicitly named flag to track the property required and code structure that more closely matches phase 1/2 of the dataflow seems much easier to read.
Differential Revision: https://reviews.llvm.org/
D126893
Shivam Gupta [Tue, 14 Jun 2022 12:29:13 +0000 (17:59 +0530)]
[Diagnostics] Fix inconsistent shift-overflow warnings in C++20
This fixes https://github.com/llvm/llvm-project/issues/52873.
Don't warn in C++2A mode (and newer), as signed left shifts
always wrap and never overflow. Ref. -
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1236r1.html.
Joseph Huber [Fri, 10 Jun 2022 16:30:19 +0000 (12:30 -0400)]
[Libomptarget] Add test config for compiling in LTO-mode
We are planning on making LTO the default compilation mode for
offloading. In order to make sure it works we should run these tests on
the test suite. AMDGPU already uses the LTO compilation path for its
linking, but in LTO mode it also links the static library late.
Performing LTO requires the static library to be built, if we make the
change this will be a hard requirement and the old bitcode library will
go away. This means users will need to use either a two-step build or a
runtimes build for libomptarget.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/
D127512
Valentin Clement [Tue, 14 Jun 2022 13:57:24 +0000 (15:57 +0200)]
[flang] Avoid losing type parameter information
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/
D127738
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
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