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:
24ad00d
)
Fix bug in previous checkin
author
Chris Lattner
<sabre@nondot.org>
Tue, 16 Mar 2004 23:36:49 +0000
(23:36 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Tue, 16 Mar 2004 23:36:49 +0000
(23:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12458
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Scalar/TailDuplication.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Scalar/TailDuplication.cpp
b/lib/Transforms/Scalar/TailDuplication.cpp
index 45f0543fb2972f91c52f5cff91a5fbd3a7f09290..40821e450c626dea839b59b9936c58936ea84ed0 100644
(file)
--- a/
lib/Transforms/Scalar/TailDuplication.cpp
+++ b/
lib/Transforms/Scalar/TailDuplication.cpp
@@
-157,8
+157,13
@@
void TailDup::eliminateUnconditionalBranch(BranchInst *Branch) {
}
} else if (PHINode *PN = dyn_cast<PHINode>(cast<Instruction>(*UI))) {
// If the user of this instruction is a PHI node in the current block,
- // spill the value.
- ShouldDemote = true;
+ // which has an entry from another block using the value, spill it.
+ for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
+ if (PN->getIncomingValue(i) == I &&
+ PN->getIncomingBlock(i) != DestBlock) {
+ ShouldDemote = true;
+ break;
+ }
}
if (ShouldDemote) {