1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -reassociate -die -S | FileCheck %s
5 define i32 @test1(i32 %a, i32 %b) {
7 ; CHECK-NEXT: ret i32 0
11 %t5 = and i32 %t2, %t4
15 define <2 x i32> @not_op_vec_undef(<2 x i32> %a, <2 x i32> %b) {
16 ; CHECK-LABEL: @not_op_vec_undef(
17 ; CHECK-NEXT: ret <2 x i32> zeroinitializer
19 %t2 = and <2 x i32> %b, %a
20 %t4 = xor <2 x i32> %a, <i32 -1, i32 undef>
21 %t5 = and <2 x i32> %t2, %t4
26 define i32 @test2(i32 %a, i32 %b) {
27 ; CHECK-LABEL: @test2(
28 ; CHECK-NEXT: ret i32 0
30 %t1 = and i32 %a, 1234
33 %t5 = and i32 %t2, %t4
37 ; (b+(a+1234))+-a -> b+1234
38 define i32 @test3(i32 %b, i32 %a) {
39 ; CHECK-LABEL: @test3(
40 ; CHECK-NEXT: [[T5:%.*]] = add i32 [[B:%.*]], 1234
41 ; CHECK-NEXT: ret i32 [[T5]]
43 %t1 = add i32 %a, 1234
46 %t5 = add i32 %t2, %t4
50 ; (b+(a+1234))+~a -> b+1233
51 define i32 @test4(i32 %b, i32 %a) {
52 ; CHECK-LABEL: @test4(
53 ; CHECK-NEXT: [[T5:%.*]] = add i32 [[B:%.*]], 1233
54 ; CHECK-NEXT: ret i32 [[T5]]
56 %t1 = add i32 %a, 1234
59 %t5 = add i32 %t2, %t4