forked from OSchip/llvm-project
[InstCombine] add tests for select with frozen condition; NFC
This commit is contained in:
parent
359dbb0d3d
commit
60de144119
|
@ -2595,8 +2595,8 @@ define i8 @cond_freeze(i8 %x, i8 %y) {
|
|||
ret i8 %s
|
||||
}
|
||||
|
||||
define i8 @cond_freeze2(i8 %x, i8 %y) {
|
||||
; CHECK-LABEL: @cond_freeze2(
|
||||
define i8 @cond_freeze_constant_false_val(i8 %x) {
|
||||
; CHECK-LABEL: @cond_freeze_constant_false_val(
|
||||
; CHECK-NEXT: ret i8 1
|
||||
;
|
||||
%cond.fr = freeze i1 undef
|
||||
|
@ -2604,8 +2604,8 @@ define i8 @cond_freeze2(i8 %x, i8 %y) {
|
|||
ret i8 %s
|
||||
}
|
||||
|
||||
define i8 @cond_freeze3(i8 %x) {
|
||||
; CHECK-LABEL: @cond_freeze3(
|
||||
define i8 @cond_freeze_constant_true_val(i8 %x) {
|
||||
; CHECK-LABEL: @cond_freeze_constant_true_val(
|
||||
; CHECK-NEXT: ret i8 1
|
||||
;
|
||||
%cond.fr = freeze i1 undef
|
||||
|
@ -2613,8 +2613,17 @@ define i8 @cond_freeze3(i8 %x) {
|
|||
ret i8 %s
|
||||
}
|
||||
|
||||
define <2 x i8> @cond_freeze_vec(<2 x i8> %x) {
|
||||
; CHECK-LABEL: @cond_freeze_vec(
|
||||
define i8 @cond_freeze_both_arms_constant() {
|
||||
; CHECK-LABEL: @cond_freeze_both_arms_constant(
|
||||
; CHECK-NEXT: ret i8 3
|
||||
;
|
||||
%cond.fr = freeze i1 undef
|
||||
%s = select i1 %cond.fr, i8 42, i8 3
|
||||
ret i8 %s
|
||||
}
|
||||
|
||||
define <2 x i8> @cond_freeze_constant_true_val_vec(<2 x i8> %x) {
|
||||
; CHECK-LABEL: @cond_freeze_constant_true_val_vec(
|
||||
; CHECK-NEXT: ret <2 x i8> <i8 1, i8 2>
|
||||
;
|
||||
%cond.fr = freeze <2 x i1> <i1 undef, i1 undef>
|
||||
|
@ -2622,6 +2631,17 @@ define <2 x i8> @cond_freeze_vec(<2 x i8> %x) {
|
|||
ret <2 x i8> %s
|
||||
}
|
||||
|
||||
define <2 x i8> @partial_cond_freeze_constant_true_val_vec(<2 x i8> %x) {
|
||||
; CHECK-LABEL: @partial_cond_freeze_constant_true_val_vec(
|
||||
; CHECK-NEXT: [[COND_FR:%.*]] = freeze <2 x i1> <i1 true, i1 undef>
|
||||
; CHECK-NEXT: [[S:%.*]] = select <2 x i1> [[COND_FR]], <2 x i8> <i8 1, i8 2>, <2 x i8> [[X:%.*]]
|
||||
; CHECK-NEXT: ret <2 x i8> [[S]]
|
||||
;
|
||||
%cond.fr = freeze <2 x i1> <i1 true, i1 undef>
|
||||
%s = select <2 x i1> %cond.fr, <2 x i8> <i8 1, i8 2>, <2 x i8> %x
|
||||
ret <2 x i8> %s
|
||||
}
|
||||
|
||||
declare void @foo2(i8, i8)
|
||||
|
||||
define void @cond_freeze_multipleuses(i8 %x, i8 %y) {
|
||||
|
|
Loading…
Reference in New Issue