diff options
author | Matthew Simpson <mssimpso@codeaurora.org> | 2016-09-08 21:38:26 +0000 |
---|---|---|
committer | Matthew Simpson <mssimpso@codeaurora.org> | 2016-09-08 21:38:26 +0000 |
commit | bfe5e1817bd4badbdd1d3c9937db401db9d2d5c6 (patch) | |
tree | d16c0e94a12d1e7f23662d51e33c6bb44b401bd3 /llvm/lib/Transforms | |
parent | ed9fda01a3d4aa5136b95323403a3a8e4b69d0fa (diff) | |
download | bcm5719-llvm-bfe5e1817bd4badbdd1d3c9937db401db9d2d5c6.tar.gz bcm5719-llvm-bfe5e1817bd4badbdd1d3c9937db401db9d2d5c6.zip |
[LV] Ensure proper handling of multi-use case when collecting uniforms
The test case included in r280979 wasn't checking what it was supposed to be
checking for the predicated store case. Fixing the test revealed that the
multi-use case (when a pointer is used by both vectorized and scalarized memory
accesses) wasn't being handled properly. We can't skip over
non-consecutive-like pointers since they may have looked consecutive-like with
a different memory access.
llvm-svn: 280992
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 0e0f81fcad7..fd93ce361da 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -5388,9 +5388,9 @@ void LoopVectorizationLegality::collectLoopUniforms() { for (auto *BB : TheLoop->blocks()) for (auto &I : *BB) { - // If the pointer operand is not consecutive-like, there's nothing to do. + // If there's no pointer operand, there's nothing to do. auto *Ptr = dyn_cast_or_null<Instruction>(getPointerOperand(&I)); - if (!Ptr || isUniform(Ptr) || !hasConsecutiveLikePtrOperand(&I)) + if (!Ptr) continue; // Ensure the memory instruction will not be scalarized, making its @@ -5398,9 +5398,9 @@ void LoopVectorizationLegality::collectLoopUniforms() { if (memoryInstructionMustBeScalarized(&I)) PossibleNonUniformPtrs.insert(Ptr); - // If the memory instruction will be vectorized, its consecutive-like - // pointer operand should remain uniform. - else + // If the memory instruction will be vectorized and its pointer operand + // is consecutive-like, the pointer operand should remain uniform. + else if (hasConsecutiveLikePtrOperand(&I)) ConsecutiveLikePtrs.insert(Ptr); } |