[PATCH] D88808: [X86] Defer the creation of LCMPXCHG16B_SAVE_RBX until finalize-isel

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 4 21:17:17 PDT 2020


craig.topper created this revision.
craig.topper added reviewers: RKSimon, efriedma, rnk, spatel.
Herald added subscribers: jfb, hiraditya.
Herald added a project: LLVM.
craig.topper requested review of this revision.

We need to use LCMPXCHG16B_SAVE_RBX if RBX/EBX is being used as
the frame pointer. We previously checked for this during type
legalization, but that's too early to know for sure if the base
pointer is needed.

This patch adds a new pseudo instruction to emit from isel that
uses a virtual register for the RBX input. Then we use the custom
inserter hook to emit LCMPXCHG16B if RBX isn't needed as a base
pointer or LCMPXCHG16B_SAVE_RBX if it is.

The test case is taken from the bugzilla with minor cleanup, but
it's still pretty large.

Fixes PR42064.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88808

Files:
  llvm/lib/Target/X86/X86ExpandPseudo.cpp
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/lib/Target/X86/X86ISelLowering.h
  llvm/lib/Target/X86/X86InstrCompiler.td
  llvm/lib/Target/X86/X86InstrInfo.td
  llvm/test/CodeGen/X86/pr42064.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88808.296094.patch
Type: text/x-patch
Size: 24429 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201005/acb5b25f/attachment.bin>


More information about the llvm-commits mailing list