[llvm] r362631 - [NFC][Reassociate] Fix mistake in 468b2ad
Cameron McInally via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 5 11:50:07 PDT 2019
Author: mcinally
Date: Wed Jun 5 11:50:07 2019
New Revision: 362631
URL: http://llvm.org/viewvc/llvm-project?rev=362631&view=rev
Log:
[NFC][Reassociate] Fix mistake in 468b2ad
Missed 2 'fast fsub(0.0,X) -> fneg(X)' changes.
Modified:
llvm/trunk/test/Transforms/Reassociate/fast-basictest.ll
Modified: llvm/trunk/test/Transforms/Reassociate/fast-basictest.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Reassociate/fast-basictest.ll?rev=362631&r1=362630&r2=362631&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Reassociate/fast-basictest.ll (original)
+++ llvm/trunk/test/Transforms/Reassociate/fast-basictest.ll Wed Jun 5 11:50:07 2019
@@ -541,20 +541,18 @@ define float @test17(float %a, float %b,
ret float %g
}
-; FIXME: This reassociation is not working.
define float @test17_unary_fneg(float %a, float %b, float %z) {
; CHECK-LABEL: @test17_unary_fneg(
-; CHECK-NEXT: [[E:%.*]] = fmul fast float [[A:%.*]], -1.234500e+04
-; CHECK-NEXT: [[F:%.*]] = fmul fast float [[E]], [[B:%.*]]
-; CHECK-NEXT: [[TMP1:%.*]] = fmul fast float [[F]], [[Z:%.*]]
-; CHECK-NEXT: [[G:%.*]] = fsub fast float -0.000000e+00, [[TMP1]]
-; CHECK-NEXT: ret float [[G]]
+; CHECK-NEXT: [[D:%.*]] = fmul fast float [[A:%.*]], 1.234500e+04
+; CHECK-NEXT: [[E:%.*]] = fmul fast float [[D]], [[B:%.*]]
+; CHECK-NEXT: [[TMP1:%.*]] = fmul fast float [[E]], [[Z:%.*]]
+; CHECK-NEXT: ret float [[TMP1]]
;
%c = fneg fast float %z
%d = fmul fast float %a, %b
%e = fmul fast float %c, %d
%f = fmul fast float %e, 1.234500e+04
- %g = fsub fast float 0.000000e+00, %f
+ %g = fneg fast float %f
ret float %g
}
@@ -592,14 +590,14 @@ define float @test18(float %a, float %b,
define float @test18_unary_fneg(float %a, float %b, float %z) {
; CHECK-LABEL: @test18_unary_fneg(
; CHECK-NEXT: [[C:%.*]] = fmul fast float [[Z:%.*]], -4.000000e+01
-; CHECK-NEXT: [[TMP1:%.*]] = fmul fast float [[C]], [[A:%.*]]
-; CHECK-NEXT: [[F:%.*]] = fsub fast float -0.000000e+00, [[TMP1]]
+; CHECK-NEXT: [[E:%.*]] = fmul fast float [[C]], [[A:%.*]]
+; CHECK-NEXT: [[F:%.*]] = fneg fast float [[E]]
; CHECK-NEXT: ret float [[F]]
;
%d = fmul fast float %z, 4.000000e+01
%c = fneg fast float %d
%e = fmul fast float %a, %c
- %f = fsub fast float 0.000000e+00, %e
+ %f = fneg fast float %e
ret float %f
}
More information about the llvm-commits
mailing list