projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fe2cb3e
)
Potential bug in RewriteLoopBodyWithConditionConstant: use iterator should not be...
author
Stepan Dyatkovskiy
<stpworld@narod.ru>
Tue, 29 Nov 2011 20:34:39 +0000
(20:34 +0000)
committer
Stepan Dyatkovskiy
<stpworld@narod.ru>
Tue, 29 Nov 2011 20:34:39 +0000
(20:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145432
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Scalar/LoopUnswitch.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Scalar/LoopUnswitch.cpp
b/lib/Transforms/Scalar/LoopUnswitch.cpp
index 458949c8444d2a20a9d753af8df8e1eddbd8fe8d..ab70dd5e420bdc53bc1f0e44aeaea0b089ad23ab 100644
(file)
--- a/
lib/Transforms/Scalar/LoopUnswitch.cpp
+++ b/
lib/Transforms/Scalar/LoopUnswitch.cpp
@@
-907,9
+907,13
@@
void LoopUnswitch::RewriteLoopBodyWithConditionConstant(Loop *L, Value *LIC,
Instruction *U = dyn_cast<Instruction>(*UI);
if (!U || !L->contains(U))
continue;
- U->replaceUsesOfWith(LIC, Replacement);
Worklist.push_back(U);
}
+
+ for (std::vector<Instruction*>::iterator UI = Worklist.begin();
+ UI != Worklist.end(); ++UI)
+ (*UI)->replaceUsesOfWith(LIC, Replacement);
+
SimplifyCode(Worklist, L);
return;
}