1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00
Commit Graph

218896 Commits

Author SHA1 Message Date
Nikita Popov
b733414f37 [Cloning] Remove unused parameter from CloneAndPruneFunctionInto() (NFC) 2021-07-18 18:38:06 +02:00
Simon Pilgrim
edf89b43ae [X86] Add i32 (shl (sr[la] exact sel(X,Y), C1), C2) test
Shows failure to fold sel(sra(X,C1),sra(Y,C1)) -> sra(sel(X,Y),C1) (and to retain the flags)
2021-07-18 16:48:57 +01:00
Kazu Hirata
52cf78c743 [Analysis] Remove getLoopPackage (NFC)
The last use was removed on Apr 28, 2014 in commit
c5a3139ebd0d60617629da83c6c66261b66c75e5.
2021-07-18 08:16:29 -07:00
Simon Pilgrim
3a0faa0bb3 [NVPTX] Add select(cc,binop(),binop()) fast-math tests
As discussed on D106058 - we're not propagating the common flags to the merged binop
2021-07-18 15:30:24 +01:00
Valentin Churavy
814653b1a2 Revert "[Orc] Add verylazy example for C-bindings"
Broke ASAN buildbot, will reland with fixes

This reverts commit b5a6ad8c893a642bcb08ab81b251952c545405d9.
2021-07-18 16:21:37 +02:00
Simon Pilgrim
4c15994731 [DAG] Move select(cc, binop(), binop()) folds into DAGCombiner::foldSelectOfBinops. NFCI.
I'm going to extend the functionality started in D106058 so move the folds into their own method to reduce the amount of code in DAGCombiner::visitSELECT
2021-07-18 14:54:41 +01:00
Simon Pilgrim
1d449cdfe0 [X86][SSE] matchShuffleWithPACK - avoid poison pollution from bitcasting multiple elements together.
D106053 exposed that we've not been taking into account that by bitcasting smaller elements together and then performing a ComputeKnownBits on the result we'd be allowing a poison element to influence other neighbouring elements being used in the pack. Instead we now peek through any existing bitcast to ensure that the source type already matches the width source of the pack node we're trying to match.

This has also been a chance to stop matchShuffleWithPACK creating unused nodes on the fly which could affect oneuse tests during shuffle lowering/combining.

The only regression we're seeing is due to being unable to peek through a bitcast as its on the other side of a extract_subvector - which should go away once we finally allow shuffle combining across different vector widths (by making matchShuffleWithPACK using const SelectionDAG& we've gotten closer to this - see PR45974).
2021-07-18 14:25:28 +01:00
Simon Pilgrim
291305b767 [Orc] Remove unnecessary <string> include dependency from Orc headers. NFC.
At most these use the StringRef/Twine wrappers and don't have any implicit uses of std::string.

Move the include down to any cpp implementation where std::string is actually used.
2021-07-18 12:31:13 +01:00
Sanjay Patel
8921c5a885 [InstCombine] fold reassociative FP add into start value of fadd reduction
This pattern is visible in unrolled and vectorized loops.
Although the backend seems to be able to reassociate to
ideal form in the examples I looked at, we might as well
do that in IR for efficiency.
2021-07-18 06:26:20 -04:00
Sanjay Patel
1f0abe2070 [InstCombine][test] add tests for fadd reductions; NFC 2021-07-18 06:26:20 -04:00
Valentin Churavy
3f3bee8a2c [Orc] Add verylazy example for C-bindings
Still WIP, based on the Kaleidoscope/BuildingAJIT/Chapter4.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D104799
2021-07-18 12:07:16 +02:00
Craig Topper
ab75fa9a34 [RISCV] Add more i32 srem/sdiv with power of 2 constant tests. NFC
Add a small power 2 srem test to match existing sdiv test. Add
larger power of 2 test to both.

The larger constant test shows materialization of a constant
for an AND in the RV64 code. We should be using W shift instructions
to match the RV32 code.
2021-07-18 00:21:14 -07:00
Amara Emerson
71177b0c4c [GlobalISel] Fix known bits for G_BSWAP and B_BITREVERSE not doing anything.
llvm::KnownBits::byteSwap() and reverse() don't modify in-place, so
we weren't actually computing anything. This was causing a miscompile on an
arm64 stage2 bootstrap clang build.
2021-07-17 23:07:16 -07:00
Jon Roelofs
970c655f5e [AArch64][GlobalISel] Legalize bswap <2 x i16>
Differential revision: https://reviews.llvm.org/D105935
2021-07-17 15:31:15 -07:00
David Green
cd0a482d93 [ARM] Lower non-extended small gathers via truncated gathers.
Corollary to 1113e06821e6baffc84b8caf96a28bf62e6d28dc this allows us to
match gather that dont produce a full vector width results. They use an
extended gather which is truncated back to the original type.
2021-07-17 22:38:31 +01:00
Eli Friedman
d7fd0583bf [AArch64] Prepare for changes to STEP_VECTOR.
Rewrite patterns to assume that the operand of STEP_VECTOR is a
constant. The old patterns will stop working when the operand is changed
from a Constant to a TargetConstant. (See D105673.)

