summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-01-16 05:14:26 +0000
committerChris Lattner <sabre@nondot.org>2011-01-16 05:14:26 +0000
commitea7131a06207d75414604e689303a1137568a003 (patch)
tree36c22f54b70296aac65f684f93d65ec7216051e5 /llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
parentff2e7377141cad4a67f82c1bebd30567a2a642a2 (diff)
downloadbcm5719-llvm-ea7131a06207d75414604e689303a1137568a003.tar.gz
bcm5719-llvm-ea7131a06207d75414604e689303a1137568a003.zip
remove the AllowAggressive argument to FoldOpIntoPhi. It is forced to false in the
first line of the function because it isn't a good idea, even for compares. llvm-svn: 123566
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstructionCombining.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstructionCombining.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
index 919c623c604..6d05466b9be 100644
--- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -512,12 +512,7 @@ Instruction *InstCombiner::FoldOpIntoSelect(Instruction &Op, SelectInst *SI) {
/// has a PHI node as operand #0, see if we can fold the instruction into the
/// PHI (which is only possible if all operands to the PHI are constants).
///
-/// If AllowAggressive is true, FoldOpIntoPhi will allow certain transforms
-/// that would normally be unprofitable because they strongly encourage jump
-/// threading.
-Instruction *InstCombiner::FoldOpIntoPhi(Instruction &I,
- bool AllowAggressive) {
- AllowAggressive = false;
+Instruction *InstCombiner::FoldOpIntoPhi(Instruction &I) {
PHINode *PN = cast<PHINode>(I.getOperand(0));
unsigned NumPHIValues = PN->getNumIncomingValues();
if (NumPHIValues == 0)
@@ -525,7 +520,7 @@ Instruction *InstCombiner::FoldOpIntoPhi(Instruction &I,
// We normally only transform phis with a single use, unless we're trying
// hard to make jump threading happen.
- if (!PN->hasOneUse() && !AllowAggressive)
+ if (!PN->hasOneUse())
return 0;
// Check to see if all of the operands of the PHI are simple constants
@@ -560,7 +555,7 @@ Instruction *InstCombiner::FoldOpIntoPhi(Instruction &I,
// operation in that block. However, if this is a critical edge, we would be
// inserting the computation one some other paths (e.g. inside a loop). Only
// do this if the pred block is unconditionally branching into the phi block.
- if (NonConstBB != 0 && !AllowAggressive) {
+ if (NonConstBB != 0) {
BranchInst *BI = dyn_cast<BranchInst>(NonConstBB->getTerminator());
if (!BI || !BI->isUnconditional()) return 0;
}
OpenPOWER on IntegriCloud