summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopUnswitch.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopUnswitch.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
index 8fa806a7e8b..dbec0c085f7 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
@@ -1231,11 +1231,11 @@ void LoopUnswitch::UnswitchNontrivialCondition(Value *LIC, Constant *Val,
LoopProcessWorklist.push_back(NewLoop);
redoLoop = true;
- // Keep a WeakVH holding onto LIC. If the first call to RewriteLoopBody
- // deletes the instruction (for example by simplifying a PHI that feeds into
- // the condition that we're unswitching on), we don't rewrite the second
- // iteration.
- WeakVH LICHandle(LIC);
+ // Keep a WeakTrackingVH holding onto LIC. If the first call to
+ // RewriteLoopBody deletes the instruction (for example by simplifying a PHI
+ // that feeds into the condition that we're unswitching on), we don't rewrite
+ // the second iteration.
+ WeakTrackingVH LICHandle(LIC);
// Now we rewrite the original code to know that the condition is true and the
// new code to know that the condition is false.
OpenPOWER on IntegriCloud