[PATCH] D31946: [legalize-types] Make softening result use a single map for replacements.

Anton Yartsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 19 12:25:20 PDT 2017


ayartsev added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp:115
 
-  // If R is null, the sub-method took care of registering the result.
-  if (R.getNode()) {
+  if (R.getNode() && R.getNode() != N) {
     SetSoftenedFloat(SDValue(N, ResNo), R);
----------------
chh wrote:
> Was there a problem to fix with the new condition (R.getNode() != N)?
> I vaguely remember that x86_64 f128 type implementation might depend on the ability to set a note as softened without changing the node.
> 
No problems arose. In case when a softened node is not in the SoftenedFloats map GetSoftenedFloat() just returns the key node.


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp:813
     case ISD::CopyFromReg:
-    case ISD::CopyToReg:
     case ISD::FABS:
----------------
chh wrote:
> Why not skipping CopyToReg now?
> If it missed some case, could you add a test case?
> 
CopyToReg is now handled in SoftenFloatOperand(). CanSkipSoftenFloatOperand() only handles opcodes that were not handled by SoftenFloatOperand().


https://reviews.llvm.org/D31946





More information about the llvm-commits mailing list