diff options
author | Anna Thomas <anna@azul.com> | 2018-09-04 22:12:23 +0000 |
---|---|---|
committer | Anna Thomas <anna@azul.com> | 2018-09-04 22:12:23 +0000 |
commit | dbacea188b31f4deae2704282c166c03a00821da (patch) | |
tree | ff6107ad1e79fac0cf60d1b2d115f9911f7ac64c /llvm/lib | |
parent | 5bbe8cd7ef9786a2cfe545dcb6b626fed7b381ca (diff) | |
download | bcm5719-llvm-dbacea188b31f4deae2704282c166c03a00821da.tar.gz bcm5719-llvm-dbacea188b31f4deae2704282c166c03a00821da.zip |
[LV] First order recurrence phis should not be treated as uniform
This is fix for PR38786.
First order recurrence phis were incorrectly treated as uniform,
which caused them to be vectorized as uniform instructions.
Patch by Ayal Zaks and Orivej Desh!
Reviewed by: Anna
Differential Revision: https://reviews.llvm.org/D51639
llvm-svn: 341416
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 90f1155c673..7c1012f955c 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -4529,6 +4529,11 @@ void LoopVectorizationCostModel::collectLoopUniforms(unsigned VF) { // isOutOfScope operands cannot be uniform instructions. if (isOutOfScope(OV)) continue; + // First order recurrence Phi's should typically be considered + // non-uniform. + auto *OP = dyn_cast<PHINode>(OV); + if (OP && Legal->isFirstOrderRecurrence(OP)) + continue; // If all the users of the operand are uniform, then add the // operand into the uniform worklist. auto *OI = cast<Instruction>(OV); |