[PATCH] D128419: [X86][AMX] Split RA for AMX register from the other register

LuoYuanke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 23 03:16:42 PDT 2022


LuoYuanke created this revision.
Herald added subscribers: jsji, pengfei, hiraditya, qcolombet, MatzeB.
Herald added a project: All.
LuoYuanke requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Allocating AMX/tile register in a separate pass have 3 benifits.

a) When spill tile register in fast register allocation, it would create
a virtual register for stride. The instruction that def the virtual
register is inserted after current instruction which is allocating
physical register, so fast register allocation won't access the new
instrution and the virtual register won't be allocated with physical
register.

b) When fill the shape information of tile configure, we need to know
the tile physical register. If the shape (row, column) is allocated with
physical register, the physical register may be re-defined before
writing it to stack. The re-def may happen during split or spill
registers. If the shape is in virtual register, there is no such
problem. Below is an example for the register split on %al. The number
of row of the tile should be 8, but it is configured as 4.

%al = 8
mov %al, %bl
%al = 4
store stack.cfg, %al ; config
ldtilecfg

c) Single configure may fail. In that case we can fallback to
multi-config and allocate tile register seperately, while leave other
registers be allocated by greedy RA.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D128419

Files:
  llvm/lib/Target/X86/X86RegisterInfo.cpp
  llvm/lib/Target/X86/X86RegisterInfo.h
  llvm/lib/Target/X86/X86TargetMachine.cpp
  llvm/test/CodeGen/X86/AMX/amx-regalloc.ll
  llvm/test/CodeGen/X86/AMX/amx-regalloc2.ll
  llvm/test/CodeGen/X86/O0-pipeline.ll
  llvm/test/DebugInfo/MIR/InstrRef/survives-livedebugvars.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128419.439310.patch
Type: text/x-patch
Size: 14535 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220623/db479d6b/attachment.bin>


More information about the llvm-commits mailing list