[PATCH] D84692: [Statepoint] When using the tied def lowering, unconditionally use vregs [almost NFC]

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 27 12:08:05 PDT 2020


reames created this revision.
reames added reviewers: dantrushin, skatkov.
Herald added subscribers: bollu, hiraditya, mcrosier.
Herald added a project: LLVM.

This builds on 3da1a96 <https://reviews.llvm.org/rG3da1a9634eb9d92b5ffa2571215c350a9641d07b> on the path towards supporting invokes and cross block relocations.  The actual change attempts to be NFC, but does fail in one corner-case explained below.

The change itself is fairly mechanical.  Rather than remember SDValues - which are inherently block local - immediately produce a virtual register copy and remember that.

Once this lands, we'll update the FunctionLoweringInfo::StatepointSpillMap map to allow register based lowerings, delete VirtRegs from StatepointLowering, and drop the restriction against cross block relocations.  I deliberately separate the semantic part into it's own change for easy of understanding and fault isolation.

The corner-case which isn't quite NFC is that the old implementation implicitly CSEd gc.relocates of the same SDValue regardless of type.  The new implementation still only relocates once, but it produces distinct vregs for the bitcast and it's source, whereas SelectionDAG's generic CSE was able to remove the bitcast in the old implementation.  Note that the final assembly doesn't change (at least in the test), as our MI level optimizations catch the duplication.

I assert that this is an uninteresting corner-case.  It's functionally correct, and if we find a case where this influences performance, we should really be canonicalizing types to i8* at the IR level.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84692

Files:
  llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
  llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h
  llvm/test/CodeGen/X86/statepoint-vreg.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84692.281005.patch
Type: text/x-patch
Size: 6388 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200727/ae214309/attachment.bin>


More information about the llvm-commits mailing list