File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -17973,7 +17973,6 @@ SDValue DAGCombiner::visitFSUB(SDNode *N) {
1797317973 ConstantFPSDNode *N1CFP = isConstOrConstSplatFP(N1, true);
1797417974 EVT VT = N->getValueType(0);
1797517975 SDLoc DL(N);
17976- const TargetOptions &Options = DAG.getTarget().Options;
1797717976 const SDNodeFlags Flags = N->getFlags();
1797817977 SelectionDAG::FlagInserter FlagsInserter(DAG, N);
1797917978
@@ -18001,7 +18000,7 @@ SDValue DAGCombiner::visitFSUB(SDNode *N) {
1800118000
1800218001 if (N0 == N1) {
1800318002 // (fsub x, x) -> 0.0
18004- if (Options.NoNaNsFPMath || Flags.hasNoNaNs())
18003+ if (Flags.hasNoNaNs())
1800518004 return DAG.getConstantFP(0.0f, DL, VT);
1800618005 }
1800718006
Original file line number Diff line number Diff line change 1- ; RUN: llc -mcpu=cortex-a9 < %s | FileCheck -check-prefix=SAFE %s
2- ; RUN: llc -mcpu=cortex-a9 --enable-no-nans-fp-math < %s | FileCheck -check-prefix=FAST %s
1+ ; RUN: llc -mcpu=cortex-a9 < %s | FileCheck %s
32
43target triple = "armv7-apple-ios"
54
6- ; SAFE: test
7- ; FAST: test
5+ ; CHECK-LABEL: test
86define float @test (float %x , float %y ) {
97entry:
10- ; SAFE: vmul.f32
11- ; SAFE: vsub.f32
12- ; FAST: mov r0, #0
8+ ; CHECK: vmul.f32
9+ ; CHECK-NEXT: vsub.f32
1310 %0 = fmul float %x , %y
1411 %1 = fsub float %0 , %0
1512 ret float %1
1613}
1714
18-
15+ ; CHECK-LABEL: test_nnan
16+ define float @test_nnan (float %x , float %y ) {
17+ entry:
18+ ; CHECK: mov r0, #0
19+ %0 = fmul float %x , %y
20+ %1 = fsub nnan float %0 , %0
21+ ret float %1
22+ }
You can’t perform that action at this time.
0 commit comments