[PATCH] D26151: RegCall - Handling long double arguments

Akira Hatanaka via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 15:44:41 PST 2016

ahatanak added inline comments.

Comment at: lib/Target/X86/X86FloatingPoint.cpp:485
+  } else if (Bundle.Mask && !Bundle.FixCount) {
+    // In the register calling convention, up to one FP argument could be 
+    // saved in the first FP register.
I guess this is needed only for the entry basic block? If so, perhaps you can move this to runOnMachineFunction so that we don't have to check whether the calling convention is regcall every time a basic block is visited.

Comment at: lib/Target/X86/X86FloatingPoint.cpp:956
     if (R < 8) {
-      assert(MO.isDef() && MO.isImplicit());
+      const MachineFunction* MF = MO.getParent()->getParent()->getParent();
+      if (MF->getFunction()->getCallingConv()
You can move this outside the loop since the calling convention and StackTop don't change inside the loop. 

Comment at: lib/Target/X86/X86FloatingPoint.cpp:973
   assert(STReturns == 0 || (isMask_32(STReturns) && N <= 2));
+  StackTop = 0;
I'm not sure what this comment means.

It seems like you are clearing StackTop because the first FP register can be used to pass an argument when the calling convention is regcall. Is that correct?



More information about the llvm-commits mailing list