Louis Dionne [Mon, 19 Sep 2022 19:38:18 +0000 (15:38 -0400)]
[libc++] Use XXYYZZ instead of XXYZZ for _LIBCPP_VERSION
As discussed on Discord.
Differential Revision: https://reviews.llvm.org/D134209
jeff [Mon, 26 Sep 2022 15:09:24 +0000 (15:09 +0000)]
[AMDGPU] Precommit switching test to generated checks for D134463
Change-Id: I6ed91aacf6856ef535a54284d48e937db33be1a3
Jakub Kuderski [Mon, 26 Sep 2022 14:58:13 +0000 (10:58 -0400)]
[mlir][spirv] Change dialect name from 'spv' to 'spirv'
Tested with `check-mlir` and `check-mlir-integration`.
Issue: https://github.com/llvm/llvm-project/issues/56863
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D134620
Amaury Séchet [Mon, 26 Sep 2022 14:25:53 +0000 (14:25 +0000)]
Autogenerate stack-folding-fp X86 tests. NFC
Erich Keane [Mon, 26 Sep 2022 13:55:25 +0000 (06:55 -0700)]
Revert "[Concepts] Recover properly from a RecoveryExpr in a concept"
This reverts commit
e3d14bee238b672a7a112311eefee55e142eaefc.
There are apparently a large number of crashes in libcxx and some JSON
Parser thing, so clearly this has some sort of serious issue. Reverting
so I can take some time to figure out what is going on.
Louis Dionne [Mon, 26 Sep 2022 13:45:14 +0000 (09:45 -0400)]
[libc++] Add release note about unary_function and binary_function being removed in >= C++17
Amaury Séchet [Mon, 26 Sep 2022 13:36:01 +0000 (13:36 +0000)]
Small formating nit in DAGCombiner. NFC
Erich Keane [Fri, 23 Sep 2022 15:03:41 +0000 (08:03 -0700)]
[Concepts] Recover properly from a RecoveryExpr in a concept
Discovered by reducing a different problem, we currently assert because
we failed to make the constraint expressions not dependent, since a
RecoveryExpr cannot be transformed.
This patch fixes that, and gets reasonably nice diagnostics by
introducing a concept (hah!) of "ContainsErrors" to the Satisfaction
types, which causes us to treat the candidate as non-viable.
However, just making THAT candidate non-viable would result in choosing
the 'next best' canddiate, which can result in awkward errors, where we
start evaluating a candidate that is not intended to be selected.
Because of this, and to make diagnostics more relevant, we now just
cause the entire lookup to result in a 'no-viable-candidates'.
This means we will only emit the list of candidates, rather than any
cascading failures.
Christian Sigg [Wed, 21 Sep 2022 13:22:58 +0000 (15:22 +0200)]
[Bazel] Remove template_rule and use @bazel_skylib's expand_template instead.
Reviewed By: GMNGeoffrey
Differential Revision: https://reviews.llvm.org/D134347
Florian Hahn [Mon, 26 Sep 2022 13:25:36 +0000 (14:25 +0100)]
[LoopUnroll] Add cache verification failure test case.
Test case for D134612.
Jean Perier [Mon, 26 Sep 2022 13:09:30 +0000 (15:09 +0200)]
[flang] Lowers calls to procedure with CONTIGUOUS assumed shape dummies
Copy-in/copy-out was not triggered when calling a procedure with a
CONTIGUOUS assumed shape. The actual argument must be copied-in/out
if it is not contiguous.
The copy-in/copy-out takes care of argument optionality, and uses a
runtime check in order to only do the copy if the actual is not
contiguous at runtime.
This was already implemented for explicit shape dummy arguments. This
patch takes advantage of this implementation to deal with the copy-in
copy-out aspects. It only need add code to deals with wrapping the
created bare contiguous address into a fir.box (runtime descriptor),
taking care of the optional box aspects.
Using this existing code is only possible for actual argument that can
be passed via a bare address. Add a TODO for polymorphic entity, PDTs
and assumed rank where the existing copy-in/copy-out code may fail
(these copies are more complex) and that cannot be tested currently.
Differential Revision: https://reviews.llvm.org/D134543
Kazushi (Jam) Marukawa [Sat, 24 Sep 2022 20:31:28 +0000 (05:31 +0900)]
[VE] Disable automatic maxnum/minnum selection
Disable FMAX/FMIN selection from select_cc in VEInstrInfo.td because of
the lack of NaN consideration. This patch removes such selection from
VEInstrInfo.td and lets llvm work on it in combineMinNumMaxNum.
Reviewed By: efocht
Differential Revision: https://reviews.llvm.org/D134595
Nikita Popov [Mon, 26 Sep 2022 13:02:50 +0000 (15:02 +0200)]
[MustExecute] Add additional test for PR57780 (NFC)
Kazushi (Jam) Marukawa [Sat, 24 Sep 2022 05:51:07 +0000 (14:51 +0900)]
[VE] Support smax/smin
Support smax/smin in VEInstrInfo.td. Remove obsolete patterns for
smax/smin. Add regression tests for smax/smin/umax/umin.
Reviewed By: efocht
Differential Revision: https://reviews.llvm.org/D134583
Guillaume Chatelet [Mon, 26 Sep 2022 12:57:21 +0000 (12:57 +0000)]
[libc][NFC] Move bzero_inline to separate file
This allows for easier discovery.
Guillaume Chatelet [Mon, 26 Sep 2022 12:42:38 +0000 (12:42 +0000)]
[libc][NFC] Remove new framework, a simpler one is coming
Guillaume Chatelet [Mon, 26 Sep 2022 12:33:01 +0000 (12:33 +0000)]
[libc][NFC] introduce inline_bzero
Aaron Ballman [Mon, 26 Sep 2022 12:20:27 +0000 (08:20 -0400)]
Update the status of a few more C99 DRs
Florian Hahn [Mon, 26 Sep 2022 11:21:13 +0000 (12:21 +0100)]
[LoopDistribute] Add LAA invalidation test for #50940.
Test case for #50940, to be fixed by D134606.
Oleg Shyshkov [Mon, 26 Sep 2022 10:33:08 +0000 (10:33 +0000)]
[mlir] Add IteratorType enum to StructuredOpsUtils.
Summary:
Use the new enum in TilingIterface and verify that `iterator_type` attribute in
LinalgOp interface is compatible with the enum values. Later IteratorType enum
will be used in LinalgInterface to replace the current `iterator_type` attribute
array of string.
Existing enums in Linalg are moved into a separate td file and tablegen build
target. This is necessary, have one I32EnumAttr in a shared space that generated
enum class definition and EnumAttrs is dialect-specific location. Otherwise
there might be a conflict that I32EnumAttr generates enum definitions in
multiple places.
Differential Revision: https://reviews.llvm.org/D134634
David Spickett [Fri, 23 Sep 2022 14:28:36 +0000 (14:28 +0000)]
[LLDB] Add an llvm::Optional version of GetRegisterInfo
We have some 500 ish uses of the bool plus ref version
so changing them all at once isn't a great idea.
This adds an overload that doesn't take a RegisterInfo&
and returns an optional.
Once I'm done switching all the existing callers I'll
remove the original function.
Benefits of optional over bool plus ref:
* The intent of the function is clear from the prototype.
* It's harder to forget to check if the return is valid,
and if you do you'll get an assert.
* You don't hide ununsed variables, which happens because
passing by ref marks a variable used.
* You can't forget to reset the RegisterInfo in between
calls.
Reviewed By: clayborg
Differential Revision: https://reviews.llvm.org/D134536
Momchil Velikov [Mon, 26 Sep 2022 10:30:31 +0000 (11:30 +0100)]
[ARM] Enable and/cmp0 folding
The `CodeGenPrepare` pass can sink bitwise `and` used by compare to
zero into the basic blocks where the users are. This operation is
guarded by lowering hook, which is disabled for ARM. In the ARM
architecture versions from v7-M up these two operations can be folded
into `tst rN, #imm` instruction. Sinking of `and` can also enable
the cmov-to-bfi DAG combiner.
This patch fixes some benchmark regressions caused
by https://reviews.llvm.org/D129370 as well scoring slightly better overall.
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D134360
Momchil Velikov [Mon, 26 Sep 2022 09:56:39 +0000 (10:56 +0100)]
[ARM] Enable and/cmp0 folding - precommit test
Precommit test for D134360
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D134358
Tomasz Kamiński [Mon, 26 Sep 2022 09:17:41 +0000 (11:17 +0200)]
[analyzer] Pass correct bldrCtx to computeObjectUnderConstruction
In case when the prvalue is returned from the function (kind is one
of `SimpleReturnedValueKind`, `CXX17ElidedCopyReturnedValueKind`),
then it construction happens in context of the caller.
We pass `BldrCtx` explicitly, as `currBldrCtx` will always refer to callee
context.
In the following example:
```
struct Result {int value; };
Result create() { return Result{10}; }
int accessValue(Result r) { return r.value; }
void test() {
for (int i = 0; i < 2; ++i)
accessValue(create());
}
```
In case when the returned object was constructed directly into the
argument to a function call `accessValue(create())`, this led to
inappropriate value of `blockCount` being used to locate parameter region,
and as a consequence resulting object (from `create()`) was constructed
into a different region, that was later read by inlined invocation of
outer function (`accessValue`).
This manifests itself only in case when calling block is visited more
than once (loop in above example), as otherwise there is no difference
in `blockCount` value between callee and caller context.
This happens only in case when copy elision is disabled (before C++17).
Reviewed By: NoQ
Differential Revision: https://reviews.llvm.org/D132030
Simon Pilgrim [Mon, 26 Sep 2022 09:27:38 +0000 (10:27 +0100)]
Fix MSVC "not all control paths return a value" warning. NFCI.
David Green [Mon, 26 Sep 2022 08:55:10 +0000 (09:55 +0100)]
[AArch64] Enable FeatureFuseAdrpAdd for all Arm cpus
The commit D120104 enabled FeatureFuseAdrpAdd for -mcpu=generic,
allowing the linker to relax adrp;add pairs where possible. D132075
extended that to neoverse-n1, this patch extends it to all other cortex
and neoverse cpus for the same reasons.
Differential Revision: https://reviews.llvm.org/D134521
Jonas Toth [Sun, 25 Sep 2022 17:26:32 +0000 (19:26 +0200)]
[clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated
'misc-const-correctness' previously considered arrays as 'Values' independent of the type of the elements.
This is inconsistent with the configuration of the check to disable treating pointers as values.
This patch rectifies this inconsistency.
Fixes #56749
Reviewed By: njames93
Differential Revision: https://reviews.llvm.org/D130793
Adrian Kuegel [Mon, 26 Sep 2022 08:31:10 +0000 (10:31 +0200)]
[mlir] Apply ClangTidyLegacy finding.
Prefer using 'override' instead of 'virtual'.
Adrian Kuegel [Mon, 26 Sep 2022 08:26:51 +0000 (10:26 +0200)]
[mlir] Fix typo in parameter name annotation.
Found by ClangTidy.
Adrian Kuegel [Mon, 26 Sep 2022 08:09:02 +0000 (10:09 +0200)]
Revert "[mlir][Bazel] Port
730ae80d3e1c47f93f725acb2d37f06fcba06953"
This reverts commit
ec8f08ce08c26f6db61b142ba40590c3c1d158a0.
The change that needed this BUILD fix was reverted.
Martin Storsjö [Fri, 16 Sep 2022 13:13:12 +0000 (16:13 +0300)]
[lldb] Fix CommandInterpreter::DidProcessStopAbnormally() with multiple threads
If a process has multiple threads, the thread with the stop
info might not be the first one in the thread list.
On Windows, under certain circumstances, processes seem to have
one or more extra threads that haven't been launched by the
executable itself, waiting in NtWaitForWorkViaWorkerFactory. If the
main (stopped) thread isn't the first one in the list (the order
seems nondeterministic), DidProcessStopAbnormally() would return
false prematurely, instead of inspecting later threads.
The main observable effect of DidProcessStopAbnormally() erroneously
returning false, is when running lldb with multiple "-o" parameters
to specify multiple commands to execute on the command line.
After an abnormal stop, lldb would stop executing "-o" parameters
and execute "-k" parameters instead - but due to this issue, it
would instead keep executing "-o" parameters as if there was no
abnormal stop. (If multiple parameters are specified via a script
file via the "-s" option, all of the commands in that file are
executed regardless of whether there's an abnormal stop inbetween.)
Differential Revision: https://reviews.llvm.org/D134037
Alvin Wong [Mon, 26 Sep 2022 07:41:17 +0000 (10:41 +0300)]
[llvm-readobj][COFF] Print forwarder export symbols correctly
Reviewed By: mstorsjo
Differential Revision: https://reviews.llvm.org/D134528
Alvin Wong [Mon, 26 Sep 2022 07:40:51 +0000 (10:40 +0300)]
[LLD][COFF] Fix absolute & synthetic symbols in COFF symbol table
Absolute symbol should contain its absolute value, but LLD had been
writing its RVA instead. Write its VA instead.
DefinedSynthetic were being skipped before with the reasoning "Relative
symbols are unrepresentable in a COFF symbol table", which is only true
if the RVA points to outside of a section. LLD does create synthetic
symbols which points to actual data chunks (typical for symbols embedded
into the load config directory). Write these symbols to the COFF symbol
table too.
Reviewed By: mstorsjo
Differential Revision: https://reviews.llvm.org/D134462
Adrian Kuegel [Mon, 26 Sep 2022 08:04:56 +0000 (10:04 +0200)]
Revert "[mlir][Bazel] Port
730ae80d3e1c47f93f725acb2d37f06fcba06953 part 2."
This reverts commit
b4cc363e86e7506e41560af333b12beefd9f4bbd.
The change which needed this BUILD fix was reverted.
Lorenzo Chelini [Mon, 26 Sep 2022 08:01:23 +0000 (10:01 +0200)]
Revert "[MLIR] Expose `getAsValues` in `StaticValueUtils.h` (NFC)"
This reverts commit
730ae80d3e1c47f93f725acb2d37f06fcba06953.
It fails with a linking errors: `undefined reference to
`mlir::getValueOrCreateConstantIndexOp` in `libMLIRDialectUtils`.
Michele Scuttari [Sun, 25 Sep 2022 19:52:18 +0000 (21:52 +0200)]
[MLIR] Migrate MemRef -> LLVM conversion pass to the auto-generated constructor
See #57475
Differential Revision: https://reviews.llvm.org/D134607
Adrian Kuegel [Mon, 26 Sep 2022 07:51:22 +0000 (09:51 +0200)]
Adrian Kuegel [Mon, 26 Sep 2022 07:45:24 +0000 (09:45 +0200)]
Adrian Kuegel [Mon, 26 Sep 2022 07:37:32 +0000 (09:37 +0200)]
Lorenzo Chelini [Sun, 25 Sep 2022 14:32:13 +0000 (16:32 +0200)]
[MLIR] Expose `getAsValues` in `StaticValueUtils.h` (NFC)
The utility function should live in `StaticValueUtils.h` as it provides
a convenient way to convert a vector of OpFoldResults into a vector of
Values.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D134451
jacquesguan [Tue, 20 Sep 2022 07:22:15 +0000 (15:22 +0800)]
[mlir][Arithmetic] Support commutative canonicalization for continuous XOrIOp.
This patch adds commutative canonicalization support for D116383.
Reviewed By: Mogball
Differential Revision: https://reviews.llvm.org/D134258
Kazu Hirata [Mon, 26 Sep 2022 06:21:40 +0000 (23:21 -0700)]
[Analysis] Introduce getStaticBonusApplied (NFC)
InlineCostCallAnalyzer encourages inlining of the last call to the
static function by subtracting LastCallToStaticBonus from Cost.
This patch introduces getStaticBonusApplied to make available the
amount of LastCallToStaticBonus applied.
The intent is to allow the module inliner to determine whether
inlining a given call site is expected to reduce the caller size with
an expression like:
IC.getCost() + IC.getStaticBonusApplied() < 0
This patch does not add a use of getStaticBonus yet.
Differential Revision: https://reviews.llvm.org/D134373
Kazu Hirata [Mon, 26 Sep 2022 06:14:15 +0000 (23:14 -0700)]
[llvm] Use std::underlying_type_t (NFC)
Kazu Hirata [Mon, 26 Sep 2022 06:14:13 +0000 (23:14 -0700)]
[ADT] Use std::conditional_t (NFC)
gonglingqin [Mon, 26 Sep 2022 04:09:13 +0000 (12:09 +0800)]
[LoongArch] Add codegen support for strict_fsetccs and any_fsetcc
Differential Revision: https://reviews.llvm.org/D134274
Lang Hames [Mon, 26 Sep 2022 05:02:15 +0000 (22:02 -0700)]
[ORC] Update LinkGraph unit tests for API change in
75404e9ef88.
Danil Sidoruk [Mon, 26 Sep 2022 04:07:18 +0000 (21:07 -0700)]
[clang-format] Handle constructor invocations after new operator in C# correct
Fixes #56549.
Differential Revision: https://reviews.llvm.org/D129926
Lang Hames [Mon, 26 Sep 2022 02:25:13 +0000 (19:25 -0700)]
[JITLink] Introduce new weakly-referenced concept separate from linkage.
Introduces two new methods on Symbol: isWeaklyReferenced and
setWeaklyReferenced. These are now used to track/set whether an external symbol
is weakly referenced, rather than having the Symbol's linkage set to weak.
This change is a first step towards proper handling of weak defs used across
JITDylib boundaries: It frees up the Linkage field on external symbols so that
it can be used to represent the linkage of the definition that the symbol resolves
to. It is expected that Platform plugins will use this information to track
locations that need to be updated if the selected weak definition changes (e.g.
because JITDylibs were dlclosed and then dlopened again in a different order).
wanglei [Mon, 26 Sep 2022 02:22:58 +0000 (10:22 +0800)]
[LoongArch] Lower BlockAddress/JumpTable
This patch uses a unified interface for lower GlobalAddress ConstantPool
BlockAddress and JumpTable.
This patch allows lowering addresses by using PC-relative addressing
for DSO-local symbols, and accessing the address through the global
offset table for DSO-preemptable symbols.
Remove hardcoded `MininumJumpTableEntries` for test lower JumpTable.
Also updated some test cases using ConstantPool, due to the addition of
relocation information.
Differential Revision: https://reviews.llvm.org/D134431
Sam McCall [Mon, 19 Sep 2022 23:39:49 +0000 (01:39 +0200)]
Don't crash when code completing `using enum ^Foo`.
Fixes https://github.com/clangd/clangd/issues/1281
Differential Revision: https://reviews.llvm.org/D134243
Yeting Kuo [Mon, 12 Sep 2022 12:57:39 +0000 (20:57 +0800)]
[VP][RISCV] Add vp.sqrt intrinsic and RISC-V support.
The patch modeled vp.fabs patch D132793.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D133690
WANG Xuerui [Mon, 26 Sep 2022 02:18:46 +0000 (10:18 +0800)]
[LoongArch] Support 'generic' as a valid CPU name
As the LoongArch port is largely modeled after RISCV it has the same
behavior of not accepting `generic` as a CPU name. For better
compatibility with consumers of LLVM (e.g. mesa) follow D121149's suit
and treat `generic` the same as an empty CPU name.
Differential Revision: https://reviews.llvm.org/D134412
Ruiling Song [Mon, 26 Sep 2022 02:14:09 +0000 (10:14 +0800)]
Add override for runOnFunction()
Fix build-bot failure.
Sam McCall [Mon, 26 Sep 2022 02:17:27 +0000 (04:17 +0200)]
[clangd] Make go-to-type work on member function calls
WANG Xuerui [Mon, 26 Sep 2022 01:59:52 +0000 (09:59 +0800)]
[LoongArch] Support fastcc and treat it as ccc
As explained in D68559 the `fastcc` calling convention may be requested
under certain conditions, hence the need for supporting it. But unlike
RISCV we actually treat it exactly like ccc, without actually inventing
any performance hack right here. And CSKY does the same thing.
This is going to fix a few more test cases with native LoongArch builds.
Differential Revision: https://reviews.llvm.org/D134443
LLVM GN Syncbot [Mon, 26 Sep 2022 02:02:19 +0000 (02:02 +0000)]
[gn build] Port
cf14c7caacfc
WANG Xuerui [Mon, 26 Sep 2022 01:55:21 +0000 (09:55 +0800)]
[LoongArch] Support llvm.thread.pointer
For `__builtin_thread_pointer` to work, among other things.
Similar to D76828 for RISCV.
Differential Revision: https://reviews.llvm.org/D134368
Ruiling Song [Tue, 23 Aug 2022 03:39:17 +0000 (11:39 +0800)]
StructurizeCFG: Set Undef for non-predecessors in setPhiValues()
During structurization process, we may place non-predecessor blocks
between the predecessors of a block in the structurized CFG. Take
the typical while-break case as an example:
```
/---A(v=...)
| / \
^ B C
| \ /|
\---L |
\ /
E (r = phi (v:C)...)
```
After structurization, the CFG would be look like:
```
/---A
| |\
| | C
| |/
| F1
^ |\
| | B
| |/
| F2
| |\
| | L
\ |/
\--F3
|
E
```
We can see that block B is placed between the predecessors(C/L) of E.
During phi reconstruction, to achieve the same sematics as before, we
are reconstructing the PHIs as:
F1: v1 = phi (v:C), (undef:A)
F3: r = phi (v1:F2), ...
But this is also saying that `v1` would be live through B, which is not
quite necessary. The idea in the change is to say the incoming value
from B is Undef for the PHI in E. With this change, the reconstructed
PHI would be:
F1: v1 = phi (v:C), (undef:A)
F2: v2 = phi (v1:F1), (undef:B)
F3: r = phi (v2:F2), ...
Reviewed by: sameerds
Differential Revision: https://reviews.llvm.org/D132450
Ruiling Song [Mon, 22 Aug 2022 09:45:42 +0000 (17:45 +0800)]
StructurizeCFG: prefer reduced number of live values
The instruction simplification will try to simplify the affected phis.
In some cases, this might extend the liveness of values. For example:
BB0:
| \
| BB1
| /
BB2:phi (BB0, v), (BB1, undef)
The phi in BB2 will be simplified to v as v dominates BB2, but this is
increasing the number of active values in BB1. By setting CanUseUndef
to false, we will not simplify the phi in this way, this would help
register pressure. This is mandatory for the later change to help
reducing VGPR pressure for AMDGPU.
Reviewed by: foad, sameerds
Differential Revision: https://reviews.llvm.org/D132449
Ruiling Song [Tue, 23 Aug 2022 02:15:20 +0000 (10:15 +0800)]
AMDGPU: Add a test to show how later optimization works
Differential Revision: https://reviews.llvm.org/D132448
Ruiling Song [Tue, 13 Sep 2022 06:56:09 +0000 (14:56 +0800)]
AMDGPU: Add a pass to rewrite certain undef in PHI
For the pattern of IR (%if terminates with a divergent branch.),
divergence analysis will report %phi as uniform to help optimal code
generation.
```
%if
| \
| %then
| /
%endif: %phi = phi [ %uniform, %if ], [ %undef, %then ]
```
In the backend, %phi and %uniform will be assigned a scalar register.
But the %undef from %then will make the scalar register dead in %then.
This will likely cause the register being over-written in %then. To fix
the issue, we will rewrite %undef as %uniform. For details, please refer
the comment in AMDGPURewriteUndefForPHI.cpp. Currently there is no test
changes shown, but this is mandatory for later changes.
Reviewed by: sameerds
Differential Revision: https://reviews.llvm.org/D133840
Arthur Eubanks [Mon, 26 Sep 2022 01:49:49 +0000 (18:49 -0700)]
[bazel] Always specify --strip=never
Arthur Eubanks [Mon, 26 Sep 2022 01:21:35 +0000 (18:21 -0700)]
[bazel] Add some general build flags
Weining Lu [Thu, 22 Sep 2022 12:03:01 +0000 (20:03 +0800)]
[Clang][LoongArch] Add inline asm support for constraints f/l/I/K
This patch adds support for constraints `f`, `l`, `I`, `K` according
to [1]. The remain constraints (`k`, `m`, `ZB`, `ZC`) will be added
later as they are a little more complex than the others.
f: A floating-point register (if available).
l: A signed 16-bit constant.
I: A signed 12-bit constant (for arithmetic instructions).
K: An unsigned 12-bit constant (for logic instructions).
For now, no need to support register alias (e.g. `$a0`) in llvm as
clang will correctly decode the usage of register name aliases into
their official names. And AFAIK, the not yet upstreamed `rustc` for
LoongArch will always use official register names (e.g. `$r4`).
[1] https://gcc.gnu.org/onlinedocs/gccint/Machine-Constraints.html
Differential Revision: https://reviews.llvm.org/D134157
James Y Knight [Mon, 19 Sep 2022 14:10:01 +0000 (10:10 -0400)]
[AVR] Fix useDeprecatedPositionallyEncodedOperands errors.
This is a follow-on to https://reviews.llvm.org/D134073.
It renames a few fields to have consistent names, as well as renaming
operands to match the field names.
The encoder behavior is unchanged by this cleanup, but a few
instructions were previously being disassembled incorrectly, and have
been corrected by this change. All of the affected instructions were
missing disassembly tests, which are now added.
Differential Revision: https://reviews.llvm.org/D134185
James Y Knight [Fri, 16 Sep 2022 21:21:06 +0000 (17:21 -0400)]
[AMDGPU] Fix useDeprecatedPositionallyEncodedOperands errors in R600.
This is a follow-on to https://reviews.llvm.org/D134073.
It renames a couple of fields to match their operands, as well as
introducing sub-operand names where required.
This change _only_ fixes the 'R600' half of the target, not the
'AMDGPU' half. Fixing the AMDGPU half will be a significantly more
difficult change (which I've not yet attempted.)
Differential Revision: https://reviews.llvm.org/D134078
James Y Knight [Sun, 12 Jun 2022 22:06:29 +0000 (22:06 +0000)]
[Lanai] Fix useDeprecatedPositionallyEncodedOperands errors.
This is a follow-on to https://reviews.llvm.org/D134073.
Lanai was almost clean: the only issue is that 'bit' behaves
differently than 'bits<1>', because only the 'bits' type preserves
unresolved references via 'keepUnsetBits()' in
TableGen/Record.h. Thus, use bits instead.
This issue _would_ have caused invalid instruction emission/decoding,
except that the PQ bits were being overriden after the fact by code in
'adjustPqBits' in MCTargetDesc/LanaiMCCodeEmitter.cpp, and
'PostOperandDecodeAdjust' in Disassembler/LanaiDisassembler.cpp.
Differential Revision: https://reviews.llvm.org/D134075
Danil Sidoruk [Sun, 25 Sep 2022 20:27:42 +0000 (13:27 -0700)]
[clang-format][NFC] Rewrite prints in python3 compatible way
Closes #55996.
Differential Revision: https://reviews.llvm.org/D131789
Simon Pilgrim [Sun, 25 Sep 2022 18:58:18 +0000 (19:58 +0100)]
[Coroutines] Regenerate coro-retcon-resume-values.ll
Nico Weber [Fri, 23 Sep 2022 15:12:59 +0000 (11:12 -0400)]
[clang-cl] Implement /ZH: flag
Based on a patch by Arlo Siemsen (D98438)!
Differential Revision: https://reviews.llvm.org/D134544
Emilia Dreamer [Sun, 25 Sep 2022 17:30:10 +0000 (20:30 +0300)]
[clang-format] Look ahead before consuming `bool` in requires clause.
The comment handling the bool case says:
"bool is only allowed if it is directly followed by a paren for a cast"
This change more closely follows this directive by looking ahead for
the paren before consuming the bool keyword itself. Without a following
paren, the bool would be part of something else, such as a return type
for a function declaration
Fixes https://github.com/llvm/llvm-project/issues/57538
Reviewed By: HazardyKnusperkeks, owenpan, MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D134325
Emilia Dreamer [Sun, 25 Sep 2022 17:29:34 +0000 (20:29 +0300)]
[clang-format] Correctly annotate static and consteval lambdas
`P1169` "static operator()" (https://wg21.link/P1169) is accepted to
C++23 and while clang itself doesn't exactly support it yet,
clang-format could quite easily.
This simply allows the keyword `static` to be a part of lambdas as
specified by the addition to [expr.prim.lambda.general]
While adding this, I noticed `consteval` lambdas also aren't handled,
so that keyword is now allowed to be a part of lambdas as well
Reviewed By: HazardyKnusperkeks, owenpan, MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D134587
Simon Pilgrim [Sun, 25 Sep 2022 15:23:35 +0000 (16:23 +0100)]
[PhaseOrdering][X86] Add missing triple from fast-basictest.ll test
Simon Pilgrim [Sun, 25 Sep 2022 15:22:42 +0000 (16:22 +0100)]
[SLP][X86] Add missing triple from pr49081.ll test
Hui Xie [Fri, 2 Sep 2022 18:24:22 +0000 (19:24 +0100)]
fix errors on passing input iterator to `std::views::take`
In the implementation of `std::views::take`, it uses `subrange<Iter>` as part of the return type. But in case of input iterator, `subrange<Iter>` can be ill-formed
Differential Revision: https://reviews.llvm.org/D133220
Amaury Séchet [Sun, 25 Sep 2022 14:00:22 +0000 (14:00 +0000)]
Autogenerate a couple of test in the AMDGPU backend. NFC
Simon Pilgrim [Sun, 25 Sep 2022 14:12:21 +0000 (15:12 +0100)]
[CostModel][X86] Add missing cost kinds for v2i64 icmp on SLM
Simon Pilgrim [Sun, 25 Sep 2022 13:18:03 +0000 (14:18 +0100)]
[X86] Fix Icelake VPMULLQ zmm pipes and adjust AVX512DQ v8i64 mul costs to match worse case
Icelake PMULLQ throughput regressed cf SkylakeServer as its Pipe0 only
Confirmed with Intel SOM, Agner and instlatx64
Mark de Wever [Mon, 19 Sep 2022 15:37:35 +0000 (17:37 +0200)]
[libc++] Rewrites graph_header_deps.py.
The new version is a lot simpler and has less option which were not
used. This uses the CSV files as generated by D133127 as input data.
The current Python script has more features but uses a simple "grep"
making the output less accurate:
- Conditionally included header are always included. This is an issue
since part of our includes are unneeded transitive includes. Based on
the language version they may be omitted. The script however always
includes them.
- Includes in comments are processed as-if they are includes. This is an
issue when comments explain how certain data is generated; of course
there are digraphs which the script omits.
This implementation uses Clang's --trace-includes to generate the includes
per header. This means the input of the generation script always has the
real list of includes.
Libc++ is moving from large monolithic Standard headers to more fine
grained headers. For example, algorithm includes every header in
`__algorithm`. Adding all these detail headers in the graph makes the
output unusable. Instead it only shows the Standard headers. The
transitive includes of the detail headers are parsed and "attributed" to
the Standard header including them. This gives an accurate include graph
without the unneeded clutter. Note that this graph is still big.
This changes fixes the cyclic dependency issue with the previous version
of the tool so the markers and its documentation is removed.
Since the input has no cycles the CI test is removed.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D134188
Petar Avramovic [Sun, 25 Sep 2022 10:52:32 +0000 (12:52 +0200)]
[AMDGPU] Pattern for flat atomic fadd f64 intrinsic with local addr
Fix regression from clang opencl test in builtins-fp-atomics-gfx90a.cl
test_flat_add_local_f64 caused by D130579
Revert
a3becb333d7faae695e18728e9b8fa3a3579a240.
Differential Revision: https://reviews.llvm.org/D134568
Mark de Wever [Thu, 1 Sep 2022 17:21:27 +0000 (19:21 +0200)]
[libc++][test] Improves transitive includes.
This test generates the include graph of the Standard headers of libc++ in
a CSV file. This was originally used to generate graphviz dot files. During
review it was noticed these files have all information needed to replace
the current transitive includes. Therefore the output, with the same information as the .dot file is stored in a .csv file. This removes
all the existing transitive include files.
The .cvs can be converted by a .dot file by the script in D134188.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D133127
Sanjay Patel [Sun, 25 Sep 2022 11:02:26 +0000 (07:02 -0400)]
[InstSimplify] fold redundant select of min/max, part 2
This extends
e5d15e116292 to handle the inverse predicates
(there's probably a more elegant way to specify the preds).
These patterns correspond to the existing simplify:
max (min X, Y), X --> X
...and extra preds for (non)equality.
The tests cycle through all 10 icmp preds for each min/max
variant with 4 swapped operand patterns each (and the min/max
operands are commuted in every other test within those).
Some Alive2 examples to verify:
https://alive2.llvm.org/ce/z/XMvEKQ
https://alive2.llvm.org/ce/z/QpMChr
Daniel Bertalan [Sat, 24 Sep 2022 19:10:31 +0000 (21:10 +0200)]
[lld-macho] Force higher alignment for __thread_vars
`__thread_vars` contains pointers to `__tlv_bootstrap`, which are fixed
up by dyld; however the section's alignment is not specified. This means
that the relocations might end up on odd addresses, which is not
representable by the soon to be added chained fixups.
This is arguably a bug in MC, but this behavior has been there since TLV
support was originally added.
This patch forces the `__thread_vars` sections to be aligned to the
target's pointer size. This is done by ld64 as well.
Differential Revision: https://reviews.llvm.org/D134594
Han Zhu [Sun, 25 Sep 2022 04:51:35 +0000 (21:51 -0700)]
[X86] Pre-commit unit test for D134477
wangliushuai [Sun, 25 Sep 2022 02:16:30 +0000 (10:16 +0800)]
[Clang] Improve diagnostics about the invalid target feature.
Clang with debug builds will crash when run with empty target feature input.
And the warning message is a little bit confusing. This patch adds an empty
check and a new diagnostic to illustrate where goes wrong.
Reviewed By: MaskRay, aaron.ballman
Differential Revision: https://reviews.llvm.org/D133563
Philip Reames [Sun, 25 Sep 2022 00:06:48 +0000 (17:06 -0700)]
[RISCV] Pattern match scalable strided load/store
Very straight forward extension of the existing pattern matching pass to handle scalable types as well as fixed length types. The only extra bit beyond removing a bailout is recognizing stepvector.
Differential Revision: https://reviews.llvm.org/D134502
Philip Reames [Sun, 25 Sep 2022 00:05:10 +0000 (17:05 -0700)]
[RISCV] Add lowering for scalable @llvm.riscv.masked.strided.load/store
The code previously assumed fixed length vectors; make the relevant code conditional.
Having the lowering in place is neccessary for an upcoming change to generalize scatter/gather matching to scalable vectors.
Differential Revision: https://reviews.llvm.org/D134489
David Green [Sat, 24 Sep 2022 20:29:41 +0000 (21:29 +0100)]
[ARM] Fix check lines in memcpy-inline.ll test. NFC
Commit c442698 updated the check lines in this file, but did so in a
way that removed a number of the existing checks, as the
update_llc_test_checks script does not understand all triples. This
fixes it up as needed to keep testing Thumb1 code.
Florian Hahn [Sat, 24 Sep 2022 19:33:49 +0000 (20:33 +0100)]
[LoopVersioning] Add tests where versioning requires LAA invalidation.
Additional test cases for #57825.
Simon Pilgrim [Sat, 24 Sep 2022 17:55:25 +0000 (18:55 +0100)]
[BPF] memcmp.ll - add checks for all loads
Noticed while triaging alignment issues for #57872
Simon Pilgrim [Sat, 24 Sep 2022 17:53:59 +0000 (18:53 +0100)]
[BPF] ex1.ll - add checks for stores
Noticed while triaging alignment issues for #57872
Nathan James [Sat, 24 Sep 2022 17:29:17 +0000 (18:29 +0100)]
[clang-tidy] Fix a false positive in readability-simplify-boolean-expr
Reviewed By: LegalizeAdulthood
Differential Revision: https://reviews.llvm.org/D134590
Sanjay Patel [Sat, 24 Sep 2022 15:08:19 +0000 (11:08 -0400)]
[InstSimplify] fold redundant select of min/max
This is similar to the existing simplify:
max (max X, Y), X --> max X, Y
...but the select condition can be one of
several predicates as shown in the tests.
The tests cycle through all 10 icmp preds for
each min/max variant with 4 swapped operand
patterns each (and the min/max operands are
commuted in every other test within those).
Some Alive2 examples to verify:
https://alive2.llvm.org/ce/z/lCAQm4
https://alive2.llvm.org/ce/z/kzxVXC
Sanjay Patel [Fri, 23 Sep 2022 18:31:51 +0000 (14:31 -0400)]
[InstSimplify] add tests for select with min/max op; NFC
These are organized as 10 (predicates) * 4 (swapped operands) * 4 (min/max variants) = 160 tests.
Jun Zhang [Sat, 24 Sep 2022 14:18:04 +0000 (22:18 +0800)]
[Clang] Warn when trying to dereference void pointers in C
Previously we only have an extension that warn void pointer deferencing
in C++, but for C we did nothing.
C2x 6.5.3.2p4 says The unary * operator denotes indirection. If it points
to an object, the result is an lvalue designating the object. However, there
is no way to form an lvalue designating an object of an incomplete type as
6.3.2.1p1 says "an lvalue is an expression (with an object type other than
void)", so the behavior is undefined.
Fixes https://github.com/llvm/llvm-project/issues/53631
Signed-off-by: Jun Zhang <jun@junz.org>
Differential Revision: https://reviews.llvm.org/D134461
James Y Knight [Tue, 20 Sep 2022 12:30:20 +0000 (08:30 -0400)]
[TableGen] Add useDeprecatedPositionallyEncodedOperands option.
Summary:
The existing undefined-bitfield-to-operand matching behavior is very
hard to understand, due to the combination of positional and named
matching. This can make it difficult to track down a bug in a target's
instruction definitions.
Over the last decade, folks have tried to work-around this in various
ways, but it's time to finally ditch the positional matching. With
https://reviews.llvm.org/D131003, there are no longer cases that
_require_ positional matching, and it's time to start removing usage
and support for it.
Therefore: add a (default-false) option, and set it to true only in
those targets that require positional matching today. Subsequent
changes will start cleaning up additional in-tree targets.
NOTE TO OUT OF TREE TARGET MAINTAINERS:
If this change breaks your build, you may restore the previous
behavior simply by adding:
let useDeprecatedPositionallyEncodedOperands = 1;
to your target's InstrInfo tablegen definition. However, this is
temporary -- the option will be removed in the future.
If your target does not set 'decodePositionallyEncodedOperands', you
may thus start migrating to named operands. However, if you _do_
currently set that option, I recommend waiting until a subsequent
change lands, which adds decoder support for named sub-operands.
Differential Revision: https://reviews.llvm.org/D134073
James Y Knight [Mon, 5 Sep 2022 16:10:21 +0000 (12:10 -0400)]
[TableGen][CodeEmitterGen] Allow local names for sub-operands in a operand list.
These names can then be matched by name against 'bits' fields in a
record, to populate an instruction's encoding.
This does _not_ yet change DecoderEmitter to allow by-name matching of
sub-operands. Unlike the encoder, the decoder already defaulted to not
supporting positional matching, and backends had workarounds in place
for the missing decoding support.
Additionally, use this new capability to allow the ARM and AArch64
backends not to require any positional operand matching.
Differential Revision: https://reviews.llvm.org/D131003
Valentin Clement [Sat, 24 Sep 2022 13:22:47 +0000 (15:22 +0200)]
[flang] Handle NULL(mold) used in initializer region
NULL intrinsic with a MOLD argument can be used in a type constructor.
This patch handles this use case with a specific lowering that create
an unallocated box with the MOLD type.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D134554
Joseph Huber [Fri, 23 Sep 2022 16:39:25 +0000 (11:39 -0500)]
[Clang] Make Clang driver suggest '-Xclang' for CC1 options passed to the driver
This patch adds an additional check for if an options passed to the
Clang driver could've been intended for the clang compiler. This is
primarily done for the times when a user attempts to pass an option like
`-ast-dump` to the driver instead.
Reviewed By: MaskRay, aaron.ballman
Differential Revision: https://reviews.llvm.org/D134550
eopXD [Fri, 23 Sep 2022 02:15:36 +0000 (19:15 -0700)]
[RISCV][Clang] Replace all undef value with poison
Address remaining work that dates back to discussion in D126745
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D134513