[PATCH] D22044: [X86] Support of no_caller_saved_registers attribute (LLVM part)

Amjad Aboud via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 24 04:46:53 PDT 2016


aaboud added inline comments.

================
Comment at: lib/Target/X86/X86ISelLowering.cpp:3374
@@ -3365,1 +3373,3 @@
+        //        X86_INTR calling convention. Is there a better way to do this?
+        MF, HasNCSR ? CallingConv::X86_INTR: CallConv);
   assert(Mask && "Missing call preserved mask for calling convention");
----------------
qcolombet wrote:
> The right way to do this, IMO, is to add the calling convention in LLVM like all other ones and have clang/the front-end selects the right calling convention when it sees the attribute.
> In other words, I don’t think we want to push attribute checking in here.
Please, correct me if I am mistaken, but calling convention determine not only what the callee and the caller function saved registers are, but also how we move parameters to the called function, right?
The idea behind no_caller_saved_registers attribute, is that it can be combined with any other calling convention, and it only override the callee/caller saved register list, but not the way parameters are passed to the called function.

So, using a calling convention for this attribute will not be right.

H.J., can you confirm this?


https://reviews.llvm.org/D22044





More information about the llvm-commits mailing list