aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/Transforms/Utils/LoopVersioning.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-10-16 19:03:40 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-02-08 19:05:09 +0000
commit6246ae0b85d8159978c01ae916a9ad6cde9378b5 (patch)
tree4e95c640a44c343a08cf21d58972d36bd342e4ce /contrib/llvm-project/llvm/lib/Transforms/Utils/LoopVersioning.cpp
parenta4a491e2238b12ccd64d3faf9e6401487f6f1f1b (diff)
parentdafdd7863e9eeed3a714329b8758451cbcfc33bf (diff)
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Transforms/Utils/LoopVersioning.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/Transforms/Utils/LoopVersioning.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/llvm-project/llvm/lib/Transforms/Utils/LoopVersioning.cpp b/contrib/llvm-project/llvm/lib/Transforms/Utils/LoopVersioning.cpp
index 97f29527bb95..6309eed7963d 100644
--- a/contrib/llvm-project/llvm/lib/Transforms/Utils/LoopVersioning.cpp
+++ b/contrib/llvm-project/llvm/lib/Transforms/Utils/LoopVersioning.cpp
@@ -137,8 +137,10 @@ void LoopVersioning::addPHINodes(
// See if we have a single-operand PHI with the value defined by the
// original loop.
for (auto I = PHIBlock->begin(); (PN = dyn_cast<PHINode>(I)); ++I) {
- if (PN->getIncomingValue(0) == Inst)
+ if (PN->getIncomingValue(0) == Inst) {
+ SE->forgetValue(PN);
break;
+ }
}
// If not create it.
if (!PN) {