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:
Zhou Sheng
2007-01-11 12:24:14 +00:00
parent 057809ac1c
commit 6b6b6ef167
43 changed files with 1974 additions and 1868 deletions

View File

@@ -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