llvm.org GIT mirror llvm / 24d7880
[NFC][SLP] Pre-commit unary FNeg test to X86/propagate_ir_flags.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363978 91177308-0d34-0410-b5e6-96231b3b80d8 Cameron McInally 2 months ago
1 changed file(s) with 78 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
551551 ret void
552552 }
553553
554 define void @fcmp_fast_unary_fneg(double* %x) #1 {
555 ; CHECK-LABEL: @fcmp_fast_unary_fneg(
556 ; CHECK-NEXT: [[IDX1:%.*]] = getelementptr inbounds double, double* [[X:%.*]], i64 0
557 ; CHECK-NEXT: [[IDX2:%.*]] = getelementptr inbounds double, double* [[X]], i64 1
558 ; CHECK-NEXT: [[TMP1:%.*]] = bitcast double* [[IDX1]] to <2 x double>*
559 ; CHECK-NEXT: [[TMP2:%.*]] = load <2 x double>, <2 x double>* [[TMP1]], align 8
560 ; CHECK-NEXT: [[TMP3:%.*]] = fcmp fast oge <2 x double> [[TMP2]], zeroinitializer
561 ; CHECK-NEXT: [[TMP4:%.*]] = extractelement <2 x double> [[TMP2]], i32 0
562 ; CHECK-NEXT: [[SUB1:%.*]] = fneg fast double [[TMP4]]
563 ; CHECK-NEXT: [[TMP5:%.*]] = extractelement <2 x double> [[TMP2]], i32 1
564 ; CHECK-NEXT: [[SUB2:%.*]] = fneg fast double [[TMP5]]
565 ; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x double> undef, double [[SUB1]], i32 0
566 ; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x double> [[TMP6]], double [[SUB2]], i32 1
567 ; CHECK-NEXT: [[TMP8:%.*]] = select <2 x i1> [[TMP3]], <2 x double> [[TMP2]], <2 x double> [[TMP7]]
568 ; CHECK-NEXT: [[TMP9:%.*]] = bitcast double* [[IDX1]] to <2 x double>*
569 ; CHECK-NEXT: store <2 x double> [[TMP8]], <2 x double>* [[TMP9]], align 8
570 ; CHECK-NEXT: ret void
571 ;
572 %idx1 = getelementptr inbounds double, double* %x, i64 0
573 %idx2 = getelementptr inbounds double, double* %x, i64 1
574
575 %load1 = load double, double* %idx1, align 8
576 %load2 = load double, double* %idx2, align 8
577
578 %cmp1 = fcmp fast oge double %load1, 0.000000e+00
579 %cmp2 = fcmp fast oge double %load2, 0.000000e+00
580
581 %sub1 = fneg fast double %load1
582 %sub2 = fneg fast double %load2
583
584 %sel1 = select i1 %cmp1, double %load1, double %sub1
585 %sel2 = select i1 %cmp2, double %load2, double %sub2
586
587 store double %sel1, double* %idx1, align 8
588 store double %sel2, double* %idx2, align 8
589
590 ret void
591 }
592
554593 define void @fcmp_no_fast(double* %x) #1 {
555594 ; CHECK-LABEL: @fcmp_no_fast(
556595 ; CHECK-NEXT: [[IDX1:%.*]] = getelementptr inbounds double, double* [[X:%.*]], i64 0
585624 ret void
586625 }
587626
627 define void @fcmp_no_fast_unary_fneg(double* %x) #1 {
628 ; CHECK-LABEL: @fcmp_no_fast_unary_fneg(
629 ; CHECK-NEXT: [[IDX1:%.*]] = getelementptr inbounds double, double* [[X:%.*]], i64 0
630 ; CHECK-NEXT: [[IDX2:%.*]] = getelementptr inbounds double, double* [[X]], i64 1
631 ; CHECK-NEXT: [[TMP1:%.*]] = bitcast double* [[IDX1]] to <2 x double>*
632 ; CHECK-NEXT: [[TMP2:%.*]] = load <2 x double>, <2 x double>* [[TMP1]], align 8
633 ; CHECK-NEXT: [[TMP3:%.*]] = fcmp oge <2 x double> [[TMP2]], zeroinitializer
634 ; CHECK-NEXT: [[TMP4:%.*]] = extractelement <2 x double> [[TMP2]], i32 0
635 ; CHECK-NEXT: [[SUB1:%.*]] = fneg double [[TMP4]]
636 ; CHECK-NEXT: [[TMP5:%.*]] = extractelement <2 x double> [[TMP2]], i32 1
637 ; CHECK-NEXT: [[SUB2:%.*]] = fneg double [[TMP5]]
638 ; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x double> undef, double [[SUB1]], i32 0
639 ; CHECK-NEXT: [[TMP7:%.*]] = insertelement <2 x double> [[TMP6]], double [[SUB2]], i32 1
640 ; CHECK-NEXT: [[TMP8:%.*]] = select <2 x i1> [[TMP3]], <2 x double> [[TMP2]], <2 x double> [[TMP7]]
641 ; CHECK-NEXT: [[TMP9:%.*]] = bitcast double* [[IDX1]] to <2 x double>*
642 ; CHECK-NEXT: store <2 x double> [[TMP8]], <2 x double>* [[TMP9]], align 8
643 ; CHECK-NEXT: ret void
644 ;
645 %idx1 = getelementptr inbounds double, double* %x, i64 0
646 %idx2 = getelementptr inbounds double, double* %x, i64 1
647
648 %load1 = load double, double* %idx1, align 8
649 %load2 = load double, double* %idx2, align 8
650
651 %cmp1 = fcmp fast oge double %load1, 0.000000e+00
652 %cmp2 = fcmp oge double %load2, 0.000000e+00
653
654 %sub1 = fneg double %load1
655 %sub2 = fneg double %load2
656
657 %sel1 = select i1 %cmp1, double %load1, double %sub1
658 %sel2 = select i1 %cmp2, double %load2, double %sub2
659
660 store double %sel1, double* %idx1, align 8
661 store double %sel2, double* %idx2, align 8
662
663 ret void
664 }
665
588666 declare double @llvm.fabs.f64(double) nounwind readnone
589667
590668 define void @call_fast(double* %x) {