llvm-project/llvm/test/Transforms/LoopVectorize
Michael Kruse 77a614a6e1 Refactor setAlreadyUnrolled() and setAlreadyVectorized().
Loop::setAlreadyUnrolled() and
LoopVectorizeHints::setLoopAlreadyUnrolled() both add loop metadata that
stops the same loop from being transformed multiple times. This patch
merges both implementations.

In doing so we fix 3 potential issues:

 * setLoopAlreadyUnrolled() kept the llvm.loop.vectorize/interleave.*
   metadata even though it will not be used anymore. This already caused
   problems such as http://llvm.org/PR40546. Change the behavior to the
   one of setAlreadyUnrolled which deletes this loop metadata.

 * setAlreadyUnrolled() used to create a new LoopID by calling
   MDNode::get with nullptr as the first operand, then replacing it by
   the returned references using replaceOperandWith. It is possible
   that MDNode::get would instead return an existing node (due to
   de-duplication) that then gets modified. To avoid, use a fresh
   TempMDNode that does not get uniqued with anything else before
   replacing it with replaceOperandWith.

 * LoopVectorizeHints::matchesHintMetadataName() only compares the
   suffix of the attribute to set the new value for. That is, when
   called with "enable", would erase attributes such as
   "llvm.loop.unroll.enable", "llvm.loop.vectorize.enable" and
   "llvm.loop.distribute.enable" instead of the one to replace.
   Fortunately, function was only called with "isvectorized".

Differential Revision: https://reviews.llvm.org/D57566

