[PATCH] D22315: Teach fast isel about thiscall (and callee-pop) calls.

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 13 15:26:59 PDT 2016


rnk added inline comments.

================
Comment at: lib/Target/X86/X86FastISel.cpp:3028
@@ -3027,2 +3027,3 @@
   case CallingConv::X86_FastCall:
+  case CallingConv::X86_ThisCall:
   case CallingConv::X86_64_Win64:
----------------
Maybe toss stdcall on here, since that's easier than thiscall.

================
Comment at: lib/Target/X86/X86FastISel.cpp:3117
@@ -3120,3 +3116,3 @@
   // Get a count of how many bytes are to be pushed on the stack.
   unsigned NumBytes = CCInfo.getAlignedCallFrameSize();
 
----------------
"getAlignedCallFrameSize" makes me suspicious 

================
Comment at: lib/Target/X86/X86FastISel.cpp:3337
@@ +3336,3 @@
+                       TM.Options.GuaranteedTailCallOpt)
+          ? NumBytes // Callee pops everything.
+          : computeBytesPoppedByCallee(Subtarget, CC, CLI.CS);
----------------
I don't think this is true if stack realignment is active. NumBytes is the argument size rounded up to stack alignment. Make a test case with alloca align 32 to see if there's a bug.


http://reviews.llvm.org/D22315





More information about the llvm-commits mailing list