diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopPeel.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopPeel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopPeel.cpp b/llvm/lib/Transforms/Utils/LoopPeel.cpp index c5c637a..646354bb 100644 --- a/llvm/lib/Transforms/Utils/LoopPeel.cpp +++ b/llvm/lib/Transforms/Utils/LoopPeel.cpp @@ -1214,7 +1214,7 @@ bool llvm::peelLoop(Loop *L, unsigned PeelCount, bool PeelLast, LoopInfo *LI, // Now adjust users of the original exit values by replacing them with the // exit value from the peeled iteration. for (const auto &[P, E] : ExitValues) - P->replaceAllUsesWith(VMap.lookup(E)); + P->replaceAllUsesWith(isa<Constant>(E) ? E : &*VMap.lookup(E)); formLCSSA(*L, DT, LI, SE); } else { // Now adjust the phi nodes in the loop header to get their initial values |