[PATCH] D81918: [PowerPC] Support lowering int-to-fp on ppc_fp128

Ulrich Weigand via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 17 03:43:16 PDT 2020


uweigand requested changes to this revision.
uweigand added a comment.
This revision now requires changes to proceed.

See inline comments about chain handling.



================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp:1681
+    Lo = DAG.getNode(ISD::STRICT_FADD, dl, {VT, MVT::Other},
+                     {N->getOperand(0), Hi, NewLo});
+  else
----------------
This looks like the wrong input Chain if we already performed an operation above -- it should use the output chain of that operation as input here.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp:1685
   Lo = DAG.getSelectCC(dl, Src, DAG.getConstant(0, dl, SrcVT),
                        Lo, Hi, ISD::SETLT);
   GetPairElements(Lo, Lo, Hi);
----------------
OK, well, even if we keep the existing algorithm with the FIXME, this still isn't correct as it loses the Chain after the FADD.   I think in the strict case we'll need to use a strict version of SelectCC (passing in the Chain from the FADD) and the use the resulting output Chain for the overall output (via ReplaceValueWith as above -- in fact, if we fall through down here, we actually should *not* do the ReplaceValueWith above, since that would be the wrong chain).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81918/new/

https://reviews.llvm.org/D81918





More information about the llvm-commits mailing list