mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 00:32:55 +00:00
Have RemovePredecessorAndSimplify you SimplifyInstruction
rather than hasConstantValue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119457 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d32c4a1756
commit
6ac3386e10
@ -346,13 +346,13 @@ void llvm::RemovePredecessorAndSimplify(BasicBlock *BB, BasicBlock *Pred,
|
||||
WeakVH PhiIt = &BB->front();
|
||||
while (PHINode *PN = dyn_cast<PHINode>(PhiIt)) {
|
||||
PhiIt = &*++BasicBlock::iterator(cast<Instruction>(PhiIt));
|
||||
|
||||
Value *PNV = PN->hasConstantValue();
|
||||
|
||||
Value *PNV = SimplifyInstruction(PN, TD);
|
||||
if (PNV == 0) continue;
|
||||
|
||||
|
||||
// If we're able to simplify the phi to a single value, substitute the new
|
||||
// value into all of its uses.
|
||||
assert(PNV != PN && "hasConstantValue broken");
|
||||
assert(PNV != PN && "SimplifyInstruction broken!");
|
||||
|
||||
Value *OldPhiIt = PhiIt;
|
||||
ReplaceAndSimplifyAllUses(PN, PNV, TD);
|
||||
|
Loading…
x
Reference in New Issue
Block a user