[PATCH] D56275: x86 interrupt calling convention: Fix argument offsets

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 3 10:10:04 PST 2019


rnk added a subscriber: aaboud.
rnk added inline comments.


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:2956-2970
   // Calculate SP offset of interrupt parameter, re-arrange the slot normally
   // taken by a return address.
   int Offset = 0;
   if (CallConv == CallingConv::X86_INTR) {
     // X86 interrupts may take one or two arguments.
     // On the stack there will be no return address as in regular call.
     // Offset of last argument need to be set to -4/-8 bytes.
----------------
We should really be fixing this so that the CCValAssign VA object has the right offset as soon as AnalyzeArguments in returns. Then all the generic code would work find without updating the stack offset after we create the fixed stack object.

It looks like @aaboud added it here.


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:2992
   // This is an argument in memory. We might be able to perform copy elision.
   if (Flags.isCopyElisionCandidate()) {
     EVT ArgVT = Ins[i].ArgVT;
----------------
The existing test doesn't exercise this condition here. I think all you have to do to exercise it is to set up a function with this convention that copies this argument to an alloca, takes its address, and forwards it to another function.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56275/new/

https://reviews.llvm.org/D56275





More information about the llvm-commits mailing list