File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
llvm/test/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -2714,3 +2714,31 @@ join:
2714
2714
%cmp = icmp slt i32 %13 , 0
2715
2715
ret i1 %cmp
2716
2716
}
2717
+
2718
+ define void @phi_op_in_loop (i1 %c , i32 %x ) {
2719
+ ; CHECK-LABEL: @phi_op_in_loop(
2720
+ ; CHECK-NEXT: br label [[LOOP:%.*]]
2721
+ ; CHECK: loop:
2722
+ ; CHECK-NEXT: br i1 [[C:%.*]], label [[IF:%.*]], label [[LOOP_LATCH:%.*]]
2723
+ ; CHECK: if:
2724
+ ; CHECK-NEXT: br label [[LOOP_LATCH]]
2725
+ ; CHECK: loop.latch:
2726
+ ; CHECK-NEXT: [[PHI:%.*]] = phi i32 [ [[X:%.*]], [[IF]] ], [ 0, [[LOOP]] ]
2727
+ ; CHECK-NEXT: [[AND:%.*]] = and i32 [[PHI]], 1
2728
+ ; CHECK-NEXT: call void @use(i32 [[AND]])
2729
+ ; CHECK-NEXT: br label [[LOOP]]
2730
+ ;
2731
+ br label %loop
2732
+
2733
+ loop:
2734
+ br i1 %c , label %if , label %loop.latch
2735
+
2736
+ if:
2737
+ br label %loop.latch
2738
+
2739
+ loop.latch:
2740
+ %phi = phi i32 [ %x , %if ], [ 0 , %loop ]
2741
+ %and = and i32 %phi , 1
2742
+ call void @use (i32 %and )
2743
+ br label %loop
2744
+ }
You can’t perform that action at this time.
0 commit comments