llvm-project/llvm/test/Transforms/LoopVectorize/X86
Robert Lougher b0905209dd [LoopVectorizer] When estimating reg usage, unused insts may "end" another use
The register usage algorithm incorrectly treats instructions whose value is
not used within the loop (e.g. those that do not produce a value).

The algorithm first calculates the usages within the loop.  It iterates over
the instructions in order, and records at which instruction index each use
ends (in fact, they're actually recorded against the next index, as this is
when we want to delete them from the open intervals).

The algorithm then iterates over the instructions again, adding each
instruction in turn to a list of open intervals.  Instructions are then
removed from the list of open intervals when they occur in the list of uses
ended at the current index.

The problem is, instructions which are not used in the loop are skipped.
However, although they aren't used, the last use of a value may have been
recorded against that instruction index.  In this case, the use is not deleted
from the open intervals, which may then bump up the estimated register usage.

This patch fixes the issue by simply moving the "is used" check after the loop
which erases the uses at the current index.

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

llvm-svn: 286969
2016-11-15 14:27:33 +00:00
..
already-vectorized.ll
assume.ll
avx1.ll
avx512.ll [AVX-512] Fix a test missed in r277327. 2016-08-01 08:15:30 +00:00
constant-vector-operand.ll
conversion-cost.ll
cost-model.ll [X86] Enable interleaved memory access by default 2016-10-20 21:04:31 +00:00
float-induction-x86.ll [Loop Vectorizer] Handling loops FP induction variables. 2016-07-24 07:24:54 +00:00
force-ifcvt.ll [LoopVectorize] Don't consider conditional-load dereferenceability for marked parallel loops 2016-04-26 02:00:36 +00:00
fp32_to_uint32-cost-model.ll
fp64_to_uint32-cost-model.ll
fp_to_sint8-cost-model.ll
funclet.ll [LoopVectorize] Add operand bundles to vectorized functions 2016-04-29 07:09:48 +00:00
gather-cost.ll Second attempt at r285517. 2016-10-31 13:17:31 +00:00
gather_scatter.ll [X86] Enable interleaved memory access by default 2016-10-20 21:04:31 +00:00
gcc-examples.ll
illegal-parallel-loop-uniform-write.ll
imprecise-through-phis.ll Move test to X86 directory: I think it depends on X86 TTI. 2016-05-27 16:56:54 +00:00
int128_no_gather.ll [AVX512] Don't use i128 masked gather/scatter/load/store. Do more accurately dataWidth check. 2016-08-02 09:15:28 +00:00
interleaving.ll [X86] Enable interleaved memory access by default 2016-10-20 21:04:31 +00:00
lit.local.cfg
masked_load_store.ll [X86] Enable interleaved memory access by default 2016-10-20 21:04:31 +00:00
max-mstore.ll Masked Store in Loop Vectorizer - bugfix 2016-04-26 20:18:04 +00:00
metadata-enable.ll
min-trip-count-switch.ll
no-vector.ll
no_fpmath.ll [LV] Stop saying "use -Rpass-analysis=loop-vectorize" 2016-11-11 22:51:46 +00:00
no_fpmath_with_hotness.ll [LV] Stop saying "use -Rpass-analysis=loop-vectorize" 2016-11-11 22:51:46 +00:00
parallel-loops-after-reg2mem.ll
parallel-loops.ll
powof2div.ll
propagate-metadata.ll SLPVectorizer: Move propagateMetadata to VectorUtils 2016-06-30 21:17:59 +00:00
ptr-indvar-crash.ll
rauw-bug.ll
reduction-crash.ll
reg-usage-debug.ll [LoopVectorizer] When estimating reg usage, unused insts may "end" another use 2016-11-15 14:27:33 +00:00
reg-usage.ll [LoopVectorizer] When estimating reg usage, unused insts may "end" another use 2016-11-15 14:27:33 +00:00
register-assumption.ll [LoopVectorize] Register cloned assumptions 2016-04-08 16:37:10 +00:00
scatter_crash.ll [LV] Move insertelement sequence after scalar definitions 2016-08-29 20:14:04 +00:00
small-size.ll
struct-store.ll
svml-calls.ll Initial support for vectorization using svml (short vector math library). 2016-07-29 16:42:44 +00:00
tripcount.ll
uint64_to_fp64-cost-model.ll [X86] Make some cast costs more precise 2016-07-11 21:39:44 +00:00
uniform-phi.ll [LoopVectorize] Change comment for isOutOfScope in collectLoopUniforms, NFC 2016-08-02 20:27:49 +00:00
uniform_load.ll Loop vectorization with uniform load 2016-04-10 16:53:19 +00:00
uniformshift.ll [LV, X86] Be more optimistic about vectorizing shifts. 2016-08-04 22:48:03 +00:00
unroll-pm.ll
unroll-small-loops.ll
unroll_selection.ll
veclib-calls.ll [SLPVectorizer] Vectorizing the libm sqrt to llvm's sqrt intrinsic requires nnan 2016-04-06 07:04:53 +00:00
vect.omp.force.ll
vect.omp.force.small-tc.ll
vector-scalar-select-cost.ll
vector_max_bandwidth.ll [X86][AVX] Fixed v16i16/v32i8 ADD/SUB costs on AVX1 subtargets 2016-11-14 14:45:16 +00:00
vector_ptr_load_store.ll
vectorization-remarks-loopid-dbg.ll Look for a loop's starting location in the llvm.loop metadata 2016-05-25 21:42:37 +00:00
vectorization-remarks-missed.ll [LV] Stop saying "use -Rpass-analysis=loop-vectorize" 2016-11-11 22:51:46 +00:00
vectorization-remarks-profitable.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
vectorization-remarks.ll Convert this sample-based-profiling testcase to use a NoDebug CU. 2016-04-15 22:05:38 +00:00
vectorize-only-for-real.ll
x86_fp80-vector-store.ll