[InstCombine] Add more tests to freeze-phi.ll; NFC

This commit is contained in:
Juneyoung Lee 2020-07-27 09:43:00 +09:00
parent 47a40eda17
commit 194a4beedd
1 changed files with 46 additions and 1 deletions

View File

@ -20,7 +20,52 @@ B:
C:
%y = phi i32 [0, %A], [1, %B]
%y.fr = freeze i32 %y
ret i32 %y
ret i32 %y.fr
}
define <2 x i32> @vec(i1 %cond) {
; CHECK-LABEL: @vec(
; CHECK-NEXT: br i1 [[COND:%.*]], label [[A:%.*]], label [[B:%.*]]
; CHECK: A:
; CHECK-NEXT: br label [[C:%.*]]
; CHECK: B:
; CHECK-NEXT: br label [[C]]
; CHECK: C:
; CHECK-NEXT: [[Y:%.*]] = phi <2 x i32> [ <i32 0, i32 1>, [[A]] ], [ <i32 2, i32 3>, [[B]] ]
; CHECK-NEXT: ret <2 x i32> [[Y]]
;
br i1 %cond, label %A, label %B
A:
br label %C
B:
br label %C
C:
%y = phi <2 x i32> [<i32 0, i32 1>, %A], [<i32 2, i32 3>, %B]
%y.fr = freeze <2 x i32> %y
ret <2 x i32> %y.fr
}
define <2 x i32> @vec_undef(i1 %cond) {
; CHECK-LABEL: @vec_undef(
; CHECK-NEXT: br i1 [[COND:%.*]], label [[A:%.*]], label [[B:%.*]]
; CHECK: A:
; CHECK-NEXT: br label [[C:%.*]]
; CHECK: B:
; CHECK-NEXT: br label [[C]]
; CHECK: C:
; CHECK-NEXT: [[Y:%.*]] = phi <2 x i32> [ <i32 0, i32 1>, [[A]] ], [ <i32 2, i32 undef>, [[B]] ]
; CHECK-NEXT: [[Y_FR:%.*]] = freeze <2 x i32> [[Y]]
; CHECK-NEXT: ret <2 x i32> [[Y_FR]]
;
br i1 %cond, label %A, label %B
A:
br label %C
B:
br label %C
C:
%y = phi <2 x i32> [<i32 0, i32 1>, %A], [<i32 2, i32 undef>, %B]
%y.fr = freeze <2 x i32> %y
ret <2 x i32> %y.fr
}
define i32 @one(i1 %cond, i32 %x) {