23890 Commits

Author SHA1 Message Date
Matt Arsenault
64539b178f Reg2Mem: Convert tests to opaque pointers 2022-11-28 08:41:31 -05:00
Matt Arsenault
9daaaad9cf Mem2Reg: Convert tests to opaque pointers
This was a painless conversion.
2022-11-28 08:41:31 -05:00
Bjorn Pettersson
2cb02f2385 [Mem2Reg] Switch tests to use opt -passes
Also added FileCheck verification to three old tests that only
verified that we did not crash.
2022-11-28 12:12:49 +01:00
Matt Arsenault
256d5ad3e8 LowerMatrixIntrinsics: Convert tests to opaque pointers
store-align-volatile.ll needed manually updated check lines for a
-NEXT check after a deleted bitcast.

Also avoided breaking the example C++ comment in remarks-inlining.ll
2022-11-27 21:42:25 -05:00
Matt Arsenault
5e3a5d163d HotColdSplit: Convert tests to opaque pointers
For some reason the script was deleting the assume declaration in
assumption-cache-invalidation.ll, so fixed that manually.
2022-11-27 21:42:00 -05:00
Matt Arsenault
06612123dc NaryReassociate: Convert tests to opaque pointers
NVPTX/nary-gep.ll had one test that checked for a deleted bitcast
which needed to be updated manually.
2022-11-27 21:41:53 -05:00
Matt Arsenault
bcabf0a51f StraightLineStrengthReduce: Convert tests to opaque pointers
Required some manual updates in AMDGPU/pr23975.ll and
slsr-gep.ll. pr23975.ll had another offset 0 GEP that probably should
not have been deleted.
2022-11-27 21:29:33 -05:00
Matt Arsenault
0d2271bb44 SampleProfile: Convert tests to opaque pointers
syntax.ll required removing some diffs that apparently looked like
pointers in message checking.
2022-11-27 21:27:50 -05:00
Matt Arsenault
1c55cc600e PhaseOrdering: Convert tests to opaque pointers
Required manually running update_test_checks:
  AArch64/hoisting-sinking-required-for-vectorization.ll
  AArch64/peel-multiple-unreachable-exits-for-vectorization.ll
  ARM/arm_mult_q15.ll
  X86/hoist-load-of-baseptr.ll
  X86/spurious-peeling.ll
2022-11-27 21:26:41 -05:00
Matt Arsenault
3dc20f0160 Scalarizer: Convert tests to opaque pointers 2022-11-27 21:26:20 -05:00
Fangrui Song
34ade57019 PGOProfile: Convert tests to opaque pointers 2022-11-27 18:13:09 -08:00
Matt Arsenault
8570893cfd GlobalDCE: Convert tests to opaque pointers
The script mangled both virtual-functions-base-pointer-call.ll and
virtual-functions-derived-pointer-call.ll pretty badly, deleting the
run line and most of the block comment.

Replaced the bitcast with and addrspacecast in 2002-07-17-CastRef.ll,
based on the apparent intent of the test.

For 2003-07-01-SelfReference.ll, the script produced "call ptr ()
@getfunc" which surprisingly parses as valid.
2022-11-27 21:07:27 -05:00
Matt Arsenault
1c6b674473 LowerAtomic: Convert tests to opaque pointers 2022-11-27 20:53:57 -05:00
Matt Arsenault
4cbab1e5ff SeparateConstOffsetFromGEP: Update tests to use opaque pointers
NVPTX/split-gep.ll needed a check for a bitcast replaced.
2022-11-27 20:53:52 -05:00
Matt Arsenault
d1c0092163 SeparateConstOffsetFromGEP: Fix creating pointless bitcasts
This was directly creating new BitCastInsts, so under opaque pointers,
would end up producing bitcast from ptr to ptr.
2022-11-27 20:53:48 -05:00
Matt Arsenault
e8d4550813 SeparateConstOffsetFromGEP: Add baseline test for opaque pointers
This currently emits a pointless bitcast.
2022-11-27 20:53:43 -05:00
Matt Arsenault
8ff9bdb8e2 Utils: Update tests for opaque pointers
Also use -disable-output
2022-11-27 20:29:13 -05:00
Matt Arsenault
13fc189fe1 SafeStack: Convert tests to opaque pointers
X86/struct.ll, X86/array.ll and X86/array-aligned required manual
updates to reorder instructions.
2022-11-27 20:28:55 -05:00
Matt Arsenault
bf6f82a9df StructurizeCFG: Convert tests to opaque pointers 2022-11-27 20:26:16 -05:00
Matt Arsenault
5651af896c InferAddressSpaces: Switch tests to use opt -passes 2022-11-27 20:26:16 -05:00
Matt Arsenault
a982f09567 InferAddressSpaces: Convert tests to opaque pointers
Had constantexprs be mangled by the opaquify script; had to update
those lines manually:
  NVPTX/bug31948.ll
  AMDGPU/old-pass-regressions.ll
  AMDGPU/old-pass-regressions-inseltpoison.ll
  AMDGPU/infer-address-space.ll

