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

218689 Commits

Author SHA1 Message Date
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
Sami Tolvanen
8f7be7105b ThinLTO: Fix inline assembly references to static functions with CFI
Create an internal alias with the original name for static functions
that are renamed in promoteInternals to avoid breaking inline
assembly references to them. This version uses module inline assembly
to avoid issues with LowerTypeTestsModule.

Link: https://github.com/ClangBuiltLinux/linux/issues/1354

Reviewed By: nickdesaulniers, pcc

Differential Revision: https://reviews.llvm.org/D104058
2021-07-16 14:33:34 -07:00
Nemanja Ivanovic
b425bc6346 [PowerPC] Implement intrinsics for mtfsf[i]
This provides intrinsics for emitting instructions that set the FPSCR (`mtfsf/mtfsfi`).

The patch also conservatively marks the rounding mode as an implicit def for both since they both may set the rounding mode depending on the operands.

Reviewed By: #powerpc, qiucf

Differential Revision: https://reviews.llvm.org/D105957
2021-07-16 16:26:11 -05:00
Alexey Bataev
c5ddf465d0 [SLP]Improve calculations of the cost for reused/reordered scalars.
Part of D105020. Also, fixed FIXMEs that need to use wider vector type
when trying to calculate the cost of reused scalars. This may cause
regressions unless D100486 is landed to improve the cost estimations
for long vectors shuffling.

Differential Revision: https://reviews.llvm.org/D106060
2021-07-16 13:40:15 -07:00
LLVM GN Syncbot
f738f3fd22 [gn build] Port 0bf4b81d57b0 2021-07-16 20:32:47 +00:00
Amara Emerson
5504495d30 [GlobalISel] Fix non-pow-2 legalization of s56 stores.
s56 stores are broken down into s32 + s24 stores. During this step
both of those new stores use an anyextended s64 value, resulting in
truncating stores. With s56, the s24 requires another lower step to
make it legal, and we were crashing because we didn't expect non-pow-2
stores to also be truncating as well.

Differential Revision: https://reviews.llvm.org/D106183
2021-07-16 13:29:49 -07:00
Alexey Bataev
6af5a23481 [PATCH] D105827: [SLP]Workaround for InsertSubVector cost.
The cost of the InsertSubvector shuffle kind cost is not complete and
may end up with just extracts + inserts costs in many cases. Added
a workaround to represent it as a generic PermuteSingleSrc, which is
still pessimistic but better than InsertSubvector.

Differential Revision: https://reviews.llvm.org/D105827
2021-07-16 12:59:08 -07:00
Nico Weber
1fea8de18b [gn build] (semi-manually) port 6a4054ef060b 2021-07-16 15:54:13 -04:00