John Brawn [Thu, 17 Feb 2022 16:37:38 +0000 (16:37 +0000)]
[AArch64] Remove an unused variable in my previous patch
zhijian [Thu, 17 Feb 2022 16:37:33 +0000 (11:37 -0500)]
Title: Export unique symbol list with llvm-nm new option "--export-symbols"
Summary:
the patch implement of following functionality.
1. export the symbols from archive or object files.
2. sort the export symbols. (based on same symbol name and visibility)
3. delete the duplicate export symbols (based on same symbol name and visibility)
4. print out the unique and sorted export symbols (print the symbol name and visibility).
there are two new options are add in the patch
1. --export-symbols (enable the functionality of export unique symbol)
2. --no-rsrc (exclude the symbol name begin with "__rsrc" from be exporting from xcoff object file)
Export symbol list for xcoff object file has the same functionality as
The patch has the same functionality as
https://www.ibm.com/docs/en/xl-c-aix/13.1.0?topic=library-exporting-symbols-createexportlist-utility
Reviewers: James Henderson,Fangrui Song
Differential Revision: https://reviews.llvm.org/D112735
Alexey Lapshin [Thu, 17 Feb 2022 16:04:51 +0000 (19:04 +0300)]
Craig Topper [Thu, 17 Feb 2022 16:17:41 +0000 (08:17 -0800)]
[RISCV] Match shufflevector corresponding to slideup.
This generalizes isElementRotate to work when there's only a single
slide needed. I've removed matchShuffleAsSlideDown which is now
redundant.
Reviewed By: frasercrmck, khchen
Differential Revision: https://reviews.llvm.org/D119759
Craig Topper [Thu, 17 Feb 2022 16:10:20 +0000 (08:10 -0800)]
[RISCV] Fix incorrect MemOperand copy converting splat+load to vlse.
Due to an incorrect copy/paste from load intrinsic handling we
checked if the splat node was a MemSDNode which of course it isn't.
Instead get the MemOperand from the LoadSDNode for the source of
the splat.
This enables LICM to see the load is loop invariant and hoist it
out of the loop.
Reviewed By: frasercrmck
Differential Revision: https://reviews.llvm.org/D120014
John Brawn [Tue, 25 Jan 2022 17:53:58 +0000 (17:53 +0000)]
[AArch64] Add some missing strict FP vector lowering
Also add a test for the codegen of strict FP vector operations so
these changes get tested.
Differential Revision: https://reviews.llvm.org/D117795
Jay Foad [Thu, 17 Feb 2022 14:17:36 +0000 (14:17 +0000)]
[GlobalDCE] Simplify and return Changed = true less often
Removing dead constants should not count as making a change to the
module. This means that RemoveUnusedGlobalValue simplifies to just
calling removeDeadConstantUsers, so inline it.
Differential Revision: https://reviews.llvm.org/D120052
Matt Devereau [Tue, 8 Feb 2022 14:24:03 +0000 (14:24 +0000)]
[AArch64][SVE] Invert VSelect operand order and condition for predicated arithmetic operations
(vselect (setcc ( condcode) (_) (_)) (a) (op (a) (b)))
=> (vselect (setcc (!condcode) (_) (_)) (op (a) (b)) (a))
As a follow up to D117689, invert the operand order and condition
in order to fold vselects into predicated instructions.
Differential Revision: https://reviews.llvm.org/D119424
Michael Kruse [Thu, 17 Feb 2022 15:42:15 +0000 (09:42 -0600)]
[polly] Fix regression test after D110620.
fourdim [Thu, 17 Feb 2022 15:40:32 +0000 (23:40 +0800)]
Revert "[JITLink][RISCV] fix the extractBits behavior and add R_RISCV_JAL relocation."
This reverts commit
3af7bbca4a0ef64de64b8bb38d3b167673ec60f0.
Sanjay Patel [Thu, 17 Feb 2022 15:34:48 +0000 (10:34 -0500)]
[InstCombine] push constant operand down/outside in sequence of min/max intrinsics
A generalization like this was suggested in D119754.
This is the inverse direction of D119851,
and we get all of the folds there plus the one that was missed.
There is precedence for this kind of transform in instcombine
with "or" instructions (but strangely only with that one opcode AFAICT).
Similar justification as in the other patch:
The line between instcombine and reassociate for these kinds of folds
is blurry. This doesn't appear to have much cost and gives us the
expected wins from repeated folds as seen in the last set of test diffs.
Differential Revision: https://reviews.llvm.org/D119955
Sanjay Patel [Wed, 16 Feb 2022 18:57:38 +0000 (13:57 -0500)]
[InstCombine] add test for min/max intrinsic with constant expression; NFC
Shilei Tian [Thu, 17 Feb 2022 15:22:16 +0000 (10:22 -0500)]
[OpenMP][Offloading] Fix test case issues in bug49334.cpp
`bug49334.cpp` has one issue that causes flaky result reported in #53730.
The root cause is `BlockedC` is never initialized but in `BlockMatMul_TargetNowait`
it is directly read and written (via `+=`). Fixes #53730.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D119988
fourdim [Thu, 17 Feb 2022 15:00:55 +0000 (23:00 +0800)]
[JITLink][RISCV] fix the extractBits behavior and add R_RISCV_JAL relocation.
This patch supports the R_RISCV_JAL relocation.
Moreover, it will fix the extractBits function's behavior as it extracts Size + 1 bits.
In the test ELF_jal.s:
Before:
```
Hi:
4294836480
extractBits(Hi, 12, 8): 480
```
After:
```
Hi:
4294836480
extractBits(Hi, 12, 8): 224
```
Reviewed By: StephenFan
Differential Revision: https://reviews.llvm.org/D117975
Zakk Chen [Mon, 14 Feb 2022 02:09:27 +0000 (18:09 -0800)]
[RISCV] Add the passthru operand for vmv.vv/vmv.vx/vfmv.vf IR intrinsics.
Add the passthru operand for
VMV_V_X_VL, VFMV_V_F_VL and SPLAT_VECTOR_SPLIT_I64_VL also.
The goal is support tail and mask policy in RVV builtins.
We focus on IR part first.
If the passthru operand is undef, we use tail agnostic, otherwise
use tail undisturbed.
Reviewed By: rogfer01
Differential Revision: https://reviews.llvm.org/D119688
Alexander Potapenko [Thu, 17 Feb 2022 14:09:31 +0000 (15:09 +0100)]
tsan: Add a missing disable_sanitizer_instrumentation attribute
Turns out the test was working by accident: we need to ensure
TSan instrumentation is not called from the fork() hook, otherwise the
tool will deadlock. Previously it worked because alloc_free_blocks() got
inlined into __tsan_test_only_on_fork(), but it cannot always be the
case.
Adding __attribute__((disable_sanitizer_instrumentation)) will prevent
TSan from instrumenting alloc_free_blocks().
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D120050
Lei Zhang [Thu, 17 Feb 2022 14:08:15 +0000 (09:08 -0500)]
[mlir][spirv] Add a pass to unify aliased resource variables
In SPIR-V, resources are represented as global variables that
are bound to certain descriptor. SPIR-V requires those global
variables to be declared as aliased if multiple ones are bound
to the same slot. Such aliased decorations can cause issues
for transcompilers like SPIRV-Cross when converting to source
shading languages like MSL.
So this commit adds a pass to perform analysis of aliased
resources and see if we can unify them into one.
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D119872
Alexey Bataev [Thu, 17 Feb 2022 13:40:01 +0000 (05:40 -0800)]
[SLP][NFC]Fix misprint in function name, NFC.
Nico Weber [Thu, 17 Feb 2022 13:56:06 +0000 (08:56 -0500)]
[gn build] (manually) port
f75da0c8e65c (ObjCopy lib)
Shao-Ce SUN [Thu, 17 Feb 2022 13:02:58 +0000 (21:02 +0800)]
[RISCV] add the MC layer support of Zfinx extension
This patch added the MC layer support of Zfinx extension.
Authored-by: StephenFan
Co-Authored-by: Shao-Ce Sun
Reviewed By: asb
Differential Revision: https://reviews.llvm.org/D93298
Simon Pilgrim [Thu, 17 Feb 2022 13:50:52 +0000 (13:50 +0000)]
[X86] selectLEAAddr - add X86ISD::SMUL/UMULO handling
After D118128 relaxed the heuristic to require only one EFLAGS generating operand, it now makes sense to avoid X86ISD::SMUL/UMULO duplication as well.
Differential Revision: https://reviews.llvm.org/D119578
Guillaume Chatelet [Thu, 17 Feb 2022 12:31:00 +0000 (12:31 +0000)]
[libc][automemcpy] Introduce geomean of scores as a tie breaker
Differential Revision: https://reviews.llvm.org/D120040
Paul Walker [Fri, 10 Dec 2021 18:05:38 +0000 (18:05 +0000)]
[DAGCombiner] Extend ISD::ABDS/U combine to handle more cases.
The current ABD combine doesn't quite work for SVE because only a
single scalable vector per scalar integer type is legal (e.g. for
i32, <vscale x 4 x i32> is the only legal scalable vector type).
This patch extends the combine to also trigger for the cases when
operand extension must be retained.
Differential Revision: https://reviews.llvm.org/D115739
Bjorn Pettersson [Fri, 4 Feb 2022 17:32:13 +0000 (18:32 +0100)]
[DAG] Fix in ReplaceAllUsesOfValuesWith
When doing SelectionDAG::ReplaceAllUsesOfValuesWith a worklist is
prepared containing all users that should be updated. Then we use
the RemoveNodeFromCSEMaps/AddModifiedNodeToCSEMaps helpers to handle
recursive CSE updates while doing the replacements.
This patch aims at solving a problem that could arise if the recursive
CSE updates would result in an SDNode present in the worklist is being
removed as a side-effect of morphing a prio user in the worklist.
To examplify such a scenario, imagine that we have these nodes in
the DAG
t12: i64 = add t8, t11
t13: i64 = add t12, t8
t14: i64 = add t11, t11
t15: i64 = add t14, t8
t16: i64 = sub t13, t15
and that the t8 uses should be replaced by t11. An initial worklist
(listing the users that should be morphed) could be [t12, t13, t15].
When updating t12 we get
t12: i64 = add t11, t11
which results in a CSE update that replaces t14 by t12, so we get
t15: i64 = add t12, t8
which results in a CSE update that replaces t13 by t12, so we get
t16: i64 = sub t12, t15
and then t13 is removed given that it was the last use of t13.
So when being done with the updates triggered by rewriting the use
of t8 in t12 the t13 node no longer exist. And we used to end up
hitting an assertion when continuing with the worklist aiming at
replacing the t8 uses in t13.
The solution is based on using a DAGUpdateListener, making sure that
we prune a user from the worklist if it is removed during the
recursive CSE updates.
The bug was found using an OOT target. I think the problem is quite
old, even if the particular intree target reproducer added in this
patch seem to pass when using LLVM 13.0.0.
Differential Revision: https://reviews.llvm.org/D119088
Simon Pilgrim [Thu, 17 Feb 2022 13:28:02 +0000 (13:28 +0000)]
[clang-doc] SerializeIndex - pass Index param by constant reference
Silence coverity warnings about unnecessary copies
Shao-Ce SUN [Thu, 17 Feb 2022 13:19:14 +0000 (21:19 +0800)]
[NFC] Fix comment
Simon Pilgrim [Thu, 17 Feb 2022 13:18:02 +0000 (13:18 +0000)]
[clang] CGDebugInfo::getOrCreateMethodType - use castAs<> instead of getAs<> to avoid dereference of nullptr
The pointer is always dereferenced, so assert the cast is correct instead of returning nullptr
Simon Pilgrim [Thu, 17 Feb 2022 13:15:19 +0000 (13:15 +0000)]
[clang] CGCXXABI::EmitLoadOfMemberFunctionPointer - use castAs<> instead of getAs<> to avoid dereference of nullptr
The pointer is always dereferenced by arrangeCXXMethodType, so assert the cast is correct instead of returning nullptr
Shao-Ce SUN [Thu, 17 Feb 2022 13:13:00 +0000 (21:13 +0800)]
[NFC] Correct typo `interger` to `integer`
Benjamin Kramer [Thu, 17 Feb 2022 12:51:27 +0000 (13:51 +0100)]
[BufferDeallocation] Don't assume successor operands are unique
This would create a double free when a memref is passed twice to the
same op. This wasn't a problem at the time the pass was written but is
common since the introduction of scf.while.
There's a latent non-determinism that's triggered by the test, but this
change is messy enough as-is so I'll leave that for later.
Differential Revision: https://reviews.llvm.org/D120044
John Brawn [Fri, 28 Jan 2022 15:05:39 +0000 (15:05 +0000)]
[AArch64] Allow strict opcodes in faddp patterns
This also requires adjustment to code in AArch64ISelLowering so that
vector_extract is distributed over strict_fadd.
Differential Revision: https://reviews.llvm.org/D118489
John Brawn [Fri, 28 Jan 2022 14:31:17 +0000 (14:31 +0000)]
[AArch64] Allow strict opcodes in indexed fmul and fma patterns
Using an indexed version instead of a non-indexed version doesn't
change anything with regards to exceptions or rounding.
Differential Revision: https://reviews.llvm.org/D118487
John Brawn [Fri, 28 Jan 2022 14:10:51 +0000 (14:10 +0000)]
[AArch64] Allow strict opcodes in fp->int->fp patterns
These patterns don't change the fundamental instructions that are
used, just the variants that are used in order to remove some extra
MOVs.
Differential Revision: https://reviews.llvm.org/D118485
John Brawn [Fri, 7 Jan 2022 14:47:26 +0000 (14:47 +0000)]
[AArch64] Add instruction selection for strict FP
This consists of marking the various strict opcodes as legal, and
adjusting instruction selection patterns so that 'op' is 'any_op'.
FP16 and vector instructions additionally require some extra work in
lowering and legalization, so we can't set IsStrictFPEnabled just yet.
Also more work needs to be done for full strict fp support (marking
instructions that can raise exceptions as such, and modelling FPCR use
for controlling rounding).
Differential Revision: https://reviews.llvm.org/D114946
Guillaume Chatelet [Thu, 17 Feb 2022 11:51:59 +0000 (11:51 +0000)]
[llvm][automemcpy] Allow distribution filtering in analysis
Differential Revision: https://reviews.llvm.org/D120037
Adrian Kuegel [Thu, 17 Feb 2022 12:31:50 +0000 (13:31 +0100)]
[AArch64][NFC] Fix unused-lambda-capture warning.
Differential Revision: https://reviews.llvm.org/D120041
Nikita Popov [Thu, 17 Feb 2022 13:08:29 +0000 (14:08 +0100)]
[Docs] Use correct rst syntax
Momchil Velikov [Thu, 17 Feb 2022 11:18:11 +0000 (11:18 +0000)]
Remove duplicated code for printing the `uwtable` attribute (NFC)
Committed as obvious.
Reviewed By: chill
Differential Revision: https://reviews.llvm.org/D120030
Adrian Kuegel [Thu, 17 Feb 2022 12:02:14 +0000 (13:02 +0100)]
[Bazel] Fix build after ObjCopy move.
Differential Revision: https://reviews.llvm.org/D120039
Andrzej Warzynski [Fri, 4 Feb 2022 17:15:12 +0000 (17:15 +0000)]
[flang][driver] Add support for `-emit-llvm`
This patch adds support for the `-emit-llvm` option in the frontend
driver (i.e. `flang-new -fc1`). Similarly to Clang, `flang-new -fc1
-emit-llvm file.f` will generate a textual LLVM IR file.
Depends on D118985
Differential Revision: https://reviews.llvm.org/D119012
Guillaume Chatelet [Thu, 17 Feb 2022 10:56:25 +0000 (10:56 +0000)]
[libc][automemcpy] Add mean/variance and simplify implementation
Differential Revision: https://reviews.llvm.org/D120031
Nikita Popov [Thu, 17 Feb 2022 12:00:46 +0000 (13:00 +0100)]
[Docs] Update opaque pointers docs
Expand migration instructions.
Roman Lebedev [Thu, 17 Feb 2022 11:30:02 +0000 (14:30 +0300)]
[NFC][PhaseOrdering] Improve test coverage for D119975
Simon Pilgrim [Thu, 17 Feb 2022 11:56:29 +0000 (11:56 +0000)]
[SystemZ] lowerDYNAMIC_STACKALLOC_XPLINK - use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is always dereferenced, so assert the cast is correct instead of returning nullptr
Simon Pilgrim [Thu, 17 Feb 2022 11:54:12 +0000 (11:54 +0000)]
[X86] X86tcret_1reg - use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The pointer is always dereferenced, so assert the cast is correct instead of returning nullptr
Simon Pilgrim [Thu, 17 Feb 2022 11:41:47 +0000 (11:41 +0000)]
AArch64_MC::isQForm - Fix MSVC 'no default capture mode' lambda warning
Nikita Popov [Thu, 17 Feb 2022 10:59:04 +0000 (11:59 +0100)]
[RelLookupTableConverter] Ensure that GV, GEP and load types match
This code could be generalized to be type-independent, but for now
just ensure that the same type constraints are enforced with opaque
pointers as with typed pointers.
Max Kazantsev [Thu, 17 Feb 2022 10:38:42 +0000 (17:38 +0700)]
[SCEV] Infer ranges for SCC consisting of cycled Phis
Our current strategy of computing ranges of SCEVUnknown Phis was to simply
compute the union of ranges of all its inputs. In order to avoid infinite recursion,
we mark Phis as pending and conservatively return full set for them. As result,
even simplest patterns of cycled phis always have a range of full set.
This patch makes this logic a bit smarter. We basically do the same, but instead
of taking inputs of single Phi we find its strongly connected component (SCC)
and compute the union of all inputs that come into this SCC from outside.
Processing entire SCC together has one more advantage: we can set range for all
of them at once, because the only thing that happens to them is the same value is
being passed between those Phis. So, despite we spend more time analyzing a
single Phi, overall we may save time by not processing other SCC members, so
amortized compile time spent should be approximately the same.
Differential Revision: https://reviews.llvm.org/D110620
Reviewed By: reames
Sven van Haastregt [Thu, 17 Feb 2022 10:58:52 +0000 (10:58 +0000)]
[OpenCL] Guard 64-bit atomic types
Until now, overloads with a 64-bit atomic type argument were always
made available with `-fdeclare-opencl-builtins`. Ensure these
overloads are only available when both the `cl_khr_int64_base_atomics`
and `cl_khr_int64_extended_atomics` extensions have been enabled, as
required by the OpenCL specification.
Differential Revision: https://reviews.llvm.org/D119858
Alexey Lapshin [Thu, 17 Feb 2022 10:25:48 +0000 (13:25 +0300)]
[objcopy][NFC] Add doc comments to the executeObjcopy* functions.
Add doc comments to the executeObjcopy* functions.
Depends on D88827
Pavel Kosov [Thu, 17 Feb 2022 10:41:57 +0000 (13:41 +0300)]
[SchedModels][CortexA55] Add ASIMD integer instructions
Depends on D114642
Original review https://reviews.llvm.org/D112201
OS Laboratory. Huawei Russian Research Institute. Saint-Petersburg
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D117003
Pavel Kosov [Thu, 17 Feb 2022 10:41:05 +0000 (13:41 +0300)]
[AArch64][SchedModels] Handle virtual registers in FP/NEON predicates
Current implementation of Check[HSDQ]Form predicates doesn’t handle virtual registers and therefore isn’t useful for pre-RA scheduling. Patch fixes this implementing two function predicates: CheckQForm for checking that instruction writes 128-bit NEON register and CheckFpOrNEON which checks that instruction writes FP register (any width). The latter supersedes Check[HSD]Form predicates which are not used individually.
OS Laboratory. Huawei Russian Research Institute. Saint-Petersburg
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D114642
Nikita Popov [Wed, 16 Feb 2022 15:38:11 +0000 (16:38 +0100)]
[CodeGen] Rename deprecated Address constructor
To make uses of the deprecated constructor easier to spot, and to
ensure that no new uses are introduced, rename it to
Address::deprecated().
While doing the rename, I've filled in element types in cases
where it was relatively obvious, but we're still left with 135
calls to the deprecated constructor.
Zakk Chen [Fri, 28 Jan 2022 16:16:25 +0000 (08:16 -0800)]
[RISCV] Add the passthru operand for vadc/vsbc/vmerge/vfmerge IR intrinsics.
The goal is support tail and mask policy in RVV builtins.
We focus on IR part first.
If the passthru operand is undef, we use tail agnostic, otherwise
use tail undisturbed.
Reviewed By: rogfer01
Differential Revision: https://reviews.llvm.org/D119686
Eli Friedman [Thu, 17 Feb 2022 10:17:27 +0000 (02:17 -0800)]
Revert "[compiler-rt] Implement ARM atomic operations for architectures without SMP support"
This reverts commit
910a642c0a5b66a8d2517026b890a1acdc447f19.
There are serious correctness issues with the current approach: __sync_*
routines which are not actually atomic should not be enabled by default.
I'll continue discussion on the review.
Eli Friedman [Thu, 17 Feb 2022 10:16:25 +0000 (02:16 -0800)]
Revert "[NFC][compiler-rt] Format file lib/builtins/arm/sync-ops.h"
This reverts commit
f165c23bf3598990aaf2174a6bc40be75199ee1a.
Part of revert sequence for
910a642c0a.
Alexey Lapshin [Fri, 11 Feb 2022 18:42:40 +0000 (21:42 +0300)]
[llvm-objcopy][NFC] Move core implementation of llvm-objcopy into separate library.
This patch moves core implementation of llvm-objcopy into Object library
(http://lists.llvm.org/pipermail/llvm-dev/2020-September/145075.html).
The functionality for parsing input options is left inside tools/llvm-objcopy.
The interface of ObjCopy library:
ObjCopy/ELF/ELFObjcopy.h
```
Error executeObjcopyOnIHex(const CopyConfig &Config, MemoryBuffer &In,
Buffer &Out);
Error executeObjcopyOnRawBinary(const CopyConfig &Config, MemoryBuffer &In,
Buffer &Out);
Error executeObjcopyOnBinary(const CopyConfig &Config,
object::ELFObjectFileBase &In, Buffer &Out);
```
ObjCopy/COFF/COFFObjcopy.h
```
Error executeObjcopyOnBinary(const CopyConfig &Config,
object::COFFObjectFile &In, Buffer &Out);
```
ObjCopy/MachO/MachOObjcopy.h
```
Error executeObjcopyOnBinary(const CopyConfig &Config,
object::MachOObjectFile &In, Buffer &Out);
```
ObjCopy/wasm/WasmObjcopy.h
```
Error executeObjcopyOnBinary(const CopyConfig &Config,
object::WasmObjectFile &In, Buffer &Out);
```
Differential Revision: https://reviews.llvm.org/D88827
Siddharth Bhat [Thu, 17 Feb 2022 10:10:19 +0000 (15:40 +0530)]
[MLIR] add entry block to MLIR grammar.
The MLIR parser allows regions to have an unnamed entry block.
Make this explicit in the language grammar.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D119950
David Green [Thu, 17 Feb 2022 10:03:28 +0000 (10:03 +0000)]
[AArch64] Cleanup for performCommonVectorExtendCombine. NFC
This is some NFC (hopefully!) cleanup for performCommonVectorExtendCombine
and related methods, removing conditions that cannot occur and otherwise
cleaning up the code a little.
Jay Foad [Wed, 16 Feb 2022 11:00:44 +0000 (11:00 +0000)]
[AMDGPU] Return better Changed status from SILowerI1Copies
Differential Revision: https://reviews.llvm.org/D119946
Jay Foad [Wed, 16 Feb 2022 11:00:25 +0000 (11:00 +0000)]
[AMDGPU] Return better Changed status from SIAnnotateControlFlow
Differential Revision: https://reviews.llvm.org/D119945
Stanislav Gatev [Thu, 17 Feb 2022 09:37:02 +0000 (09:37 +0000)]
Add missing break statement in switch.
Jay Foad [Wed, 16 Feb 2022 11:00:05 +0000 (11:00 +0000)]
[AMDGPU] Return better Changed status from AMDGPUPerfHintAnalysis
Differential Revision: https://reviews.llvm.org/D119944
Jay Foad [Wed, 16 Feb 2022 10:59:39 +0000 (10:59 +0000)]
[AMDGPU] Return better Changed status from AMDGPUAnnotateUniformValues
Differential Revision: https://reviews.llvm.org/D119943
Jay Foad [Wed, 16 Feb 2022 10:58:54 +0000 (10:58 +0000)]
[CodeGen] Return better Changed status from LocalStackSlotAllocation
Differential Revision: https://reviews.llvm.org/D119942
Jay Foad [Wed, 16 Feb 2022 10:57:50 +0000 (10:57 +0000)]
[CodeGen] Return false from LiveIntervals::runOnMachineFunction
This is an analysis pass so it does not modify the MachineFunction.
Differential Revision: https://reviews.llvm.org/D119941
Jay Foad [Wed, 16 Feb 2022 10:56:56 +0000 (10:56 +0000)]
[CodeGen] Return better Changed status from DetectDeadLanes
Differential Revision: https://reviews.llvm.org/D119940
Ben Shi [Thu, 17 Feb 2022 09:24:38 +0000 (17:24 +0800)]
Revert "[RISCV] LUI used for address computation should not isAsCheapAsAMove"
This reverts commit
23a50736004e94704a2393aa36a905d737f2b20f.
Although this patch achieved better codegen in most cases, it is really
important to accurately describe the cost of instructions. So I revert it.
Roman Lebedev [Thu, 17 Feb 2022 09:07:17 +0000 (12:07 +0300)]
[SimplifyCFG][PhaseOrdering] Defer lowering switch into an integer range comparison and branch until after at least the IPSCCP
That transformation is lossy, as discussed in
https://github.com/llvm/llvm-project/issues/53853
and https://github.com/rust-lang/rust/issues/85133#issuecomment-
904185574
This is an alternative to D119839,
which would add a limited IPSCCP into SimplifyCFG.
Unlike lowering switch to lookup, we still want this transformation
to happen relatively early, but after giving a chance for the things
like CVP to do their thing. It seems like deferring it just until
the IPSCCP is enough for the tests at hand, but perhaps we need to
be more aggressive and disable it until CVP.
Fixes https://github.com/llvm/llvm-project/issues/53853
Refs. https://github.com/rust-lang/rust/issues/85133
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D119854
Alex Zinenko [Wed, 16 Feb 2022 13:54:54 +0000 (14:54 +0100)]
[mlir] call target materialization more in dialect conversion
During dialect conversion, target materialization is triggered to create
cast-like operations when a type mismatch occurs between the value that
replaces a rewritten operation and the type that another operations expects as
operands processed by the type conversion. First, a dummy cast is inserted to
make sure the pattern application can proceed. The decision to trigger the
user-provided materialization hook is taken later based on the result of the
dummy cast having uses. However, it only has uses if other patterns constructed
new operations using the casted value as operand. If existing (legal)
operations use the replaced value, they may have not been updated to use the
casted value yet. The conversion infra would then delete the dummy cast first,
and then would replace the uses with now-invalid (null in the bast case) value.
When deciding whether to trigger cast materialization, check for liveness the
uses not only of the casted value, but also of all the values that it replaces.
This was discovered in the finalizing bufferize pass that cleans up
mutually-cancelling casts without touching other operations. It is not
impossible that there are other scenarios where the dialect converison infra
could produce invalid operand uses because of dummy casts erased too eagerly.
Reviewed By: springerm
Differential Revision: https://reviews.llvm.org/D119937
Stanislav Gatev [Wed, 16 Feb 2022 16:47:37 +0000 (16:47 +0000)]
[clang][dataflow] Add transfer functions for logical and, or, not.
This is part of the implementation of the dataflow analysis framework.
See "[RFC] A dataflow analysis framework for Clang AST" on cfe-dev.
Reviewed-by: xazax.hun
Differential Revision: https://reviews.llvm.org/D119953
Lorenzo Chelini [Thu, 17 Feb 2022 09:06:16 +0000 (10:06 +0100)]
[MLIR][PDL] Fix typo (NFC)
Nikita Popov [Thu, 17 Feb 2022 08:54:07 +0000 (09:54 +0100)]
[InstSimplify] Delay creation of constants for offsets (NFC)
Return APInt from stripAndComputeConstantOffsets(), and only
create corresponding Constants later, if we actually need them.
Martin Storsjö [Mon, 24 Jan 2022 22:25:41 +0000 (22:25 +0000)]
[libcxx] [test] Fix locale.time.get.byname get_date and get_date_wide on Windows
Also apply the same fix on glibc. This takes the test one step closer
to passing on glibc, but it still fails on the zh_CN test (which
requires a more involved fix in libc++ itself).
Differential Revision: https://reviews.llvm.org/D119791
Martin Storsjö [Tue, 25 Jan 2022 10:32:55 +0000 (10:32 +0000)]
[libcxx] [test] Fix the locale get_one_wide test for windows and glibc
Differential Revision: https://reviews.llvm.org/D119790
Martin Storsjö [Thu, 20 Jan 2022 09:30:57 +0000 (09:30 +0000)]
[libcxx] [test] Make the put_long_double test pass on mingw, clarify quirks in put_double
Expect the same NAN formatting on Windows as on Glibc. (Both MSVC and
MinGW produce the same formatting there.)
The hex float formatting tests pass on MinGW, so opt in to those tests.
Document exactly what issues are remaining in Clang-cl/MSVC
configurations. (It's easily possible to make the tests pass there too,
but it requires a whole lot of small-scope ifndefs in the test file;
around 60 ifdefs in total for those both test files. Those could
be avoided if the CI environment could run with a newer version
of UCRT, but that's nontrivial to fix right away.)
Differential Revision: https://reviews.llvm.org/D119766
Amir Ayupov [Thu, 17 Feb 2022 04:39:59 +0000 (20:39 -0800)]
[BOLT][NFC] Report errors from createBinaryContext and RewriteInstance ctor
Refactor createBinaryContext and RewriteInstance/MachORewriteInstance
constructors to report an error in a library and fuzzer-friendly way instead of
returning a nullptr or exiting.
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D119658
Marek Kurdej [Thu, 17 Feb 2022 08:45:52 +0000 (09:45 +0100)]
[clang-format] Fix wrong assertion with non-negative shift when aligning tokens.
Fixes https://github.com/llvm/llvm-project/issues/53880.
Nikita Popov [Thu, 17 Feb 2022 08:28:33 +0000 (09:28 +0100)]
[IndVars] Don't run full optimization pipeline in test (NFC)
This extracts the IR prior to IndVarSimplify and only runs the
single pass.
Ivan Butygin [Wed, 16 Feb 2022 12:38:14 +0000 (15:38 +0300)]
[mlir][gpu] Split ops sinking from gpu-kernel-outlining pass into separate pass
Previously `gpu-kernel-outlining` pass was also doing index computation sinking into gpu.launch before actual outlining.
Split ops sinking from `gpu-kernel-outlining` pass into separate pass, so users can use theirs own sinking pass before outlining.
To achieve old behavior users will need to call both passes: `-gpu-launch-sink-index-computations -gpu-kernel-outlining`.
Differential Revision: https://reviews.llvm.org/D119932
Pavel Kosov [Thu, 17 Feb 2022 07:21:22 +0000 (10:21 +0300)]
[NFC][compiler-rt] Format file lib/builtins/arm/sync-ops.h
Pavel Kosov [Thu, 17 Feb 2022 07:11:25 +0000 (10:11 +0300)]
[compiler-rt] Implement ARM atomic operations for architectures without SMP support
ARMv5 and older architectures don’t support SMP and do not have atomic instructions. Still they’re in use in IoT world, where one has to stick to libgcc.
Reviewed By: mstorsjo
Differential Revision: https://reviews.llvm.org/D116088
Damian Rouson [Fri, 12 Nov 2021 00:20:30 +0000 (16:20 -0800)]
[flang] add semantics test for sync images
Test a range of acceptable forms of SYNC IMAGES statements,
including combinations with and without the stat-variable
and errmsg-variable present. Also test that several invalid
forms of SYNC IMAGES call generate the correct error messages.
Differential Revision: https://reviews.llvm.org/D118933
Tom Stellard [Thu, 17 Feb 2022 06:18:03 +0000 (22:18 -0800)]
issue-release-workflow: Add support for /cherry-pick command in issue body
Reviewed By: kwk
Differential Revision: https://reviews.llvm.org/D119312
Shraiysh Vaishay [Thu, 17 Feb 2022 04:54:10 +0000 (10:24 +0530)]
[mlir] Added oilist primitive
This patch attempts to add the `oilist` primitive proposed in the [[ https://llvm.discourse.group/t/rfc-extending-declarative-assembly-format-to-support-order-independent-variadic-segments/4388 | RFC: Extending Declarative Assembly Format to support order-independent variadic segments ]].
This element supports optional order-independent variadic segments for operations. This will allow OpenACC and OpenMP Dialects to have similar and relaxed requirements while encouraging the use of Declarative Assembly Format and avoiding code duplication.
An oilist element parses grammar of the form:
```
clause-list := clause clause-list | empty
clause := `keyword` clause1 | `otherKeyword` clause2
clause1 := <assembly-format element>
clause2 := <assembly-format element>
```
AssemblyFormat specification:
```
let assemblyFormat = [{
oilist( `keyword` clause1
| `otherkeyword` clause2
...
)
}];
```
Example:
```
oilist( `private` `(` $arg0 `:` type($arg0) `)`
| `nowait`
| `reduction` custom<ReductionClause>($arg1, type($arg1)))
oilist( `private` `=` $arg0 `:` type($arg0)
| `reduction` `=` $arg1 `:` type($arg1)
| `firstprivate` `=` $arg3 `:` type($arg2))
```
Reviewed By: Mogball, rriddle
Differential Revision: https://reviews.llvm.org/D115215
Eugene Zhulenev [Thu, 17 Feb 2022 04:35:05 +0000 (20:35 -0800)]
[mlir] NFC Async: always use 'b' for the current builder
Currently some of the nested IR building inconsistently uses `nb` and `b`, it's very easy to call wrong builder outside of the current scope, so for simplicity all builders are always called `b`, and in nested IR building regions they just shadow the "parent" builder.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D120003
Damian Rouson [Thu, 11 Nov 2021 19:27:15 +0000 (11:27 -0800)]
[flang] add semantics test for sync all
Test a range of acceptable forms of SYNC ALL statements,
including combinations with and without the stat-variable
and errmsg-variable present. Also test that several invalid
forms of SYNC ALL call generate the correct error messages.
Differential Revision: https://reviews.llvm.org/D114181
Serguei Katkov [Tue, 15 Feb 2022 11:12:22 +0000 (18:12 +0700)]
[MemoryDependency] Relax the re-ordering of atomic store and unordered load/store
Atomic store with Release semantic allows re-ordering of unordered load/store before the store.
Implement it.
Reviewers: reames
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D119844
Jim Ingham [Thu, 17 Feb 2022 03:09:01 +0000 (19:09 -0800)]
On Windows, the function name contains the return parameter, so
the test has to be "function name contains the name we used to specify
the breakpoint" not IS the name...
Alex Brachet [Thu, 17 Feb 2022 03:00:17 +0000 (03:00 +0000)]
[libc] Use '+' constraint on inline assembly
As suggested by @mcgrathr in D118099
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D119978
Jim Ingham [Thu, 17 Feb 2022 01:46:53 +0000 (17:46 -0800)]
Add a test for breaking on overloaded functions by name.
V Donaldson [Wed, 16 Feb 2022 23:26:50 +0000 (15:26 -0800)]
[flang] Allow tabs as white space in formats
The fortran standard views blanks in IO formats as white space in
non-string contexts. Other compilers extend this to also view horizontal
tabs as white space. Some compilers additionally add other white space
characters to this group.
Add recognition of horizontal and vertical tabs to runtime format
validation code to match what the runtime code currently does.
Aart Bik [Thu, 17 Feb 2022 00:30:46 +0000 (16:30 -0800)]
[mlir][sparse] avoid some codeup in sparsification transformation
A very small refactoring, but a big impact on tests that expect an exact order.
This revision fixes the tests, but also makes them less brittle for similar
minor changes in the future!
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D119992
Amara Emerson [Wed, 16 Feb 2022 23:06:07 +0000 (15:06 -0800)]
[AArch64][GlobalISel] Implement support for clang.arc.attachedcall call operand bundles.
Differential Revision: https://reviews.llvm.org/D119983
Yonghong Song [Wed, 16 Feb 2022 19:54:38 +0000 (11:54 -0800)]
[BPF] Fix a BTF type pruning bug
In BPF backend, BTF type generation may skip
some debuginfo types if they are the pointee
type of a struct member. For example,
struct task_struct {
...
struct mm_struct *mm;
...
};
BPF backend may generate a forward decl for
'struct mm_struct' instead of full type if
there are no other usage of 'struct mm_struct'.
The reason is to avoid bringing too much unneeded types
in BTF.
Alexei found a pruning bug where we may miss
some full type generation. The following is an illustrating
example:
struct t1 { ... }
struct t2 { struct t1 *p; };
struct t2 g;
void foo(struct t1 *arg) { ... }
In the above case, we will have partial debuginfo chain like below:
struct t2 -> member p
\ -> ptr -> struct t1
/
foo -> argument arg
During traversing
struct t2 -> member p -> ptr -> struct t1
The corresponding BTF types are generated except 'struct t1' which
will be in FixUp stage. Later, when traversing
foo -> argument arg -> ptr -> struct t1
The 'ptr' BTF type has been generated and currently implementation
ignores 'pointer' type hence 'struct t1' is not generated.
This patch fixed the issue not just for the above case, but for
general case with multiple derived types, e.g.,
struct t2 -> member p
\ -> const -> ptr -> volatile -> struct t1
/
foo -> argument arg
Differential Revision: https://reviews.llvm.org/D119986
Alina Sbirlea [Thu, 17 Feb 2022 00:28:05 +0000 (16:28 -0800)]
[bazel] Add libc dependency.
Jez Ng [Thu, 17 Feb 2022 01:03:57 +0000 (20:03 -0500)]
[lld-macho] Don't include CommandFlags.h in CommonLinkerContext.h
Main motivation: including `llvm/CodeGen/CommandFlags.h` in
`CommonLinkerContext.h` means that the declaration of `llvm::Reloc` is
visible in any file that includes `CommonLinkerContext.h`. Since our
cpp files have both `using namespace llvm` and `using namespace
lld::macho`, this results in conflicts with `lld::macho::Reloc`.
I suppose we could put `llvm::Reloc` into a nested namespace, but in general,
I think we should avoid transitively including too many header files in
a very widely used header like `CommonLinkerContext.h`.
RegisterCodeGenFlags' ctor initializes a bunch of function-`static`
structures and does nothing else, so it should be fine to "initialize"
it as a temporary stack variable rather than as a file static.
Reviewed By: aganea
Differential Revision: https://reviews.llvm.org/D119913
Daniil Suchkov [Tue, 15 Feb 2022 23:46:21 +0000 (23:46 +0000)]
[RewriteStatepointsForGC] Add a test exposing an incorrect assertion
Heejin Ahn [Mon, 14 Feb 2022 23:13:07 +0000 (15:13 -0800)]
[WebAssembly] Make __wasm_lpad_context thread-local
This makes `__wasm_lpad_context`, a struct that is used as a
communication channel between compiler-generated code and personality
function in libunwind, thread local. The library code will be changed to
thread local in the emscripten side.
Reviewed By: sbc100, tlively
Differential Revision: https://reviews.llvm.org/D119803
Matt Arsenault [Mon, 14 Feb 2022 22:22:55 +0000 (17:22 -0500)]
AMDGPU: Always reserve VGPR for AGPR copies on gfx908
Just because there aren't AGPRs in the original program doesn't mean
the register allocator can't choose to use them (unless we were to
forcibly reserve all AGPRs if there weren't any uses). This happens in
high pressure situations and introduces copies to avoid spills.
In this test, the allocator ends up introducing a copy from SGPR to
AGPR which requires an intermediate VGPR. I don't believe it would
introduce a copy from AGPR to AGPR in this situation, since it would
be trying to use an intermediate with a different class.
Theoretically this is also broken on gfx90a, but I have been unable to
come up with a testcase.