mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-30 02:25:19 +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:
@@ -226,11 +226,14 @@ void PruningFunctionCloner::CloneBlock(const BasicBlock *BB) {
|
||||
if (const BranchInst *BI = dyn_cast<BranchInst>(OldTI)) {
|
||||
if (BI->isConditional()) {
|
||||
// If the condition was a known constant in the callee...
|
||||
ConstantBool *Cond = dyn_cast<ConstantBool>(BI->getCondition());
|
||||
if (Cond == 0) // Or is a known constant in the caller...
|
||||
Cond = dyn_cast_or_null<ConstantBool>(ValueMap[BI->getCondition()]);
|
||||
if (Cond) { // Constant fold to uncond branch!
|
||||
BasicBlock *Dest = BI->getSuccessor(!Cond->getValue());
|
||||
ConstantInt *Cond = dyn_cast<ConstantInt>(BI->getCondition());
|
||||
// Or is a known constant in the caller...
|
||||
if (Cond == 0)
|
||||
Cond = dyn_cast_or_null<ConstantInt>(ValueMap[BI->getCondition()]);
|
||||
|
||||
// Constant fold to uncond branch!
|
||||
if (Cond) {
|
||||
BasicBlock *Dest = BI->getSuccessor(!Cond->getBoolValue());
|
||||
ValueMap[OldTI] = new BranchInst(Dest, NewBB);
|
||||
CloneBlock(Dest);
|
||||
TerminatorDone = true;
|
||||
|
Reference in New Issue
Block a user