mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-05 10:17:36 +00:00
[InstSimplify] add tests for undef + partial undef constant folding; NFC
These tests should probably go under a separate test file because they should fold with just -constprop, but they're similar to the scalar tests already in here. llvm-svn: 348045
This commit is contained in:
parent
3a2addb4a0
commit
ceb5e1418c
@ -451,3 +451,83 @@ define double @frem_undef_op1_fast_constant_inf(double %x) {
|
||||
ret double %r
|
||||
}
|
||||
|
||||
define <2 x double> @fadd_undef_op1_constant_vec(<2 x double> %x) {
|
||||
; CHECK-LABEL: @fadd_undef_op1_constant_vec(
|
||||
; CHECK-NEXT: ret <2 x double> <double 0x7FF8000000000000, double undef>
|
||||
;
|
||||
%r = fadd <2 x double> <double 42.0, double undef>, undef
|
||||
ret <2 x double> %r
|
||||
}
|
||||
|
||||
define <2 x double> @fadd_undef_op0_constant_vec(<2 x double> %x) {
|
||||
; CHECK-LABEL: @fadd_undef_op0_constant_vec(
|
||||
; CHECK-NEXT: ret <2 x double> <double undef, double 0x7FF8000000000000>
|
||||
;
|
||||
%r = fadd <2 x double> undef, <double undef, double 42.0>
|
||||
ret <2 x double> %r
|
||||
}
|
||||
|
||||
define <2 x double> @fsub_undef_op1_constant_vec(<2 x double> %x) {
|
||||
; CHECK-LABEL: @fsub_undef_op1_constant_vec(
|
||||
; CHECK-NEXT: ret <2 x double> <double undef, double 0x7FF8000000000000>
|
||||
;
|
||||
%r = fsub <2 x double> <double undef, double 42.0>, undef
|
||||
ret <2 x double> %r
|
||||
}
|
||||
|
||||
define <2 x double> @fsub_undef_op0_constant_vec(<2 x double> %x) {
|
||||
; CHECK-LABEL: @fsub_undef_op0_constant_vec(
|
||||
; CHECK-NEXT: ret <2 x double> <double 0x7FF8000000000000, double undef>
|
||||
;
|
||||
%r = fsub <2 x double> undef, <double 42.0, double undef>
|
||||
ret <2 x double> %r
|
||||
}
|
||||
|
||||
define <2 x double> @fmul_undef_op1_constant_vec(<2 x double> %x) {
|
||||
; CHECK-LABEL: @fmul_undef_op1_constant_vec(
|
||||
; CHECK-NEXT: ret <2 x double> <double 0x7FF8000000000000, double undef>
|
||||
;
|
||||
%r = fmul <2 x double> <double 42.0, double undef>, undef
|
||||
ret <2 x double> %r
|
||||
}
|
||||
|
||||
define <2 x double> @fmul_undef_op0_constant_vec(<2 x double> %x) {
|
||||
; CHECK-LABEL: @fmul_undef_op0_constant_vec(
|
||||
; CHECK-NEXT: ret <2 x double> <double undef, double 0x7FF8000000000000>
|
||||
;
|
||||
%r = fmul <2 x double> undef, <double undef, double 42.0>
|
||||
ret <2 x double> %r
|
||||
}
|
||||
|
||||
define <2 x double> @fdiv_undef_op1_constant_vec(<2 x double> %x) {
|
||||
; CHECK-LABEL: @fdiv_undef_op1_constant_vec(
|
||||
; CHECK-NEXT: ret <2 x double> <double 0x7FF8000000000000, double undef>
|
||||
;
|
||||
%r = fdiv <2 x double> <double 42.0, double undef>, undef
|
||||
ret <2 x double> %r
|
||||
}
|
||||
|
||||
define <2 x double> @fdiv_undef_op0_constant_vec(<2 x double> %x) {
|
||||
; CHECK-LABEL: @fdiv_undef_op0_constant_vec(
|
||||
; CHECK-NEXT: ret <2 x double> <double undef, double 0x7FF8000000000000>
|
||||
;
|
||||
%r = fdiv <2 x double> undef, <double undef, double 42.0>
|
||||
ret <2 x double> %r
|
||||
}
|
||||
|
||||
define <2 x double> @frem_undef_op1_constant_vec(<2 x double> %x) {
|
||||
; CHECK-LABEL: @frem_undef_op1_constant_vec(
|
||||
; CHECK-NEXT: ret <2 x double> <double undef, double 0x7FF8000000000000>
|
||||
;
|
||||
%r = frem <2 x double> <double undef, double 42.0>, undef
|
||||
ret <2 x double> %r
|
||||
}
|
||||
|
||||
define <2 x double> @frem_undef_op0_constant_vec(<2 x double> %x) {
|
||||
; CHECK-LABEL: @frem_undef_op0_constant_vec(
|
||||
; CHECK-NEXT: ret <2 x double> <double 0x7FF8000000000000, double undef>
|
||||
;
|
||||
%r = frem <2 x double> undef, <double 42.0, double undef>
|
||||
ret <2 x double> %r
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user