mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt. Remove ConstantIntegral and ConstantBool from LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33073 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -133,12 +133,13 @@ void CondProp::SimplifyPredecessors(BranchInst *BI) {
|
||||
// constants. Walk from the end to remove operands from the end when
|
||||
// possible, and to avoid invalidating "i".
|
||||
for (unsigned i = PN->getNumIncomingValues(); i != 0; --i)
|
||||
if (ConstantBool *CB = dyn_cast<ConstantBool>(PN->getIncomingValue(i-1))) {
|
||||
if (ConstantInt *CB = dyn_cast<ConstantInt>(PN->getIncomingValue(i-1))) {
|
||||
if (CB->getType() != Type::BoolTy) continue;
|
||||
// If we have a constant, forward the edge from its current to its
|
||||
// ultimate destination.
|
||||
bool PHIGone = PN->getNumIncomingValues() == 2;
|
||||
RevectorBlockTo(PN->getIncomingBlock(i-1),
|
||||
BI->getSuccessor(CB->getValue() == 0));
|
||||
BI->getSuccessor(CB->getBoolValue() == 0));
|
||||
++NumBrThread;
|
||||
|
||||
// If there were two predecessors before this simplification, the PHI node
|
||||
|
Reference in New Issue
Block a user