[PATCH] D118729: InlineSpiller: Support spilling into alternate register classes

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 1 12:42:07 PST 2022


MatzeB created this revision.
Herald added subscribers: modimo, wenlei, pengfei, hiraditya, tpr, mcrosier, qcolombet.
MatzeB requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

InlineSpiller: Support spilling into alternate register classes

This is a prototype to support spilling into alternate register classes
in the InlineSpiller. This is demonstrated on X86 spilling GP registers
to SSE registers.

Note that while most of the change is fine, it requires a guaranteed
that all normal SSE live ranges are already assigned before spilling
GP ranges. For now this is hacked by means of `AllocationPriority` in
register classes work and assigning them to X86 SSE classes. This
however will affect behavior for targets like AMDGPU that rely on a
different behavior for those priorities (where they only affect some
stages of regalloc, but not all) and needs a cleaner solution before
upstreaming.

It obviously would also need a better solution than manually listing all
GP classes in the `spillToOtherClass` callback in X86.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118729

Files:
  llvm/include/llvm/CodeGen/Spiller.h
  llvm/include/llvm/CodeGen/TargetRegisterInfo.h
  llvm/lib/CodeGen/InlineSpiller.cpp
  llvm/lib/CodeGen/LiveRegMatrix.cpp
  llvm/lib/CodeGen/RegAllocBase.cpp
  llvm/lib/CodeGen/RegAllocBasic.cpp
  llvm/lib/CodeGen/RegAllocGreedy.cpp
  llvm/lib/CodeGen/RegAllocPBQP.cpp
  llvm/lib/CodeGen/VirtRegMap.cpp
  llvm/lib/Target/X86/X86RegisterInfo.cpp
  llvm/lib/Target/X86/X86RegisterInfo.h
  llvm/lib/Target/X86/X86RegisterInfo.td
  llvm/test/CodeGen/X86/anyregcc.ll
  llvm/test/CodeGen/X86/fma.ll
  llvm/test/CodeGen/X86/mul-i1024.ll
  llvm/test/CodeGen/X86/mul-i512.ll
  llvm/test/CodeGen/X86/stack-folding-adx-x86_64.ll
  llvm/test/CodeGen/X86/stack-folding-bmi.ll
  llvm/test/CodeGen/X86/stack-folding-bmi2.ll
  llvm/test/CodeGen/X86/stack-folding-fp-avx1.ll
  llvm/test/CodeGen/X86/stack-folding-fp-sse42.ll
  llvm/test/CodeGen/X86/stack-folding-int-avx1.ll
  llvm/test/CodeGen/X86/stack-folding-int-avx512.ll
  llvm/test/CodeGen/X86/stack-folding-int-sse42.ll
  llvm/test/CodeGen/X86/stack-folding-lwp.ll
  llvm/test/CodeGen/X86/stack-folding-mmx.ll
  llvm/test/CodeGen/X86/stack-folding-tbm.ll
  llvm/test/CodeGen/X86/stack-folding-x86_64.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118729.405063.patch
Type: text/x-patch
Size: 149190 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220201/00a13cfc/attachment-0001.bin>


More information about the llvm-commits mailing list