summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/JumpThreading/select.ll
diff options
context:
space:
mode:
authorGeoff Berry <gberry@codeaurora.org>2015-12-29 18:10:16 +0000
committerGeoff Berry <gberry@codeaurora.org>2015-12-29 18:10:16 +0000
commit43dc285915f571e7a1e22a15468676006125bc9c (patch)
tree73a2edd809d1d828f5bc5443a4d42dcf41abbc10 /llvm/test/Transforms/JumpThreading/select.ll
parent755baa405065d2264a692467bab5702f83f0c570 (diff)
downloadbcm5719-llvm-43dc285915f571e7a1e22a15468676006125bc9c.tar.gz
bcm5719-llvm-43dc285915f571e7a1e22a15468676006125bc9c.zip
[JumpThreading] Fix opcode bonus in getJumpThreadDuplicationCost()
The code that was meant to adjust the duplication cost based on the terminator opcode was not being executed in cases where the initial threshold was hit inside the loop. Subscribers: mcrosier, llvm-commits Differential Revision: http://reviews.llvm.org/D15536 llvm-svn: 256568
Diffstat (limited to 'llvm/test/Transforms/JumpThreading/select.ll')
-rw-r--r--llvm/test/Transforms/JumpThreading/select.ll30
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/test/Transforms/JumpThreading/select.ll b/llvm/test/Transforms/JumpThreading/select.ll
index d0df7725f72..595cacbcbf5 100644
--- a/llvm/test/Transforms/JumpThreading/select.ll
+++ b/llvm/test/Transforms/JumpThreading/select.ll
@@ -91,6 +91,36 @@ L3:
}
+; Jump threading of indirectbr with select as address. Test increased
+; duplication threshold for cases where indirectbr is being threaded
+; through.
+
+; CHECK-LABEL: @test_indirectbr_thresh(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: br i1 %cond, label %L1, label %L3
+; CHECK-NOT: indirectbr
+define void @test_indirectbr_thresh(i1 %cond, i8* %address) nounwind {
+entry:
+ br i1 %cond, label %L0, label %L3
+L0:
+ %indirect.goto.dest = select i1 %cond, i8* blockaddress(@test_indirectbr_thresh, %L1), i8* %address
+ call void @quux()
+ call void @quux()
+ call void @quux()
+ indirectbr i8* %indirect.goto.dest, [label %L1, label %L2, label %L3]
+
+L1:
+ call void @foo()
+ ret void
+L2:
+ call void @bar()
+ ret void
+L3:
+ call void @baz()
+ ret void
+}
+
+
; A more complicated case: the condition is a select based on a comparison.
; CHECK-LABEL: @test_switch_cmp(
OpenPOWER on IntegriCloud