[PATCH] D74506: [SystemZ] Support the kernel backchain

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 20 10:11:15 PST 2020


jonpa added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:2018
+      " " + Args.getLastArg(options::OPT_mbackchain)->getAsString(Args) +
+      " " + "-mhard-float";
   }
----------------
uweigand wrote:
> It's a bit weird to hard-code only "-mhard-float" here.   I guess this is because we may not actually have any "getLastArg" since hard-float is the default?   In that case I guess we might as well hard-code the whole string.
yes


================
Comment at: llvm/lib/Target/SystemZ/SystemZISelLowering.cpp:3262
+  if (HasPackedStackAttr && !HasBackChain)
+    return DAG.getConstant(0, DL, PtrVT);
+
----------------
uweigand wrote:
> Hmm, GCC will always return the address where the back-chain would have been, even if it isn't emitted.  Not sure whether that is very useful, but maybe we should emulate it simply for compatibility reasons ...
I thought it might be bad to create two stack slots to the same location (slot of abscent backchain / R15), but it appears to be fine.

However, if creating that slot in case of no saved regs but with a local area, as in frameaddr-02.ll:fp1f, this ends up actually creating extra stack space for the backchain without using it.

Not sure what would be best to do in that case if not returning 0...



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

https://reviews.llvm.org/D74506





More information about the llvm-commits mailing list