[PATCH] D77689: [X86] Codegen for preallocated
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 7 16:51:52 PDT 2020
aeubanks marked 10 inline comments as done.
aeubanks added inline comments.
================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:3887
+ if (!ArgLocs.back().isMemLoc()) {
+ report_fatal_error("cannot use preallocated attribute on a register "
+ "parameter");
----------------
rnk wrote:
> This seems like it could be an assert, but I could go either way. If the condition occurs, it's an LLVM bug: it means the x86 calling conv code missed the case. We generally use report_fatal_error when user input could trigger the condition, and we don't want UB to occur.
I copied this from inalloca right above, but yeah assert seems fine.
================
Comment at: llvm/lib/Target/X86/X86RegisterInfo.cpp:629
bool X86RegisterInfo::hasBasePointer(const MachineFunction &MF) const {
+ const X86MachineFunctionInfo *X86FI = MF.getInfo<X86MachineFunctionInfo>();
----------------
rnk wrote:
> Ooh, base pointers are expensive. Is this necessary?
Yup, I tried removing it and it makes my test program crash.
I spent quite a while trying to figure out how to force a frame pointer with preallocated calls (is the distinction between frame/base pointer relevant here?).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77689/new/
https://reviews.llvm.org/D77689
More information about the llvm-commits
mailing list