diff options
author | Roman Shirokiy <shirokiyroman@yandex.ru> | 2018-06-08 08:21:20 +0000 |
---|---|---|
committer | Roman Shirokiy <shirokiyroman@yandex.ru> | 2018-06-08 08:21:20 +0000 |
commit | 9ba0aa2da00a44e41a451aff0e9fc22c584a9203 (patch) | |
tree | af51078e31fe8ddcffabeedea4376533c16f5045 /llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | |
parent | 07996a54ba6b4afad946aab09eeebb6cd9a44eeb (diff) | |
download | bcm5719-llvm-9ba0aa2da00a44e41a451aff0e9fc22c584a9203.tar.gz bcm5719-llvm-9ba0aa2da00a44e41a451aff0e9fc22c584a9203.zip |
[LV] Fix PR36983. For a given recurrence, fix all phis in exit block
There could be more than one PHIs in exit block using same loop recurrence.
Don't assume there is only one and fix each user.
Differential Revision: https://reviews.llvm.org/D47788
llvm-svn: 334271
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 3b4c544f67b..bbace44aac4 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -3530,12 +3530,11 @@ void InnerLoopVectorizer::fixFirstOrderRecurrence(PHINode *Phi) { // Finally, fix users of the recurrence outside the loop. The users will need // either the last value of the scalar recurrence or the last value of the // vector recurrence we extracted in the middle block. Since the loop is in - // LCSSA form, we just need to find the phi node for the original scalar + // LCSSA form, we just need to find all the phi nodes for the original scalar // recurrence in the exit block, and then add an edge for the middle block. for (PHINode &LCSSAPhi : LoopExitBlock->phis()) { if (LCSSAPhi.getIncomingValue(0) == Phi) { LCSSAPhi.addIncoming(ExtractForPhiUsedOutsideLoop, LoopMiddleBlock); - break; } } } |