diff options
author | Chris Lattner <sabre@nondot.org> | 2005-04-21 05:31:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-04-21 05:31:13 +0000 |
commit | bf5d4fb7d8ee4537955610ef9c48f7009418efc3 (patch) | |
tree | 2b0dad29a62ef658a439168e18e64735460e80e2 /lib/Transforms/Utils/SimplifyCFG.cpp | |
parent | 01d7139f930a842ee65c3a5f8d1730e74c561fdb (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21388 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r-- | lib/Transforms/Utils/SimplifyCFG.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp index 12af5b04d5..986a53f11f 100644 --- a/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/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. } |