HomePhabricator

[AMDGPU] Use flat scratch instructions where available

Authored by rampitec on Oct 21 2020, 2:27 PM.

Description

[AMDGPU] Use flat scratch instructions where available

The support is disabled by default. So far there is instruction
selection, spilling, and frame elimination. It also changes SP
from unswizzled to swizzled as used by flat scratch instructions,
so it cannot be mixed with MUBUF stack access.

At the very least missing:

  • GlobalISel;
  • Some optimizations in frame elimination in between vector and scalar ALU;
  • It shall finally allow to always materialize frame index as an SGPR, but that is not implemented and frame elimination cannot handle it yet;
  • Unaligned and/or multidword flat scratch shall work, but it is legalized now for MUBUF;
  • Operand folding cannot optimize FI like with MUBUF yet;
  • It will need scaling the value of the SP/FP in the DWARF expression to recover the unswizzled scratch address;

Differential Revision: https://reviews.llvm.org/D89170

Details

Committed
rampitecOct 26 2020, 2:40 PM
Differential Revision
D89170: [AMDGPU] Use flat scratch instructions where available
Parents
rGc551ba0e90bd: Run test only if X86 target is available
Branches
Unknown
Tags
Unknown