Required re-reunning update_test_checks:
  AMDGPU/redundant-addrspacecast.ll

In AMDGPU/insert-pos-assert.ll, bitcast_insert_pos_assert_2 deleted a
getelementptr of 0 which I'm guessing was relevant. Replaced with an
offset 1 GEP to ensure another addrspacecast is inserted.

AMDGPU/infer-getelementptr.ll had one case improve by introducing an
inbounds.
2022-11-27 20:26:16 -05:00
Roman Lebedev
4bcab22578
[NFC][InstCombine] Drop "unused" check prefixes in newly added test 2022-11-27 22:21:29 +03:00
Roman Lebedev
8a85fa68c7
Fixup last commit - actually stage check line updates 2022-11-27 21:58:36 +03:00
Roman Lebedev
242798c31c
[NFC][InstCombine] Add test coverage for potential fold 2022-11-27 21:57:43 +03:00
Matt Arsenault
f452c9622f Reassociate: Convert tests to opaque pointers
canonicalize-neg-const.ll had some issues. The script somehow decided
to delete half the run line and merge it with the example expression
(which it also deleted most of).
2022-11-27 13:14:53 -05:00
Matt Arsenault
b6909fe9ca JumpThreading: Modernize some test checking
Stop using tests with grep, or no output checks at all. Just use
FileCheck and generate checks. Also remove unnecessary requires
asserts.
2022-11-27 12:41:28 -05:00
Matt Arsenault
07e34d2de5 JumpThreading: Convert tests to -passes 2022-11-27 11:19:28 -05:00
Matt Arsenault
83d5052768 JumpThreading: Convert tests to opaque pointers
phi-known.ll:test2 required deleting one manual check for a bitcast

Also strip trailing whitespace while we're touching everything.
2022-11-27 11:19:28 -05:00
Matt Arsenault
d0fea14d42 Scalarizer: Fix fragile test of constant pointer
It was using a bitcast instruction of a global to test a constant
pointer. After the opaquify script, the test would fold away to
nothing. Add some return uses, and try to test constant base pointers
more meaningfully.
2022-11-27 10:48:25 -05:00
Matt Arsenault
e446d1d93f CodeGenPrepare: Don't use anonymous values some in tests
These are always an obstacle to test updates, and often break after
running opaquify scripts on them.
2022-11-27 10:30:37 -05:00
Matt Arsenault
8824318512 X86: Make test check more precise
This is really checking an i8*, not an i8.
2022-11-27 10:17:38 -05:00
Matt Arsenault
ffb20958cd CodeGenPrepare: Don't use undef base pointers in addressing mode test
This broke after the opaquify script.
2022-11-27 10:15:31 -05:00
Matt Arsenault
926bba1424 SeparateConstOffsetFromGEP: Switch tests to use -passes 2022-11-27 10:09:58 -05:00
Matt Arsenault
32b4d477f8 Utils: Fix assume builder test using old name of null_pointer_is_valid
Presumably this hasn't been testing the right thing since the
attribute was moved from a string attribute.
2022-11-27 10:09:58 -05:00
Matt Arsenault
a7749864c0 Utils: Don't use anonymous values in test
These interefered with opaque pointer conversion
2022-11-27 09:40:43 -05:00
Matt Arsenault
6437e04f0f HotColdSplit: Don't use anonymous values in test
These were interfering with the conversion to opaque pointers
2022-11-27 09:40:22 -05:00
Matt Arsenault
5e49649d16 SampleProfile: Don't use anonymous values in test
These interfered with converting the test to opaque pointers.
2022-11-27 09:40:00 -05:00
Matt Arsenault
16663d8ab3 IndirectCallPromotion: Fix illegal promotion with opaque pointers
This was doing a type check on the argument types and skipping all
other safety checks if they matched.
2022-11-27 09:39:42 -05:00
Florian Hahn
12bb5535d2
[VPlan] Move cast codegen to emitTransformedIndex (NFCI).
This reduces duplication a bit.

