forked from OSchip/llvm-project
Push analysis passes to InstSimplify when they're around anyways.
llvm-svn: 191309
This commit is contained in:
parent
e5ba87b6bb
commit
30d249a1b3
|
@ -790,7 +790,7 @@ Instruction *InstCombiner::SliceUpIllegalIntegerPHI(PHINode &FirstPhi) {
|
|||
// PHINode simplification
|
||||
//
|
||||
Instruction *InstCombiner::visitPHINode(PHINode &PN) {
|
||||
if (Value *V = SimplifyInstruction(&PN, TD))
|
||||
if (Value *V = SimplifyInstruction(&PN, TD, TLI))
|
||||
return ReplaceInstUsesWith(PN, V);
|
||||
|
||||
// If all PHI operands are the same operation, pull them through the PHI,
|
||||
|
|
|
@ -1893,7 +1893,8 @@ bool CodeGenPrepare::OptimizeInst(Instruction *I) {
|
|||
// It is possible for very late stage optimizations (such as SimplifyCFG)
|
||||
// to introduce PHI nodes too late to be cleaned up. If we detect such a
|
||||
// trivial PHI, go ahead and zap it here.
|
||||
if (Value *V = SimplifyInstruction(P)) {
|
||||
if (Value *V = SimplifyInstruction(P, TLI ? TLI->getDataLayout() : 0,
|
||||
TLInfo, DT)) {
|
||||
P->replaceAllUsesWith(V);
|
||||
P->eraseFromParent();
|
||||
++NumPHIsElim;
|
||||
|
|
|
@ -413,7 +413,7 @@ bool llvm::SimplifyInstructionsInBlock(BasicBlock *BB, const DataLayout *TD,
|
|||
Instruction *Inst = BI++;
|
||||
|
||||
WeakVH BIHandle(BI);
|
||||
if (recursivelySimplifyInstruction(Inst, TD)) {
|
||||
if (recursivelySimplifyInstruction(Inst, TD, TLI)) {
|
||||
MadeChange = true;
|
||||
if (BIHandle != BI)
|
||||
BI = BB->begin();
|
||||
|
|
Loading…
Reference in New Issue