llvm.org GIT mirror llvm / 83bcdb1
[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 Sanjay Patel 10 months ago
1 changed file(s) with 80 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
450450 ret double %r
451451 }
452452
453 define <2 x double> @fadd_undef_op1_constant_vec(<2 x double> %x) {
454 ; CHECK-LABEL: @fadd_undef_op1_constant_vec(
455 ; CHECK-NEXT: ret <2 x double>
456 ;
457 %r = fadd <2 x double> , undef
458 ret <2 x double> %r
459 }
460
461 define <2 x double> @fadd_undef_op0_constant_vec(<2 x double> %x) {
462 ; CHECK-LABEL: @fadd_undef_op0_constant_vec(
463 ; CHECK-NEXT: ret <2 x double>
464 ;
465 %r = fadd <2 x double> undef,
466 ret <2 x double> %r
467 }
468
469 define <2 x double> @fsub_undef_op1_constant_vec(<2 x double> %x) {
470 ; CHECK-LABEL: @fsub_undef_op1_constant_vec(
471 ; CHECK-NEXT: ret <2 x double>
472 ;
473 %r = fsub <2 x double> , undef
474 ret <2 x double> %r
475 }
476
477 define <2 x double> @fsub_undef_op0_constant_vec(<2 x double> %x) {
478 ; CHECK-LABEL: @fsub_undef_op0_constant_vec(
479 ; CHECK-NEXT: ret <2 x double>
480 ;
481 %r = fsub <2 x double> undef,
482 ret <2 x double> %r
483 }
484
485 define <2 x double> @fmul_undef_op1_constant_vec(<2 x double> %x) {
486 ; CHECK-LABEL: @fmul_undef_op1_constant_vec(
487 ; CHECK-NEXT: ret <2 x double>
488 ;
489 %r = fmul <2 x double> , undef
490 ret <2 x double> %r
491 }
492
493 define <2 x double> @fmul_undef_op0_constant_vec(<2 x double> %x) {
494 ; CHECK-LABEL: @fmul_undef_op0_constant_vec(
495 ; CHECK-NEXT: ret <2 x double>
496 ;
497 %r = fmul <2 x double> undef,
498 ret <2 x double> %r
499 }
500
501 define <2 x double> @fdiv_undef_op1_constant_vec(<2 x double> %x) {
502 ; CHECK-LABEL: @fdiv_undef_op1_constant_vec(
503 ; CHECK-NEXT: ret <2 x double>
504 ;
505 %r = fdiv <2 x double> , undef
506 ret <2 x double> %r
507 }
508
509 define <2 x double> @fdiv_undef_op0_constant_vec(<2 x double> %x) {
510 ; CHECK-LABEL: @fdiv_undef_op0_constant_vec(
511 ; CHECK-NEXT: ret <2 x double>
512 ;
513 %r = fdiv <2 x double> undef,
514 ret <2 x double> %r
515 }
516
517 define <2 x double> @frem_undef_op1_constant_vec(<2 x double> %x) {
518 ; CHECK-LABEL: @frem_undef_op1_constant_vec(
519 ; CHECK-NEXT: ret <2 x double>
520 ;
521 %r = frem <2 x double> , undef
522 ret <2 x double> %r
523 }
524
525 define <2 x double> @frem_undef_op0_constant_vec(<2 x double> %x) {
526 ; CHECK-LABEL: @frem_undef_op0_constant_vec(
527 ; CHECK-NEXT: ret <2 x double>
528 ;
529 %r = frem <2 x double> undef,
530 ret <2 x double> %r
531 }
532