Add test coverage for certain patterns that weren't exercised by
existing regression tests.

Differential Revision: https://reviews.llvm.org/D105847
2021-07-17 14:13:41 -07:00
Nikita Popov
055fa09f2c [IRBuilder] Deprecate CreateGEP() without element type
This API is incompatible with opaque pointers and deprecated in
favor of the version that accepts an explicit element type.

Also remove the separate overload for a single index, as this is
already covered by the ArrayRef overload.
2021-07-17 22:57:51 +02:00
Nikita Popov
17b52c557b [OpaquePtr] Remove uses of CreateGEP() without element type
Remove uses of to-be-deprecated API. In cases where the correct
element type was not immediately obvious to me, fall back to
explicit getPointerElementType().
2021-07-17 22:56:27 +02:00
Nikita Popov
0ad9d5a362 [IRBuilder] Deprecate CreateInBoundsGEP() without element type
This API is incompatible with opaque pointers and deprecated in
favor of the version that accepts an explicit element type.
2021-07-17 21:27:16 +02:00
Craig Topper
f02d48e3e1 [RISCV] Teach computeKnownBitsForTargetNode that VLENB will never be more than 65536/8. 2021-07-17 11:24:20 -07:00
Shilei Tian
21ccc39fd4 [AbstractAttributor] Fix two issues in folding __kmpc_is_spmd_exec_mode
This patch fixed two issues found when folding `__kmpc_is_spmd_exec_mode`:
1. When the reaching kernels are empty, it should not fold to generic mode.
2. When creating AA for the caller when updating information, the dependency
   should be required.

Reviewed By: ye-luo

Differential Revision: https://reviews.llvm.org/D106209
2021-07-17 13:13:44 -04:00
Nikita Popov
34f02d0dc5 [IRBuilder] Deprecate CreateStructGEP() without element type
This API is incompatible with opaque pointers and deprecated in
favor of the version that accepts an explicit element type.
2021-07-17 18:48:22 +02:00
ShihPo Hung
5fa3648477 [RISCV][RVV] Precommit a test case for D105684
Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D105685
2021-07-18 00:43:17 +08:00
Nikita Popov
d5f69c8caa [IRBuilder] Deprecate CreateConstGEP1_32() without element type
This API is incompatible with opaque pointers and deprecated in
favor of the version that accepts an explicit element type.
2021-07-17 18:32:36 +02:00
Nikita Popov
2c50f2c7e2 [OpaquePtr] Remove uses of CreateConstGEP1_32() without element type
Remove uses of to-be-deprecated API. I've fallen back to calling
getPointerElementType() in some cases where the correct type wasn't
immediately obvious to me.
2021-07-17 18:32:36 +02:00
Simon Pilgrim
cacf8c90b2 [DebugInfo] Remove unnecessary <string> include dependency from DebugInfo headers. NFC.
At most these use the StringRef/Twine wrappers and don't have any implicit uses of std::string.

Move the include down to any cpp implementation where std::string is actually used.
2021-07-17 16:56:06 +01:00
Nikita Popov
db4c85d791 [IRBuilder] Deprecate CreateConstInBoundsGEP1_64() without element type
This API is incompatible with opaque pointers and deprecated in
favor of the version that accepts an explicit element type.
2021-07-17 17:07:48 +02:00
Nikita Popov
ffc0273ec4 [IRBuilder] Deprecate CreateConstGEP1_64() without element type
This API is incompatible with opaque pointers and deprecated in
favor of the version that accepts an explicit element type.
2021-07-17 16:43:42 +02:00
Nikita Popov
2e74b1c954 [OpaquePtr] Remove uses of CreateConstGEP1_64() without element type
Remove uses of to-be-deprecated API.
2021-07-17 16:43:20 +02:00
Nikita Popov
923a0b4995 [IRBuilder] Deprecate CreateConstInBoundsGEP2_64() without element type
This API is incompatible with opaque pointers and deprecated in
favor of the version that accepts an explicit element type.
2021-07-17 16:42:39 +02:00
Nikita Popov
0911b5db54 [IRBuilder] Deprecate CreateConstGEP2_64() without element type
This API is incompatible with opaque pointers and deprecated in
favor of the version that accepts an explicit element type.
2021-07-17 16:41:51 +02:00
Kazu Hirata
a471532d2a [Analaysis, CodeGen] Remove getHotSucc (NFC)
These functions seem to be unused for at least 5 years.
2021-07-17 07:31:36 -07:00
Nikita Popov
afb69b12ce [IR] Don't accept null type in ConstantExpr::getGetElementPtr()
This is the same change as D105653, but for the constant expression
version of the API.
2021-07-17 15:59:31 +02:00
Nikita Popov
dd3e030cca [BPF] Use elementtype attribute for preserve.array/struct.index intrinsics
Use the elementtype attribute introduced in D105407 for the
llvm.preserve.array/struct.index intrinsics. It carries the
element type of the GEP these intrinsics effectively encode.

