[PATCH] D99284: [RegAllocFast] properly handle STATEPOINT instruction.

Denis Antrushin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 24 11:04:59 PDT 2021


dantrushin created this revision.
dantrushin added reviewers: arsenm, reames, skatkov.
Herald added subscribers: pengfei, hiraditya, qcolombet, MatzeB.
dantrushin requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

STATEPOINT is a fancy and complex pseudo instruction which
has both tied defs and regmask operand.

Basic FastRA algorithm is as follows:

1. Mark registers used by defs as free
2. If instruction has regmask operand displace clobbered registers according to regmask.
3. Assign registers for use operands.

In case of tied defs step 1 is replaced with allocation of registers
for them. But regmask is still processed, which may displace already
allocated registers. As a result, tied use and def will get assigned
to different registers.

This patch add tracking of registers assigned for tied defs and avoids
displacing them when processing regmask.
I'm being conservative and do that for STATEPOINT instruction only.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99284

Files:
  llvm/lib/CodeGen/RegAllocFast.cpp
  llvm/test/CodeGen/X86/statepoint-fastregalloc.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99284.333056.patch
Type: text/x-patch
Size: 4730 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210324/a86cf827/attachment.bin>


More information about the llvm-commits mailing list