summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-04-21 05:31:13 +0000
committerChris Lattner <sabre@nondot.org>2005-04-21 05:31:13 +0000
commitb38b443b15f6c97371e3596b91444b1b09ebeb37 (patch)
tree04b683bd52c6c1b7dea2778ef2acbd558552a711 /llvm/lib/Transforms/Utils
parentb7848974cdc2b476514ee9b260e59a23ceb0e39f (diff)
downloadbcm5719-llvm-b38b443b15f6c97371e3596b91444b1b09ebeb37.tar.gz
bcm5719-llvm-b38b443b15f6c97371e3596b91444b1b09ebeb37.zip
Teach simplifycfg that setcc is cheap and non-trapping, so that it can
convert this: %tmp.1 = seteq int %i, 0 ; <bool> [#uses=1] br bool %tmp.1, label %shortcirc_done, label %shortcirc_next shortcirc_next: ; preds = %entry %tmp.4 = seteq int %j, 0 ; <bool> [#uses=1] br label %shortcirc_done shortcirc_done: ; preds = %shortcirc_next, %entry %shortcirc_val = phi bool [ %tmp.4, %shortcirc_next ], [ true, %entry ] ; <bool> [#uses=1] to this: %tmp.1 = seteq int %i, 0 ; <bool> [#uses=1] %tmp.4 = seteq int %j, 0 ; <bool> [#uses=1] %shortcirc_val = select bool %tmp.1, bool true, bool %tmp.4 ; <bool> [#uses=1] ... which is later simplified by instcombine into an or. llvm-svn: 21388
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyCFG.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index 12af5b04d59..986a53f11ff 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -232,6 +232,12 @@ static bool DominatesMergePoint(Value *V, BasicBlock *BB,
case Instruction::Xor:
case Instruction::Shl:
case Instruction::Shr:
+ case Instruction::SetEQ:
+ case Instruction::SetNE:
+ case Instruction::SetLT:
+ case Instruction::SetGT:
+ case Instruction::SetLE:
+ case Instruction::SetGE:
break; // These are all cheap and non-trapping instructions.
}
OpenPOWER on IntegriCloud