summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-11-30 18:12:52 +0000
committerChris Lattner <sabre@nondot.org>2010-11-30 18:12:52 +0000
commitea41dfe385f9e21a1d8dacc43378383f01fa361d (patch)
tree113ba748ab85e551cef641787e3d311fdaa40d28 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
parent4bb6ceb7647e7191a2cebde4c91c1576ca35bfac (diff)
downloadbcm5719-llvm-ea41dfe385f9e21a1d8dacc43378383f01fa361d.tar.gz
bcm5719-llvm-ea41dfe385f9e21a1d8dacc43378383f01fa361d.zip
add TLI support indicating that jumps are more expensive than logical operations
and use this to disable a specific optimization. Patch by Micah Villmow! llvm-svn: 120435
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index d00643f1f18..6dfc6b53c71 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -1403,6 +1403,7 @@ void SelectionDAGBuilder::visitBr(const BranchInst &I) {
// If this is a series of conditions that are or'd or and'd together, emit
// this as a sequence of branches instead of setcc's with and/or operations.
+ // As long as jumps are not expensive, this should improve performance.
// For example, instead of something like:
// cmp A, B
// C = seteq
@@ -1417,7 +1418,8 @@ void SelectionDAGBuilder::visitBr(const BranchInst &I) {
// jle foo
//
if (const BinaryOperator *BOp = dyn_cast<BinaryOperator>(CondVal)) {
- if (BOp->hasOneUse() &&
+ if (!TLI.isJumpExpensive() &&
+ BOp->hasOneUse() &&
(BOp->getOpcode() == Instruction::And ||
BOp->getOpcode() == Instruction::Or)) {
FindMergedConditions(BOp, Succ0MBB, Succ1MBB, BrMBB, BrMBB,
OpenPOWER on IntegriCloud