[PATCH] D24328: AMDGPU: Fix broken FrameIndex handling

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 7 19:40:51 PDT 2016


arsenm created this revision.
arsenm added a reviewer: tstellarAMD.
arsenm added a subscriber: llvm-commits.
Herald added subscribers: nhaehnle, wdng, arsenm.

We were trying to avoid using a FrameIndex operand in non-pointer
operands in a convoluted way, and would break because of
using TargetFrameIndex. The TargetFrameIndex should only be used
in the case where it makes sense to fold it as part of the addressing
mode, otherwise it requires materialization like a normal constant.
This wasn't working reliably and failed in the added testcase, hitting
 the assert when processing the frame index.
    
The TargetFrameIndex was coming from trying to produce an AssertZext
limiting the maximum stack size. I'm not sure this was correct to begin
 with, because it is apparently possible to have a single workitem
dispatch that requires all 4G of private memory.
    
This mostly improves code but a few of the cases in
amdgpu.private-memory.ll are worse.


https://reviews.llvm.org/D24328

Files:
  lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
  lib/Target/AMDGPU/SIISelLowering.cpp
  lib/Target/AMDGPU/SIISelLowering.h
  lib/Target/AMDGPU/SIInstrInfo.td
  lib/Target/AMDGPU/SIInstructions.td
  test/CodeGen/AMDGPU/amdgpu.private-memory.ll
  test/CodeGen/AMDGPU/captured-frame-index.ll
  test/CodeGen/AMDGPU/local-stack-slot-bug.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24328.70637.patch
Type: text/x-patch
Size: 16895 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160908/b47e76c0/attachment.bin>


More information about the llvm-commits mailing list