1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=sccp -S | FileCheck %s
4 ; Test some XOR simplifications / range propagation.
5 define void@xor1(i1 %cmp) {
8 ; CHECK-NEXT: br i1 [[CMP:%.*]], label [[IF_TRUE:%.*]], label [[END:%.*]]
10 ; CHECK-NEXT: br label [[END]]
12 ; CHECK-NEXT: call void @use(i1 true)
13 ; CHECK-NEXT: call void @use(i1 false)
14 ; CHECK-NEXT: call void @use(i1 false)
15 ; CHECK-NEXT: call void @use(i1 true)
16 ; CHECK-NEXT: ret void
19 br i1 %cmp, label %if.true, label %end
25 %p = phi i32 [ 11, %entry ], [ 11, %if.true]
26 %xor.1 = xor i32 %p, %p
27 %c.1 = icmp eq i32 %xor.1, 0
28 call void @use(i1 %c.1)
29 %c.2 = icmp eq i32 %xor.1, 10
30 call void @use(i1 %c.2)
31 %xor.2 = xor i32 %p, 1
32 %c.3 = icmp eq i32 %xor.2, 11
33 call void @use(i1 %c.3)
34 %c.4 = icmp eq i32 %xor.2, 10
35 call void @use(i1 %c.4)