Add a test for my change to disable reassociation for i1 types.
authorBob Wilson <bob.wilson@apple.com>
Sat, 6 Feb 2010 01:16:25 +0000 (01:16 +0000)
committerBob Wilson <bob.wilson@apple.com>
Sat, 6 Feb 2010 01:16:25 +0000 (01:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95465 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/Reassociate/basictest.ll

index e77d83d160e40f91121b7b7d9e1dcb56ffd24fb4..086474066c56154ba2317a5629bb5a7c3ff28ce2 100644 (file)
@@ -203,4 +203,14 @@ define i32 @test14(i32 %X1, i32 %X2) {
 ; CHECK-NEXT: ret i32
 }
 
+; Do not reassociate expressions of type i1
+define i32 @test15(i32 %X1, i32 %X2, i32 %X3) {
+  %A = icmp ne i32 %X1, 0
+  %B = icmp slt i32 %X2, %X3
+  %C = and i1 %A, %B
+  %D = select i1 %C, i32 %X1, i32 0
+  ret i32 %D
+; CHECK: @test15
+; CHECK: and i1 %A, %B
+}