[PATCH] D11438: Fix x86_64 fp128 calling convention

David Li via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 21 11:54:24 PST 2015


davidxl added inline comments.

================
Comment at: lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp:158
@@ +157,3 @@
+    // When LegalInHWReg is true, we take a short-cut in SoftenFloatOperand
+    // to save repeated computations and make the code simpler there.
+    // So here we need to call ReplaceValueWith.
----------------
I don't quite like the short cut here either.  The original architected flow is reasonable to me: basically 
1) After softenfloat result, the old SDValue is mapped to the new result
2) the worklist based loop follow DU and use instrctions of the old result get processed -- operands are scanned.
3) during scanning, the use of the old value will be replaced with the new value.
4) if scan operands result in a new node, replaceValueWith then needs to be eagerly called here on demand.

I prefer you do not change the flow in SoftenFloatOperands and make a patch here to workaround it. The resulting change may look bigger (as more opcodes need to be handled), but it is what it is.

I also suggest you extract the following patches out seperately
1) softenFloatResult and softenFloatOperands
2) f128 constantFP
3) register class small refactoring
4) the rest (may also be breakable )


http://reviews.llvm.org/D11438





More information about the llvm-commits mailing list