[PATCH] D80234: AMDGPU: Annotate functions that have stack objects

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 19 13:44:29 PDT 2020


arsenm created this revision.
arsenm added reviewers: rampitec, foad, kerbowa, cdevadas.
Herald added subscribers: hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl.
Herald added a project: LLVM.

Relying on any MachineFunction state in the MachineFunctionInfo
constructor is hazardous, because the construction time is unclear and
determined by the first use. The function may be only partially
constructed, which is part of why we have many of these hacky string
attributes to track what we need for ABI lowering.

      

For SelectionDAG, all stack objects are created up-front before
calling convention lowering so stack objects are visible at
construction time. For GlobalISel, none of the IR function has been
visited yet and the allocas haven't been added to the MachineFrameInfo
yet. This should fix failing to set flat_scratch_init in GlobalISel
when needed.

      

This pass really needs to be turned into some kind of analysis, but I
haven't found a nice way use one here.


https://reviews.llvm.org/D80234

Files:
  llvm/lib/Target/AMDGPU/AMDGPUAnnotateKernelFeatures.cpp
  llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
  llvm/test/CodeGen/AMDGPU/GlobalISel/flat-scratch-init.ll
  llvm/test/CodeGen/AMDGPU/annotate-kernel-features-hsa.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80234.265012.patch
Type: text/x-patch
Size: 5905 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200519/a9c85074/attachment.bin>


More information about the llvm-commits mailing list