]> granicus.if.org Git - llvm/commit
AMDGPU: Fold frame index into MUBUF
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 24 Jun 2019 14:53:56 +0000 (14:53 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 24 Jun 2019 14:53:56 +0000 (14:53 +0000)
commit68420a23e066a2c6a641d77ab0d8e43897beb982
tree8919f069ea26053bc1c1aec19eb1b209266641a6
parentcee72c8957c71d157af6c0aa1ae69389383c65ee
AMDGPU: Fold frame index into MUBUF

This matters for byval uses outside of the entry block, which appear
as copies.

Previously, the only folding done was during selection, which could
not see the underlying frame index. For any uses outside the entry
block, the frame index was materialized in the entry block relative to
the global scratch wave offset.

This may produce worse code in cases where the offset ends up not
fitting in the MUBUF offset field. A better heuristic would be helpfu
for extreme frames.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364185 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/SIFoldOperands.cpp
lib/Target/AMDGPU/SIInstrInfo.h
test/CodeGen/AMDGPU/byval-frame-setup.ll
test/CodeGen/AMDGPU/fold-fi-mubuf.mir [new file with mode: 0644]
test/CodeGen/AMDGPU/frame-index-elimination.ll
test/CodeGen/AMDGPU/llvm.amdgcn.buffer.load.ll
test/CodeGen/AMDGPU/llvm.amdgcn.readfirstlane.ll