brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 1fc2e5e Raw
40 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt < %s -passes=sccp -S | FileCheck %s3 4; Test some XOR simplifications / range propagation.5define void@xor1(i1 %cmp) {6; CHECK-LABEL: @xor1(7; CHECK-NEXT:  entry:8; CHECK-NEXT:    br i1 [[CMP:%.*]], label [[IF_TRUE:%.*]], label [[END:%.*]]9; CHECK:       if.true:10; CHECK-NEXT:    br label [[END]]11; CHECK:       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 void17;18entry:19  br i1 %cmp, label %if.true, label %end20 21if.true:22  br label %end23 24end:25  %p = phi i32 [ 11, %entry ], [ 11, %if.true]26  %xor.1 = xor i32 %p, %p27  %c.1 = icmp eq i32 %xor.1, 028  call void @use(i1 %c.1)29  %c.2 = icmp eq i32 %xor.1, 1030  call void @use(i1 %c.2)31  %xor.2 = xor i32 %p, 132  %c.3 = icmp eq i32 %xor.2, 1133  call void @use(i1 %c.3)34  %c.4 = icmp eq i32 %xor.2, 1035  call void @use(i1 %c.4)36  ret void37}38 39declare void @use(i1)40