OSDN Git Service
(root)
/
android-x86
/
external-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2f62a9e
)
Fix for 2006-06-27-DeadSwitchCase.ll
author
Owen Anderson
<resistor@mac.com>
Tue, 27 Jun 2006 22:26:09 +0000
(22:26 +0000)
committer
Owen Anderson
<resistor@mac.com>
Tue, 27 Jun 2006 22:26:09 +0000
(22:26 +0000)
Be more careful when updating Phi nodes after eliminating dead switch cases. Fix
proposed by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28947
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
222d178
..
d33dcb7
100644
(file)
--- a/
lib/Transforms/Scalar/LoopUnswitch.cpp
+++ b/
lib/Transforms/Scalar/LoopUnswitch.cpp
@@
-971,11
+971,12
@@
void LoopUnswitch::RewriteLoopBodyWithConditionConstant(Loop *L, Value *LIC,
Old->getTerminator()->eraseFromParent();
- for (BasicBlock::iterator II = SI->getSuccessor(i)->begin(),
- IE = SI->getSuccessor(i)->end(); II != IE; ++II) {
- if (isa<PHINode>(*II)) {
- (*II).replaceUsesOfWith(Split, Old);
- }
+
+ PHINode *PN;
+ for (BasicBlock::iterator II = SI->getSuccessor(i)->begin();
+ (PN = dyn_cast<PHINode>(II)); ++II) {
+ Value *InVal = PN->removeIncomingValue(Split, false);
+ PN->addIncoming(InVal, Old);
}
SI->removeCase(i);