This is an archive of the discontinued LLVM Phabricator instance.

InlineSpiller: Support spilling into alternate register classes
AbandonedPublic

Authored by MatzeB on Feb 1 2022, 12:42 PM.

Details

Reviewers
None
Summary
WARNING: This is part of an experiment! It is not ready for landing/real review!

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.

Diff Detail