File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
llvm/lib/CodeGen/SelectionDAG Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -18477,14 +18477,14 @@ static SDValue eliminateFPCastPair(SDNode *N) {
1847718477 }
1847818478
1847918479 if (N0.getOpcode() == NarrowingOp && N0.getOperand(0).getValueType() == VT) {
18480- const SDNodeFlags SrcFlags = N0->getFlags();
18481- const SDNodeFlags DstFlags = N->getFlags();
18480+ const SDNodeFlags NarrowFlags = N0->getFlags();
18481+ const SDNodeFlags WidenFlags = N->getFlags();
1848218482 // Narrowing can introduce inf and change the encoding of a nan, so the
18483- // destination must have the nnan and ninf flags to indicate that we don't
18484- // need to care about that. We are also removing a rounding step, and that
18485- // requires both the source and destination to allow contraction.
18486- if (DstFlags .hasNoNaNs() && DstFlags .hasNoInfs() &&
18487- SrcFlags .hasAllowContract() && DstFlags .hasAllowContract()) {
18483+ // widen must have the nnan and ninf flags to indicate that we don't need to
18484+ // care about that. We are also removing a rounding step, and that requires
18485+ // both the narrow and widen to allow contraction.
18486+ if (WidenFlags .hasNoNaNs() && WidenFlags .hasNoInfs() &&
18487+ NarrowFlags .hasAllowContract() && WidenFlags .hasAllowContract()) {
1848818488 return N0.getOperand(0);
1848918489 }
1849018490 }
You can’t perform that action at this time.
0 commit comments