mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-23 11:38:38 +00:00
simplify some logic further
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23408 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f58c1a578e
commit
055dc102e9
@ -1041,7 +1041,6 @@ static bool FoldTwoEntryPHINode(PHINode *PN) {
|
|||||||
// that need to be moved to the dominating block.
|
// that need to be moved to the dominating block.
|
||||||
std::set<Instruction*> AggressiveInsts;
|
std::set<Instruction*> AggressiveInsts;
|
||||||
|
|
||||||
bool CanPromote = true;
|
|
||||||
BasicBlock::iterator AfterPHIIt = BB->begin();
|
BasicBlock::iterator AfterPHIIt = BB->begin();
|
||||||
while (isa<PHINode>(AfterPHIIt)) {
|
while (isa<PHINode>(AfterPHIIt)) {
|
||||||
PHINode *PN = cast<PHINode>(AfterPHIIt++);
|
PHINode *PN = cast<PHINode>(AfterPHIIt++);
|
||||||
@ -1054,13 +1053,9 @@ static bool FoldTwoEntryPHINode(PHINode *PN) {
|
|||||||
&AggressiveInsts) ||
|
&AggressiveInsts) ||
|
||||||
!DominatesMergePoint(PN->getIncomingValue(1), BB,
|
!DominatesMergePoint(PN->getIncomingValue(1), BB,
|
||||||
&AggressiveInsts)) {
|
&AggressiveInsts)) {
|
||||||
CanPromote = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Did we eliminate all PHI's?
|
|
||||||
if (!CanPromote && AfterPHIIt != BB->begin())
|
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If we all PHI nodes are promotable, check to make sure that all
|
// If we all PHI nodes are promotable, check to make sure that all
|
||||||
// instructions in the predecessor blocks can be promoted as well. If
|
// instructions in the predecessor blocks can be promoted as well. If
|
||||||
|
Loading…
x
Reference in New Issue
Block a user