[PATCH] D53673: [COFF, ARM64] Implement Intrinsic.sponentry for AArch64

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 29 14:54:22 PDT 2018


efriedma added inline comments.


================
Comment at: lib/Target/AArch64/AArch64ISelLowering.cpp:5167-5171
+  unsigned numFixed = MFI.getNumFixedObjects();
+  EVT VT = getPointerTy(DAG.getDataLayout());
+  SDLoc DL(Op);
+  if (numFixed) {
+    return DAG.getFrameIndex(-numFixed, VT);
----------------
rnk wrote:
> What invariant are you relying on for fixed objects here? This seems like it could be fragile. Stack protectors and exception handling schemes often introduce new fixed objects. You might want to scan for the first or last parameter or CSR or whatever it is that you're really trying to be relative to.
You can also get fixed objects by just having a function with too many arguments to fit in registers.  (Please add a testcase.)

There isn't really any existing fixed object with the right offset, in general.  But I think you can unconditionally compute the correct offset with something like `DAG.getFrameIndex(MFI.CreateFixedObject(1, 0, true), VT)`.  Or I guess you could use a pseudo-instruction, and expand it after frame lowering, but that doesn't seem obviously better.


Repository:
  rL LLVM

https://reviews.llvm.org/D53673





More information about the llvm-commits mailing list