llvm.org GIT mirror llvm / 9c197eb
[NFC][Reassociate] Fix mistake in 468b2ad Missed 2 'fast fsub(0.0,X) -> fneg(X)' changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362631 91177308-0d34-0410-b5e6-96231b3b80d8 Cameron McInally 3 months ago
1 changed file(s) with 8 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
540540 ret float %g
541541 }
542542
543 ; FIXME: This reassociation is not working.
544543 define float @test17_unary_fneg(float %a, float %b, float %z) {
545544 ; CHECK-LABEL: @test17_unary_fneg(
546 ; CHECK-NEXT: [[E:%.*]] = fmul fast float [[A:%.*]], -1.234500e+04
547 ; CHECK-NEXT: [[F:%.*]] = fmul fast float [[E]], [[B:%.*]]
548 ; CHECK-NEXT: [[TMP1:%.*]] = fmul fast float [[F]], [[Z:%.*]]
549 ; CHECK-NEXT: [[G:%.*]] = fsub fast float -0.000000e+00, [[TMP1]]
550 ; CHECK-NEXT: ret float [[G]]
545 ; CHECK-NEXT: [[D:%.*]] = fmul fast float [[A:%.*]], 1.234500e+04
546 ; CHECK-NEXT: [[E:%.*]] = fmul fast float [[D]], [[B:%.*]]
547 ; CHECK-NEXT: [[TMP1:%.*]] = fmul fast float [[E]], [[Z:%.*]]
548 ; CHECK-NEXT: ret float [[TMP1]]
551549 ;
552550 %c = fneg fast float %z
553551 %d = fmul fast float %a, %b
554552 %e = fmul fast float %c, %d
555553 %f = fmul fast float %e, 1.234500e+04
556 %g = fsub fast float 0.000000e+00, %f
554 %g = fneg fast float %f
557555 ret float %g
558556 }
559557
591589 define float @test18_unary_fneg(float %a, float %b, float %z) {
592590 ; CHECK-LABEL: @test18_unary_fneg(
593591 ; CHECK-NEXT: [[C:%.*]] = fmul fast float [[Z:%.*]], -4.000000e+01
594 ; CHECK-NEXT: [[TMP1:%.*]] = fmul fast float [[C]], [[A:%.*]]
595 ; CHECK-NEXT: [[F:%.*]] = fsub fast float -0.000000e+00, [[TMP1]]
592 ; CHECK-NEXT: [[E:%.*]] = fmul fast float [[C]], [[A:%.*]]
593 ; CHECK-NEXT: [[F:%.*]] = fneg fast float [[E]]
596594 ; CHECK-NEXT: ret float [[F]]
597595 ;
598596 %d = fmul fast float %z, 4.000000e+01
599597 %c = fneg fast float %d
600598 %e = fmul fast float %a, %c
601 %f = fsub fast float 0.000000e+00, %e
599 %f = fneg fast float %e
602600 ret float %f
603601 }
604602