[PATCH] D65097: AMDGPU: Add offsets to MMO when lowering buffer intrinsics

Tom Stellard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 22 09:24:02 PDT 2019


tstellar created this revision.
tstellar added reviewers: arsenm, nhaehnle.
Herald added subscribers: jfb, hiraditya, t-tye, tpr, dstuttard, yaxunl, wdng, jvesely, kzhuravl.
Herald added a project: LLVM.
tstellar added a comment.

We could do the same for the raw and struct variants of the intrinsics, but I wasn't sure exactly what conditions had to be met in order to guarantee that we had a constant offset.


Without offsets on the MachineMemOperands (MMOs),
MachineInstr::mayAlias() will return true for all reads and writes to the
same resource descriptor.  This leads to O(N^2) complexity in the MachineScheduler
when analyzing dependencies of buffer loads and stores.  It also limits
the SILoadStoreOptimizer from merging more instructions.

This patch reduces the compile time of one pathological compute shader
from 12 seconds to 1 second.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D65097

Files:
  llvm/lib/Target/AMDGPU/SIISelLowering.cpp
  llvm/lib/Target/AMDGPU/SIISelLowering.h
  llvm/test/CodeGen/AMDGPU/mmo-offsets.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65097.211124.patch
Type: text/x-patch
Size: 18787 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190722/16fb2eda/attachment-0001.bin>


More information about the llvm-commits mailing list