23890 Commits

Author SHA1 Message Date
chenglin.bi
f297332749 [InstSimplify] Fold (X || Y) ? X : Y --> X
(X || Y) ? X : Y --> X
https://alive2.llvm.org/ce/z/oRQJee

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D138815
2022-11-30 10:14:17 +08:00
William Huang
be4b1dd35b [InstCombine] Revert D125845
Reverting D125845 `[InstCombine] Canonicalize GEP of GEP by swapping constant-indexed GEP to the back` because multiple users reported performance regression

Reviewed By: davidxl

Differential Revision: https://reviews.llvm.org/D138950
2022-11-29 22:02:40 +00:00
Guillaume Chatelet
3e6001e91e [Coroutines] createStructType takes alignment in bits but receives bytes
This has been found while trying to remove the last few places relying on `unsigned` to convey alignment operations.
This seems to be untested.

Differential Revision: https://reviews.llvm.org/D138784
2022-11-29 16:05:06 +00:00
Alexey Bataev
0cc15050a4 [SLP]Fix PR59230: Use actual vector factor when sorting entries.
When we sort entries for attempting to reorder scalars, need to use
actual vectorization factor, not the number of scalars. Otherwise the
compiler crashes, if the scalars has to be reordered.

Differential Revision: https://reviews.llvm.org/D138819
2022-11-29 06:46:06 -08:00
chenglin.bi
1fd4d91fa6 [InstSimplify] Fold !(X || Y) && X --> false
!(X || Y) && X --> false
https://alive2.llvm.org/ce/z/693Jgv

