[PATCH] D27344: AMDGPU: Properly implement SIRegisterInfo::isFrameOffsetLegal and needsFrameBaseReg

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 2 07:27:58 PST 2016


nhaehnle created this revision.
nhaehnle added reviewers: arsenm, tstellarAMD.
nhaehnle added a subscriber: llvm-commits.
Herald added subscribers: tony-tye, yaxunl, wdng, kzhuravl, qcolombet.

Without the fix to isFrameOffsetLegal to consider the instruction's
immediate offset, the new test case hits the corresponding assertion in
resolveFrameIndex, because the LocalStackSlotAllocation pass re-uses a
different base register.

With only the fix to isFrameOffsetLegal, code quality reduces in a bunch of
places because frame base registers are added where they're not needed.
This is addressed by properly implementing needsFrameBaseReg, which also
helps to avoid unnecessary zero frame indices in a bunch of other places.

Fixes piglit glsl-1.50/execution/variable-indexing/gs-output-array-vec4-index-wr.shader_test


https://reviews.llvm.org/D27344

Files:
  lib/Target/AMDGPU/SIRegisterInfo.cpp
  test/CodeGen/AMDGPU/amdgpu.private-memory.ll
  test/CodeGen/AMDGPU/captured-frame-index.ll
  test/CodeGen/AMDGPU/insert_vector_elt.ll
  test/CodeGen/AMDGPU/local-stack-slot-bug.ll
  test/CodeGen/AMDGPU/local-stack-slot-offset.ll
  test/CodeGen/AMDGPU/private-element-size.ll
  test/CodeGen/AMDGPU/vgpr-spill-emergency-stack-slot-compute.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27344.80069.patch
Type: text/x-patch
Size: 29261 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161202/a5294ca1/attachment.bin>


More information about the llvm-commits mailing list