Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 83bcdb1

Browse files
committed
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348045 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent c16c6e6 commit 83bcdb1

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

test/Transforms/InstSimplify/fp-undef.ll

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,3 +451,83 @@ define double @frem_undef_op1_fast_constant_inf(double %x) {
451451
ret double %r
452452
}
453453

454+
define <2 x double> @fadd_undef_op1_constant_vec(<2 x double> %x) {
455+
; CHECK-LABEL: @fadd_undef_op1_constant_vec(
456+
; CHECK-NEXT: ret <2 x double> <double 0x7FF8000000000000, double undef>
457+
;
458+
%r = fadd <2 x double> <double 42.0, double undef>, undef
459+
ret <2 x double> %r
460+
}
461+
462+
define <2 x double> @fadd_undef_op0_constant_vec(<2 x double> %x) {
463+
; CHECK-LABEL: @fadd_undef_op0_constant_vec(
464+
; CHECK-NEXT: ret <2 x double> <double undef, double 0x7FF8000000000000>
465+
;
466+
%r = fadd <2 x double> undef, <double undef, double 42.0>
467+
ret <2 x double> %r
468+
}
469+
470+
define <2 x double> @fsub_undef_op1_constant_vec(<2 x double> %x) {
471+
; CHECK-LABEL: @fsub_undef_op1_constant_vec(
472+
; CHECK-NEXT: ret <2 x double> <double undef, double 0x7FF8000000000000>
473+
;
474+
%r = fsub <2 x double> <double undef, double 42.0>, undef
475+
ret <2 x double> %r
476+
}
477+
478+
define <2 x double> @fsub_undef_op0_constant_vec(<2 x double> %x) {
479+
; CHECK-LABEL: @fsub_undef_op0_constant_vec(
480+
; CHECK-NEXT: ret <2 x double> <double 0x7FF8000000000000, double undef>
481+
;
482+
%r = fsub <2 x double> undef, <double 42.0, double undef>
483+
ret <2 x double> %r
484+
}
485+
486+
define <2 x double> @fmul_undef_op1_constant_vec(<2 x double> %x) {
487+
; CHECK-LABEL: @fmul_undef_op1_constant_vec(
488+
; CHECK-NEXT: ret <2 x double> <double 0x7FF8000000000000, double undef>
489+
;
490+
%r = fmul <2 x double> <double 42.0, double undef>, undef
491+
ret <2 x double> %r
492+
}
493+
494+
define <2 x double> @fmul_undef_op0_constant_vec(<2 x double> %x) {
495+
; CHECK-LABEL: @fmul_undef_op0_constant_vec(
496+
; CHECK-NEXT: ret <2 x double> <double undef, double 0x7FF8000000000000>
497+
;
498+
%r = fmul <2 x double> undef, <double undef, double 42.0>
499+
ret <2 x double> %r
500+
}
501+
502+
define <2 x double> @fdiv_undef_op1_constant_vec(<2 x double> %x) {
503+
; CHECK-LABEL: @fdiv_undef_op1_constant_vec(
504+
; CHECK-NEXT: ret <2 x double> <double 0x7FF8000000000000, double undef>
505+
;
506+
%r = fdiv <2 x double> <double 42.0, double undef>, undef
507+
ret <2 x double> %r
508+
}
509+
510+
define <2 x double> @fdiv_undef_op0_constant_vec(<2 x double> %x) {
511+
; CHECK-LABEL: @fdiv_undef_op0_constant_vec(
512+
; CHECK-NEXT: ret <2 x double> <double undef, double 0x7FF8000000000000>
513+
;
514+
%r = fdiv <2 x double> undef, <double undef, double 42.0>
515+
ret <2 x double> %r
516+
}
517+
518+
define <2 x double> @frem_undef_op1_constant_vec(<2 x double> %x) {
519+
; CHECK-LABEL: @frem_undef_op1_constant_vec(
520+
; CHECK-NEXT: ret <2 x double> <double undef, double 0x7FF8000000000000>
521+
;
522+
%r = frem <2 x double> <double undef, double 42.0>, undef
523+
ret <2 x double> %r
524+
}
525+
526+
define <2 x double> @frem_undef_op0_constant_vec(<2 x double> %x) {
527+
; CHECK-LABEL: @frem_undef_op0_constant_vec(
528+
; CHECK-NEXT: ret <2 x double> <double 0x7FF8000000000000, double undef>
529+
;
530+
%r = frem <2 x double> undef, <double 42.0, double undef>
531+
ret <2 x double> %r
532+
}
533+

0 commit comments

Comments
 (0)