Suggested as simplification in D133758.
2022-11-26 22:47:13 +00:00
Roman Lebedev
25f01d593c
Revert "[SROA] isVectorPromotionViable(): memory intrinsics operate on vectors of bytes (take 2)"
TableGen is still getting miscompiled on PPC buildbots.
Sent a mail with request for help.

This reverts commit 3c4d2a03968ccf5889bacffe02d6fa2443b0260f.
2022-11-27 00:00:06 +03:00
Roman Lebedev
3c4d2a0396
[SROA] isVectorPromotionViable(): memory intrinsics operate on vectors of bytes (take 2)
This is a recommit of cf624b23bc5d5a6161706d1663def49380ff816a,
which was reverted in 5cfc22cafe3f2465e0bb324f8daba82ffcabd0df,
because the cut-off on the number of vector elements was not low enough,
and it triggered both SDAG SDNode operand number assertions,
and caused compile time explosions in some cases.

Let's try with something really *REALLY* conservative first,
just to get somewhere, and try to bump it (to 64/128) later.

FIXME: should this respect TTI reg width * num vec regs?

Original commit message:

Now, there's a big caveat here - these bytes
are abstract bytes, not the i8 we have in LLVM,
so strictly speaking this is not exactly legal,
see e.g. https://github.com/AliveToolkit/alive2/issues/860
^ the "bytes" "could" have been a pointer,
and loading it as an integer inserts an implicit ptrtoint.

But at the same time,
InstCombine's `InstCombinerImpl::SimplifyAnyMemTransfer()`
would expand a memtransfer of 1/2/4/8 bytes
into integer-typed load+store,
so this isn't exactly a new problem.

Note that in memory, poison is byte-wise,
so we really can't widen elements,
but SROA seems to be inconsistent here.

Fixes #59116.
2022-11-26 23:19:15 +03:00
chenglin.bi
b400dde473 [InstSimplify] Use dominate condtion to simplify instructions
Fix #56795

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D138542
2022-11-26 21:41:41 +08:00
Florian Hahn
ed2fdace89
[LV] Use separate index to access StoredValues in vectorizeInterleave.
StoredValues only has entries for members of the interleave group. If
there are gaps, then using the index i here will either access a wrong
entry or be out-of-bounds.

Instead use a dedicated index that only gets incremented for members of
the interleave group.

Fixes #59090.
2022-11-25 15:28:05 +00:00
Jamie Schmeiser
be1ff1fe58 [NFC] Refactor loop peeling code for calculating phi invariance.
Summary:
Refactor loop peeling code by moving code for calculating phi invariance
into a separate class that does the calculation.  Redescribe and rework
the algorithm in preparation for adding increased functionality.  Add
test case that does not exhibit peeling that will be subsequently supported.

Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By: mkazantsev (Max Kazantsev)
Differential Revision: https://reviews.llvm.org/D138232
2022-11-25 09:07:14 -05:00
Matthias Gehre
5a1d92fa3e [InstCombine] Update debug intrinsics when rewriting allocas 2022-11-25 08:20:54 +01:00
chenglin.bi
15e41467f0 [LSR] precommit test for D138636; NFC 2022-11-25 13:46:51 +08:00
Sanjay Patel
535c5d56a7 [InstCombine] ease restriction for extractelt (bitcast X) fold
We were checking for a desirable integer type even when there
is no shift in the transform. This is unnecessary since we
are truncating directly to the destination type.

This removes an extractelt in more cases and seems to make the
canonicalization more uniform overall. There's still a potential
difference between patterns that need a shift vs. trunc-only.

I'm not sure if that is worth keeping at this point, but it can
be adjusted in another step (assuming this change does not cause
trouble).

In the most basic case where I noticed this, we missed a fold
that would have completely removed vector ops from a pattern
like:
https://alive2.llvm.org/ce/z/y4Qdte
2022-11-24 13:27:19 -05:00
Sanjay Patel
34b4672f92 [InstCombine] avoid 'tmp' variable name in tests; NFC
The auto-generation script warns on these files because
of the potential to conflict with the scripted regex names.
2022-11-24 12:22:40 -05:00
Sanjay Patel
56279164f3 [InstCombine] add tests for trunc+insertelt; NFC 2022-11-24 10:16:37 -05:00
Max Kazantsev
e5fa7eb120 [SCEV] Add printout of symbolic max backedge-taken and block exit count
We do compute it and use in optimizations, but never print it out. We need
to do it in order to be able to track improvements in its computation.
2022-11-24 19:29:58 +07:00