llvm-svn: 353738
2019-02-11 19:45:44 +00:00
..
AArch64 Revert unapproved commit 2018-11-24 07:26:55 +00:00
AMDGPU LV: Don't insert runtime ptr checks on divergent targets 2017-08-02 21:43:08 +00:00
ARM [LV] Preserve inbounds on created GEPs 2018-05-01 15:35:08 +00:00
Hexagon [LV] Introduce TTI::getMinimumVF 2018-04-13 20:16:32 +00:00
PowerPC [ppc] Correctly compute the cost of loading 32/64 bit memory into VSR 2016-12-03 00:41:43 +00:00
SystemZ [SystemZ] Rework getInterleavedMemoryOpCost() 2018-11-02 17:15:36 +00:00
X86 Refactor setAlreadyUnrolled() and setAlreadyVectorized(). 2019-02-11 19:45:44 +00:00
XCore
12-12-11-if-conv.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
2012-10-20-infloop.ll
2012-10-22-isconsec.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
2016-07-27-loop-vec.ll
align.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
bsd_regex.ll
bzip_reverse_loops.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
calloc.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
cast-induction.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
conditional-assignment.ll [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
consec_no_gep.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
consecutive-ptr-uniforms.ll [LV] Preserve inbounds on created GEPs 2018-05-01 15:35:08 +00:00
control-flow.ll [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
cpp-new-array.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
dbg.value.ll [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
dead_instructions.ll [LV] Avoid emitting trivially dead instructions 2016-10-19 19:22:02 +00:00
debugloc.ll Avoid dbg.value use-before-def in a few tests (NFC) 2018-08-21 23:42:08 +00:00
demanded-bits-of-pointer-instruction.ll Reapply "[DemandedBits][BDCE] Support vectors of integers" 2018-12-07 15:38:13 +00:00
diag-missing-instr-debug-loc.ll [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
diag-with-hotness-info-2.ll [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
diag-with-hotness-info.ll [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
disable_nonforced.ll [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes. 2018-12-12 17:32:52 +00:00
disable_nonforced_enable.ll [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes. 2018-12-12 17:32:52 +00:00
discriminator.ll Do not add discriminator encoding for debug intrinsics. 2017-10-26 21:20:52 +00:00
ee-crash.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
exact.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
explicit_outer_detection.ll [LV][VPlan] Detect outer loops for explicit vectorization. 2018-04-24 17:04:17 +00:00
explicit_outer_nonuniform_inner.ll [LV][VPlan] Detect outer loops for explicit vectorization. 2018-04-24 17:04:17 +00:00
explicit_outer_uniform_diverg_branch.ll [LV][VPlan] Detect outer loops for explicit vectorization. 2018-04-24 17:04:17 +00:00
fcmp-vectorize.ll [LoopVectorize] Fix assertion failure in Fcmp vectorization 2017-08-08 18:07:44 +00:00
first-order-recurrence.ll [LV] Fix PR34711 - widen instruction ranges when sinking casts 2017-10-05 12:41:49 +00:00
flags.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
float-induction.ll [LV] Preserve inbounds on created GEPs 2018-05-01 15:35:08 +00:00
float-reduction.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
followup.ll [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes. 2018-12-12 17:32:52 +00:00
funcall.ll
gcc-examples.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
gep_with_bitcast.ll
global_alias.ll
hints-trans.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
hoist-loads.ll [LV] Move isLegalMasked* functions from Legality to CostModel 2018-02-26 11:06:36 +00:00
i8-induction.ll [DebugInfo][LoopVectorize] Preserve DL in induction PHI and Add 2018-07-10 13:29:50 +00:00
icmp-uniforms.ll [LV] Don't mark multi-use branch conditions uniform 2016-10-07 15:20:13 +00:00
if-conv-crash.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
if-conversion-edgemasks.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
if-conversion-nest.ll InstCombine: move hasOneUse check to the top of foldICmpAddConstant 2018-09-10 14:26:44 +00:00
if-conversion-reduction.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
if-conversion.ll [LV] Fix PR34523 - avoid generating redundant selects 2017-09-13 06:28:37 +00:00
if-pred-non-void.ll [LV] Fix PR34248 - recommit D32871 after revert r311304 2017-08-27 12:55:46 +00:00
if-pred-not-when-safe.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
if-pred-stores.ll [LV] Avoid redundant operations manipulating masks 2017-07-31 13:21:42 +00:00
if-reduction.ll Add a new reduction pattern match 2018-11-30 13:40:10 +00:00
incorrect-dom-info.ll
increment.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
induction-step.ll [LV] Preserve inbounds on created GEPs 2018-05-01 15:35:08 +00:00
induction.ll [LV] Do not create SCEVs on broken IR in emitTransformedIndex. PR39160 2018-10-08 05:46:29 +00:00
induction_plus.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
infiniteloop.ll
int_sideeffect.ll Add an @llvm.sideeffect intrinsic 2017-11-08 21:59:51 +00:00
interleaved-accesses-1.ll Second attempt at r285517. 2016-10-31 13:17:31 +00:00
interleaved-accesses-2.ll Second attempt at r285517. 2016-10-31 13:17:31 +00:00
interleaved-accesses-3.ll Second attempt at r285517. 2016-10-31 13:17:31 +00:00
interleaved-accesses-alias.ll [LV] Interleaved access vectorization: fix computing new alias info 2017-12-06 22:42:24 +00:00
interleaved-accesses-masked-group.ll recommit 344472 after fixing build failure on ARM and PPC. 2018-10-14 08:50:06 +00:00
interleaved-accesses-pred-stores.ll recommit 344472 after fixing build failure on ARM and PPC. 2018-10-14 08:50:06 +00:00
interleaved-accesses.ll [LV] Preserve inbounds on created GEPs 2018-05-01 15:35:08 +00:00
interleaved-acess-with-remarks.ll [LV] Fix analyzeInterleaving when -pass-remarks enabled 2018-02-10 00:07:45 +00:00
intrinsic.ll [VectorUtils] add funnel-shifts to the list of vectorizable intrinsics 2018-11-12 15:20:14 +00:00
invariant-store-vectorization.ll Revert "[LICM] Enable control flow hoisting by default" and "[LICM] Reapply r347190 "Make LICM able to hoist phis" with fix" 2018-11-29 14:39:39 +00:00
iv_outside_user.ll [LV] Do not create SCEVs on broken IR in emitTransformedIndex. PR39160 2018-10-08 05:46:29 +00:00
lcssa-crash.ll [LV] Fix an issue where forming LCSSA in the place that we did would 2017-01-26 10:41:09 +00:00
legal_preheader_check.ll [LV] Remove unnecessary DoExtraAnalysis guard (silent bug) 2017-12-20 13:28:38 +00:00
libcall-remark.ll [LoopVectorizer] give more advice in remark about failure to vectorize call 2019-01-12 15:27:15 +00:00
lifetime.ll Add address space mangling to lifetime intrinsics 2017-04-10 20:18:21 +00:00
loop-form.ll
loop-scalars.ll Reapply r298620: [LV] Vectorize GEPs 2017-04-07 14:15:34 +00:00
loop-vect-memdep.ll
memdep.ll [LV] Fix maximum legal VF calculation 2017-09-14 07:40:02 +00:00
metadata-unroll.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
metadata-width.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
metadata.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
miniters.ll [LV] Test once if vector trip count is zero, instead of twice 2017-07-19 05:16:39 +00:00
minmax_reduction.ll [InstCombine] remove extract-of-select vector transform (2nd try) 2017-09-25 20:30:53 +00:00
multi-use-reduction-bug.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
multiple-address-spaces.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
multiple-strides-vectorization.ll [Loop Vectorize] Added a separate metadata 2017-08-20 10:32:41 +00:00
no-interleave-up-front.ll [LV] Prevent interleaving if computeMaxVF returned None. 2019-02-07 20:49:10 +00:00
no_array_bounds.ll [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes. 2018-12-12 17:32:52 +00:00
no_idiv_reduction.ll
no_int_induction.ll
no_outside_user.ll [LV] Vectorize loops where non-phi instructions used outside loop 2018-08-21 14:40:27 +00:00
no_switch.ll [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes. 2018-12-12 17:32:52 +00:00
no_switch_disable_vectorization.ll Check bool attribute value in getOptionalBoolLoopAttribute. 2019-01-29 22:33:20 +00:00
noalias-md-licm.ll
noalias-md.ll
nofloat.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
non-const-n.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
nontemporal.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
nsw-crash.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
opt.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
optsize.ll
outer_loop_test1.ll [VPlan] Implement initial vector code generation support for simple outer loops. 2018-09-14 00:36:00 +00:00
outer_loop_test2.ll [VPlan] Implement initial vector code generation support for simple outer loops. 2018-09-14 00:36:00 +00:00
partial-lcssa.ll [LV] Run loop-simplify and LCSSA explicitly instead of "requiring" them 2017-01-19 00:42:28 +00:00
phi-cost.ll [InstCombine] Teach select01 helper of foldSelectIntoOp to handle vector splats 2017-08-28 22:00:27 +00:00
phi-hang.ll
pr25281.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
pr28541.ll
pr30654-phiscev-sext-trunc.ll Revert r325687 (workaround for PR36032). 2018-03-22 22:04:39 +00:00
pr31098.ll [LV/LoopAccess] Check statically if an unknown dependence distance can be 2017-02-12 09:32:53 +00:00
pr31190.ll [LV][LAA] Vectorize loop invariant values stored into loop invariant address 2018-09-25 20:57:20 +00:00
pr32859.ll [LoopOptimizer][Fix]PR32859, PR24738 2017-05-13 13:25:57 +00:00
pr33706.ll [LV] Don't allow outside uses of IVs if the SCEV is predicated on loop conditions. 2017-07-12 19:53:55 +00:00
pr34681.ll [LV/LAA] Avoid specializing a loop for stride=1 when this predicate implies a 2017-11-05 16:53:15 +00:00
pr35743.ll [NFC] Add tests for PR35743 2018-02-05 08:09:49 +00:00
pr35773.ll Revert r325687 (workaround for PR36032). 2018-03-22 22:04:39 +00:00
pr36311.ll [LV] Adding test for r327109 2018-03-09 18:02:36 +00:00
pr36983.ll [LV] Fix PR36983. For a given recurrence, fix all phis in exit block 2018-06-08 08:21:20 +00:00
pr37248.ll [LV] Fix for PR37248, Broadcast codegen incorrectly assumed vector loop body is single basic block 2018-05-08 18:57:34 +00:00
pr37515.ll [Loop Vectorizer] Abandon vectorization when no integer IV found 2018-09-21 23:03:50 +00:00
pr38800.ll [Loop Vectorizer] Abandon vectorization when no integer IV found 2018-09-21 23:03:50 +00:00
pr39099.ll [IAI,LV] Avoid creating interleave-groups for predicated accesse 2018-10-07 06:57:25 +00:00
pr39417-optsize-scevchecks.ll [LV] Avoid vectorizing loops under opt for size that involve SCEV checks 2018-11-02 09:16:12 +00:00
preserve-dbg-loc-and-loop-metadata.ll [DebugInfo][LoopVectorize] Preserve DL in generated phi instruction 2018-07-04 10:16:55 +00:00
ptr-induction.ll
ptr_loops.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
read-only.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
reduction-small-size.ll [LV] Use Demanded Bits and ValueTracking for reduction type-shrinking 2018-02-04 15:42:24 +00:00
reduction.ll add a missed case for binary op FMF propagation under select folds 2018-08-16 20:59:45 +00:00
remove_metadata.ll Refactor setAlreadyUnrolled() and setAlreadyVectorized(). 2019-02-11 19:45:44 +00:00
reverse_induction.ll
reverse_iter.ll Reapply "[LV] Extend trunc optimization to all IVs with constant integer steps" 2017-02-14 16:28:32 +00:00
runtime-check-address-space.ll
runtime-check-readonly-address-space.ll
runtime-check-readonly.ll [LV] Test once if vector trip count is zero, instead of twice 2017-07-19 05:16:39 +00:00
runtime-check.ll [LAA] Avoid generating RT checks for known deps preventing vectorization. 2018-12-20 18:49:09 +00:00
runtime-limit.ll
safegep.ll
same-base-access.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
scalar-select.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
scalar_after_vectorization.ll [LV] Preserve inbounds on created GEPs 2018-05-01 15:35:08 +00:00
scev-exitlim-crash.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
simple-unroll.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
skip-iterations.ll NFC: update the test comments in LV test about early exit loops 2018-08-21 21:12:02 +00:00
small-loop.ll [LV] Optimize for size when vectorizing loops with tiny trip count 2017-06-30 08:02:35 +00:00
start-non-zero.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
store-shuffle-bug.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
struct_access.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
tbaa-nodep.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
tripcount.ll Verify profile data confirms large loop trip counts. 2018-02-07 23:29:52 +00:00
undef-inst-bug.ll
unroll-novec-memcheck-metadata.ll [LV] Add regression test for r297610 2017-03-23 20:02:23 +00:00
unroll.ll
unroll_novec.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
unsafe-dep-remark.ll [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
unsized-pointee-crash.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
value-ptr-bug.ll
vect-phiscev-sext-trunc.ll Revert r325687 (workaround for PR36032). 2018-03-22 22:04:39 +00:00
vect.omp.persistence.ll [tests] Cleanup vect.omp.persistence.ll test. 2017-07-25 10:35:16 +00:00
vect.stats.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
vector-geps.ll Reapply r298620: [LV] Vectorize GEPs 2017-04-07 14:15:34 +00:00
vectorize-once.ll [Loop Vectorize] Added a separate metadata 2017-08-20 10:32:41 +00:00
version-mem-access.ll [LV/LAA] Avoid specializing a loop for stride=1 when this predicate implies a 2017-11-05 16:53:15 +00:00
vplan_hcfg_stress_test.ll [VPlan] Reland r332654 and silence unused func warning 2018-05-21 18:14:23 +00:00
write-only.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00
zero-sized-pointee-crash.ll [LV] Remove triples from target-independent vectorizer tests. NFC. 2016-10-06 23:57:25 +00:00