summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/InstructionSimplify.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2010-11-14 13:30:18 +0000
committerDuncan Sands <baldrick@free.fr>2010-11-14 13:30:18 +0000
commit4581ddc123deac8c5a6f586be77c6fbd50e86597 (patch)
tree0ca28b30769118c600ae5a85879809f1360fd102 /llvm/lib/Analysis/InstructionSimplify.cpp
parent1d27f01210590b2e0e510aad39ac1006cd6f7e3d (diff)
downloadbcm5719-llvm-4581ddc123deac8c5a6f586be77c6fbd50e86597.tar.gz
bcm5719-llvm-4581ddc123deac8c5a6f586be77c6fbd50e86597.zip
Teach InstructionSimplify about phi nodes. I chose to have it simply
offload the work to hasConstantValue rather than do something more complicated (such handling mutually recursive phis) because (1) it is not clear it is worth it; and (2) if it is worth it, maybe such logic would be better placed in hasConstantValue. Adjust some GVN tests which are now cleaned up much further (eg: all phi nodes are removed). llvm-svn: 119043
Diffstat (limited to 'llvm/lib/Analysis/InstructionSimplify.cpp')
-rw-r--r--llvm/lib/Analysis/InstructionSimplify.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp
index b3e817a7506..210399d7291 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -699,6 +699,8 @@ Value *llvm::SimplifyInstruction(Instruction *I, const TargetData *TD) {
SmallVector<Value*, 8> Ops(I->op_begin(), I->op_end());
return SimplifyGEPInst(&Ops[0], Ops.size(), TD);
}
+ case Instruction::PHI:
+ return cast<PHINode>(I)->hasConstantValue();
}
}
OpenPOWER on IntegriCloud