Fix: [56654](https://github.com/llvm/llvm-project/issues/56654)
Fix: [56780](https://github.com/llvm/llvm-project/issues/56780)

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D138853
2022-11-29 22:45:24 +08:00
chenglin.bi
0752fb57e4 [InstSimplify] Fold (X || Y) ? false : X --> false
(X || Y) ? false : X --> false
https://alive2.llvm.org/ce/z/y93yUm

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D138700
2022-11-29 22:08:50 +08:00
Bjorn Pettersson
0676acb6fd [test] Switch to use -passes syntax in a bunch of test cases
Should cover most of the tests for GVN, GVNHoist, GVNSink, GlobalOpt,
GlobalSplit, InstCombine, Reassociate, SROA and TailCallElim that
had not been updated earlier.
2022-11-29 13:29:02 +01:00
Guillaume Chatelet
543962f024 [Coroutine] Update test to demonstrate bug (D138784) 2022-11-29 12:28:16 +00:00
bipmis
e9393789a9 [AggressiveInstCombine] Handle the insert point of the merged load correctly.
This patch updates the load insert point of the merged load in AggressiveInstCombine().
This is done to handle the reported test breaks by handling Alias Analysis correctly.

Differential Revision: https://reviews.llvm.org/D137201
2022-11-29 10:53:51 +00:00
Simon Tatham
e45cbf9923 [ARM,MVE] Update MVE_VMLA_qr for architecture change.
In revision B.q and before of the Armv8-M architecture reference
manual, the vector/scalar forms of the `vmla` and `vmlas` instructions
came in signed and unsigned integer forms, such as `vmla.s8 q0,q1,r2`
or `vmlas.u32 q3,q4,r5`.

Revision B.r has changed this. There are no longer signed and unsigned
versions of these instructions, since they were functionally identical
anyway. Now there is just `vmla.i8` (or `i16` or `i32`, and similarly
for `vmlas`). Bit 28 of the instruction encoding, which was previously
0 for signed or 1 for unsigned, is now expected to be 0 always.

This change updates LLVM to the new version of the architecture. The
obsoleted encodings for unsigned integers are now decoding errors, and
only the still-valid encoding is ever emitted. This shouldn't break
any existing assembly code, because the old signed and unsigned
versions of the mnemonic are still accepted by the assembler (which is
standard practice anyway for all signedness-agnostic MVE integer
instructions).

Reviewed By: dmgreen, lenary

Differential Revision: https://reviews.llvm.org/D138827
2022-11-29 08:47:00 +00:00
Dmitry Makogon
a580d2e430 [Test] Update tests for LoopPredication constant ranges widening 2022-11-29 14:09:47 +07:00
Florian Hahn
bf15f1e489
Revert "[VPlan] Add VPDerivedIVRecipe, use for VPScalarIVStepsRecipe."
This reverts commit 0fa666ecedc3f36471c0fee925d664512e7525a8.

This triggers an assertion during AArch64 stage2 builds. Revert while I
investigate.

See https://lab.llvm.org/buildbot/#/builders/179/builds/4967/steps/11/logs/stdio
2022-11-28 22:43:11 +00:00
Mircea Trofin
255e7e1c21 [UpdateTestChecks] Fix update_*_test_checks.py to add "unused" prefixes
The support introduced in D124306 was only added to
update_llc_test_checks.py, but the motivating usecases (see
https://lists.llvm.org/pipermail/llvm-dev/2021-February/148326.html)
cover update_test_checks.py, update_cc_test_checks.py, and
update_analyze_test_checks.py, too.

Issue #59220.

Differential Revision: https://reviews.llvm.org/D138836
2022-11-28 13:24:32 -08:00
Sanjay Patel
c7bd82dfd8 [PhaseOrdering] add test for vector load combining; NFC
This is another example from issue #17113
2022-11-28 16:00:06 -05:00
chenglin.bi
0869a96ca9 [InstSimplify] add precommit test for pattern !(X || Y) && X --> false; NFC 2022-11-29 04:07:43 +08:00
chenglin.bi
52dd5b6e95 [InstSimplify] add precommit test for pattern (X || Y) ? false : X -> false; NFC 2022-11-29 03:47:34 +08:00
Arthur Eubanks
4b3202e639 [opt] Remove "new-pm" from some cl::opt names 2022-11-28 11:00:45 -08:00
Philip Reames
db07d79ab0 [RISCV] Add cost model for integer and float vector arithmetic instructions.
This patch implements getArithmeticInstrCost for RISCV, supports cost
model for integer and float vector arithmetic instructions.

Differential Revision: https://reviews.llvm.org/D133552 (Original patch by jacquesguan.  Subset by me with todos added.)
2022-11-28 09:04:38 -08:00
Florian Hahn
6a834d2f2b
[ConstraintElim] Use collectOffset instead of custom GEP idx iteration.
Use collectOffset to collect scaled indices and constant offset for GEP
instead of custom code. This simplifies the logic in decomposeGEP and
allows to handle all cases supported by the generic helper.
2022-11-28 16:54:58 +00:00
Florian Hahn
0fa666eced
[VPlan] Add VPDerivedIVRecipe, use for VPScalarIVStepsRecipe.
This patch splits off the logic to transform the canonical IV to a
a value for an induction with a different start and step. This
transformation only needs to be done once (independent of VF/UF) and
enables sinking of VPScalarIVStepsRecipe as follow-up.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D133758
2022-11-28 16:32:31 +00:00
bipmis
ee53abb070 Add more tests for Reverse Load and AA testing 2022-11-28 15:34:26 +00:00
Qiongsi Wu
f946c70130 [SLPVectorizer] Do Not Move Loads/Stores Beyond Stacksave/Stackrestore Boundaries
If left unchecked, the SLPVecrtorizer can move loads/stores below a stackrestore. The move can cause issues if the loads/stores have pointer operands from `alloca`s that are reset by the stackrestores. This patch adds the dependency check.

The check is conservative, in that it does not check if the pointer operands of the loads/stores are actually from `alloca`s that may be reset. We did not observe any SPECCPU2017 performance degradation so this simple fix seems sufficient.

The test could have been added to `llvm/test/Transforms/SLPVectorizer/X86/stacksave-dependence.ll`, but that test has not been updated to use opaque pointers. I am not inclined to add tests that still use typed pointers, or to refactor `llvm/test/Transforms/SLPVectorizer/X86/stacksave-dependence.ll` to use opaque pointers in this patch. If desired, I will open a different patch to refactor and consolidate the tests.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D138585
2022-11-28 10:00:29 -05:00
chenglin.bi
617be4f37b [InstSimplify] Add precommit tests for select+or patterns; NFC 2022-11-28 22:58:39 +08:00
Matt Arsenault
ff37529298 GCOVProfiling: Convert tests to opaque pointers
function-numbering.ll was a special case where the checks are for a
new function which does have unnecessary GEPs with 0 indices.
2022-11-28 09:50:37 -05:00
Matt Arsenault
1f45517f37 InstMerge: Convert tests to opaque pointers 2022-11-28 09:49:08 -05:00
Matt Arsenault
92adfdba4e NameAnonGlobals: Convert tests to opaque pointers 2022-11-28 09:35:58 -05:00
Matt Arsenault
ebdf5aefcb FunctionSpecialization: Convert tests to opaque pointers 2022-11-28 09:35:48 -05:00
Matt Arsenault
60ea938ec0 IndirectBrExpand: Convert test to opaque pointers 2022-11-28 09:35:37 -05:00
Matt Arsenault
4b53f86670 GuardWidening: Convert tests to opaque pointers 2022-11-28 09:35:27 -05:00
Matt Arsenault
631432a3f5 IRCE: Convert tests to opaque pointers 2022-11-28 09:35:16 -05:00
Matt Arsenault
5c6453eb18 PlaceSafepoints: Convert tests to opaque pointers 2022-11-28 09:35:04 -05:00
Matt Arsenault
c59229bbad RelLookupTableConverter: Convert tests to opaque pointers 2022-11-28 09:34:56 -05:00
Matt Arsenault
afeaf279d3 StripSymbols: Convert tests to opaque pointers 2022-11-28 09:34:38 -05:00
Matt Arsenault
ceed9db4cf SyntheticCountsPropagation: Convert tests to opaque pointers 2022-11-28 09:34:34 -05:00
Matt Arsenault
8dc14a3bc0 TailCallElim: Convert tests to opaque pointers
This was painless and all converted by the script fine.
2022-11-28 09:34:26 -05:00
Matt Arsenault
d9e51e7552 CodeGenPrepare: Convert most tests to opaque pointers
NVPTX/dont-introduce-addrspacecast.ll required manually removing a check for
a bitcast.

AArch64/combine-address-mode.ll required rerunning update_test_checks

Mips required some manual updates due to a CHECK-NEXT coming after a
deleted bitcast.

ARM/sink-addrmode.ll needed one small manual fix.

Excludes one X86 function which needs more attention.
2022-11-28 09:21:59 -05:00
Matt Arsenault
9e5fa4b405 ScalarizeMaskedMemIntrin: Convert tests to opaque pointers
This was as easy as running the script and running
update_test_checks. I did notice the pass produces some GEPs with 0
indexes, such that running the opaquify script a second time produces
a diff.
2022-11-28 09:08:31 -05:00
Matt Arsenault
db4fff9255 LowerInvoke: Convert tests to opaque pointers 2022-11-28 09:08:31 -05:00
Matt Arsenault
048831ef74 LowerGuardIntrinsic: Convert tests to opaque pointers 2022-11-28 09:08:31 -05:00
Matt Arsenault
c353d8f49b LowerGlobalDestructors: Convert tests to opaque pointers 2022-11-28 09:08:31 -05:00
Matt Arsenault
393759933c DivRemPairs: Convert tests to use opaque pointers 2022-11-28 09:08:31 -05:00
Matt Arsenault
47f25462c8 LowerExpectIntrinsic: Convert tests to opaque pointers 2022-11-28 09:08:31 -05:00
Matt Arsenault
e472cf7f10 LowerConstantIntrinsics: Convert tests to opaque pointers 2022-11-28 09:08:31 -05:00
Matt Arsenault
d17f4f267d HardwareLoops: Convert tests to opaque pointers 2022-11-28 09:08:31 -05:00
Matt Arsenault
b1dbc0a24c PartialInlining: Convert tests to opaque pointers
Once again the script decided to delete an llvm.assume declaration
which I manually restored.
2022-11-28 09:08:30 -05:00
Matt Arsenault
143ca74ed3 AtomicExpand: Convert tests to opaque pointers 2022-11-28 08:43:16 -05:00
Matt Arsenault
a198d2041e Sink: Convert tests to opaque pointers 2022-11-28 08:42:52 -05:00
Matt Arsenault
833557a6e4 DCE: Update tests to use opaque pointers
basic.ll:test_lifetime_bitcast is a strange case. The comment says
it's trying to keep the lifetime intrinsics for bitcasts. Leave a
dummy bitcast for now to keep it happy.
2022-11-28 08:42:06 -05:00
Matt Arsenault
5abcc5b38a PreISelIntrinsicLowering: Convert tests to opaque pointers 2022-11-28 08:41:31 -05:00
Matt Arsenault
a42b0ca3b8 SpeculativeExecution: Convert tests to opaque pointers 2022-11-28 08:41:31 -05:00