New testcasses for divides that can be eliminated.
authorChris Lattner <sabre@nondot.org>
Wed, 29 Sep 2004 17:37:07 +0000 (17:37 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 29 Sep 2004 17:37:07 +0000 (17:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16587 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/div.ll

index 19e0d40166b0ff72b301767efe38f70c69970a64..8e03fc02d4c5c13faee634582279968c11db851d 100644 (file)
@@ -30,3 +30,28 @@ uint %test5(uint %A) {
        %C = div uint %B, 4294967292
        ret uint %C
 }
+
+bool %test6(uint %A) {
+       %B = div uint %A, 123
+       %C = seteq uint %B, 0   ; A < 123
+       ret bool %C
+} 
+
+bool %test7(uint %A) {
+       %B = div uint %A, 10
+       %C = seteq uint %B, 2    ; A >= 20 && A < 30
+       ret bool %C
+}
+
+bool %test8(ubyte %A) {
+       %B = div ubyte %A, 123
+       %C = seteq ubyte %B, 2   ; A >= 246
+       ret bool %C
+} 
+
+bool %test9(ubyte %A) {
+       %B = div ubyte %A, 123
+       %C = setne ubyte %B, 2   ; A < 246
+       ret bool %C
+} 
+