mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-12 06:06:32 +00:00
Simplify interface to ConstantFoldTerminator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2697 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b8bcb086f7
commit
76ae3445f8
@ -25,8 +25,7 @@ bool doConstantPropogation(BasicBlock *BB, BasicBlock::iterator &I);
|
||||
// destination. This is a nontrivial operation because the successors of this
|
||||
// basic block must have their PHI nodes updated.
|
||||
//
|
||||
bool ConstantFoldTerminator(BasicBlock *BB, BasicBlock::iterator &I,
|
||||
TerminatorInst *T);
|
||||
bool ConstantFoldTerminator(BasicBlock *BB);
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -34,8 +34,9 @@ bool doConstantPropogation(BasicBlock *BB, BasicBlock::iterator &II) {
|
||||
// constant value, convert it into an unconditional branch to the constant
|
||||
// destination.
|
||||
//
|
||||
bool ConstantFoldTerminator(BasicBlock *BB, BasicBlock::iterator &II,
|
||||
TerminatorInst *T) {
|
||||
bool ConstantFoldTerminator(BasicBlock *BB) {
|
||||
TerminatorInst *T = BB->getTerminator();
|
||||
|
||||
// Branch - See if we are conditional jumping on constant
|
||||
if (BranchInst *BI = dyn_cast<BranchInst>(T)) {
|
||||
if (BI->isUnconditional()) return false; // Can't optimize uncond branch
|
||||
@ -60,7 +61,6 @@ bool ConstantFoldTerminator(BasicBlock *BB, BasicBlock::iterator &II,
|
||||
// Set the unconditional destination, and change the insn to be an
|
||||
// unconditional branch.
|
||||
BI->setUnconditionalDest(Destination);
|
||||
II = BB->end()-1; // Update instruction iterator!
|
||||
return true;
|
||||
}
|
||||
#if 0
|
||||
|
Loading…
Reference in New Issue
Block a user