[PATCH] D43214: [X86] Use EDI for retpoline when no scratch regs are left

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 12 16:08:55 PST 2018


rnk created this revision.
rnk added reviewers: chandlerc, dwmw2.
Herald added subscribers: hiraditya, kristof.beyls, javed.absar.

Instead of solving the hard problem of how to pass the callee to the indirect
jump thunk without a register, just use a CSR. At a call boundary, there's
nothing stopping us from using a CSR to hold the callee as long as we save and
restore it in the prologue.

Also, add tests for this mregparm=3 case. I wrote execution tests for
__llvm_retpoline_push, but they never got committed as lit tests, either
because I never rewrote them or because they got lost in merge conflicts.


https://reviews.llvm.org/D43214

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/lib/Target/X86/X86RetpolineThunks.cpp
  llvm/test/CodeGen/X86/retpoline-regparm.ll
  llvm/test/CodeGen/X86/retpoline.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43214.133955.patch
Type: text/x-patch
Size: 10638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180213/c1f5905c/attachment.bin>


More information about the llvm-commits mailing list