aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/SimplifyCFG/switch-to-icmp.ll
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-02-07 22:37:28 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-02-07 22:37:28 +0000
commit33828bcb24176aae72afac0e4953e4b7f9560ef1 (patch)
treee5e5d47983c6c1ea457955f84a56b467856f45dc /test/Transforms/SimplifyCFG/switch-to-icmp.ll
parent706d946cfe44fa93f482c3a56ed42d52ca81b257 (diff)
downloadexternal_llvm-33828bcb24176aae72afac0e4953e4b7f9560ef1.zip
external_llvm-33828bcb24176aae72afac0e4953e4b7f9560ef1.tar.gz
external_llvm-33828bcb24176aae72afac0e4953e4b7f9560ef1.tar.bz2
SimplifyCFG: Track the number of used icmps when turning a icmp chain into a switch. If we used only one icmp, don't turn it into a switch.
Also prevent the switch-to-icmp transform from creating identity adds, noticed by Marius Wachtler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125056 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/SimplifyCFG/switch-to-icmp.ll')
-rw-r--r--test/Transforms/SimplifyCFG/switch-to-icmp.ll7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/Transforms/SimplifyCFG/switch-to-icmp.ll b/test/Transforms/SimplifyCFG/switch-to-icmp.ll
index 2499cdb..414f847 100644
--- a/test/Transforms/SimplifyCFG/switch-to-icmp.ll
+++ b/test/Transforms/SimplifyCFG/switch-to-icmp.ll
@@ -16,8 +16,8 @@ lor.end:
ret i1 %0
; CHECK: @test1
-; CHECK: %off = add i32 %x, -1
-; CHECK: %switch = icmp ult i32 %off, 3
+; CHECK: %x.off = add i32 %x, -1
+; CHECK: %switch = icmp ult i32 %x.off, 3
}
define zeroext i1 @test2(i32 %x) nounwind readnone ssp noredzone {
@@ -35,6 +35,5 @@ lor.end:
ret i1 %0
; CHECK: @test2
-; CHECK: %off = add i32 %x, 0
-; CHECK: %switch = icmp ult i32 %off, 2
+; CHECK: %switch = icmp ult i32 %x, 2
}