Page MenuHomePhabricator

[X86][AMX] Split RA for AMX register from the other register
Needs ReviewPublic

Authored by LuoYuanke on Thu, Jun 23, 3:16 AM.

Details

Summary

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.

Diff Detail

Unit TestsFailed

TimeTest
70 msx64 debian > Clang.CodeGenCUDA::atomics-remarks-gfx90a.cu
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/clang -cc1 -internal-isystem /var/lib/buildkite-agent/builds/llvm-project/build/lib/clang/15.0.0/include -nostdsysteminc /var/lib/buildkite-agent/builds/llvm-project/clang/test/CodeGenCUDA/atomics-remarks-gfx90a.cu -triple=amdgcn-amd-amdhsa -fcuda-is-device -target-cpu gfx90a -Rpass=atomic-expand -S -o - 2>&1 | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/clang/test/CodeGenCUDA/atomics-remarks-gfx90a.cu --check-prefix=GFX90A-CAS

Event Timeline

LuoYuanke created this revision.Thu, Jun 23, 3:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptThu, Jun 23, 3:16 AM
LuoYuanke requested review of this revision.Thu, Jun 23, 3:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptThu, Jun 23, 3:16 AM