This patch:

 * Adds a verifier check that the attribute is required.
 * Adds it in the IRBuilder methods for these intrinsics.
 * Autoupgrades old bitcode without the attribute.
 * Updates the lowering code to use the attribute rather than
   the pointer element type.
 * Updates lots of tests to specify the attribute.
 * Adds -force-opaque-pointers to the intrinsic-array.ll test
   to demonstrate they work now.

https://reviews.llvm.org/D106184
2021-07-17 11:09:18 +02:00
Craig Topper
b2f709390a [RISCV] Manually emit the best shift for VSCALE lowering to improve codegen.
We assume VLENB is a multiple of 8 and previously relied on shift
pairs being optimized to an AND+SHL/SHR and computeKnownBits
removing the AND. This doesn't happen if (vlenb >> 3) gets CSEd
to have multiple uses. This patch manually emits the best shift
to workaround this.
2021-07-17 00:52:07 -07:00
Lang Hames
7bb42fce5b [ORC] Fix typo in declaration 2021-07-17 16:10:15 +10:00
jacquesguan
fa273ae7c0 [RISCV] Make VLEN no greater than 65536
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D106134
2021-07-17 12:47:46 +08:00
Lang Hames
81a5e12cd4 [ORC] Remove LLVM-side MachO Platform runtime support.
Support for this functionality is moving to the ORC runtime.
2021-07-17 14:25:31 +10:00
Carl Ritson
9ee7bab63e [AMDGPU] Tidy SReg/SGPR definitions using template class
Use a multiclass to consistently define SReg/SGPR/TTMP register classes.
Add missing TTMP registers for 96b, 160b, 192b, 224b.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D105800
2021-07-17 11:26:46 +09:00
Kazu Hirata
54c34b405b [Analysis] Remove isJoinDivergent (NFC)
The last use was removed on Sep 30, 2020 in commit
05ae04c396519cca9ef50d3b9cafb0cd9c87d1d7.
2021-07-16 18:23:17 -07:00
Wenlei He
51dcfc6119 [CSSPGO] Turn on iterative-BFI for CSSPGO
Iterative-BFI produces better count quality and performance when evaluated on internal benchmarks. Turning it on by default now for CSSPGO. We can consider turn it on by default for AutoFDO as well in the future.

Differential Revision: https://reviews.llvm.org/D106202
2021-07-16 17:35:49 -07:00
Matt Arsenault
acc2bc5604 Mips/GlobalISel: Remove leftover dead code 2021-07-16 20:20:55 -04:00
Matt Arsenault
c82a5efc23 AMDGPU/GlobalISel: Add a few tests for struct arguments
Test structs with pointers and vectors of pointers since this stresses
a future patch.
2021-07-16 20:20:55 -04:00
Matt Arsenault
ddf5067ad7 AMDGPU/GlobalISel: Fix some incorrect memory types in tests 2021-07-16 20:20:55 -04:00
Eli Friedman
05a71b0a6d [ScalarEvolution] Fix overflow in computeBECount.
The current implementation of computeBECount doesn't account for the
possibility that adding "Stride - 1" to Delta might overflow. For almost
all loops, it doesn't, but it's not actually proven anywhere.

To deal with this, use a variety of tricks to try to prove that the
addition doesn't overflow.  If the proof is impossible, use an alternate
sequence which never overflows.

Differential Revision: https://reviews.llvm.org/D105216
2021-07-16 16:15:18 -07:00
Joel E. Denny
3fdd4ff2ee [lit] Add --xfail-not/LIT_XFAIL_NOT
For example, I need this lately in my CI config:

LIT_XFAIL_NOT='libomptarget :: nvptx64-nvidia-cuda :: unified_shared_memory/api.c'

That test specifies an XFAIL directive, but I get an XPASS result.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D106022
2021-07-16 19:13:34 -04:00
Mehdi Amini
736e0957dc Revert "Build libSupport with -Werror=global-constructors (NFC)"
This reverts commit 1f71bcabb77df482cc0dc7bab90a73e15f3e347b.

Some platform have global destructors for std::mutex that still
needs to be fixed.
2021-07-16 22:47:04 +00:00
Mehdi Amini
e0b66fa459 Build libSupport with -Werror=global-constructors (NFC)
Ensure that libSupport does not carry any static global initializer.
libSupport can be embedded in use cases where we don't want to load all
cl::opt unless we want to parse the command line.
ManagedStatic can be used to enable lazy-initialization of globals.
2021-07-16 22:25:03 +00:00
David Green
37fc7e01a1 [ARM] Fix for matching reductions that are both sext and zext.
Fix a silly mistake that was not making sure that _both_ operands were
the correct extend code.
2021-07-16 23:11:42 +01:00
Sami Tolvanen
36181914fb Revert "ThinLTO: Fix inline assembly references to static functions with CFI"
This reverts commit 8e3b5cb39eef462943ed7556469604ce25c07a1d.

Reverting to investigate test failures.
2021-07-16 14:47:33 -07:00