[llvm] [AMDGPU] NFC: Add BBLiveOutMap & LiveOut Cache (PR #93089)
Jeffrey Byrnes via llvm-commits
llvm-commits at lists.llvm.org
Tue May 28 12:37:55 PDT 2024
jrbyrnes wrote:
> Should we only keep LiveOuts indexed by the region index? If not then maybe it worth to add a level of indirection and add a map of LastMIForRegion to RegionIdx or vice-versa?
Okay, I've added the wrapper to add a layer of indirection to support the indexing that we want (by RegionIdx). The reason why we need this is because scheduling may change the last MI per region. Thus, we cannot assume that iterators in the Regions vector will be valid Map keys for our LiveRegs across different scheduling stages. The RegionPressureMap constructs a map of LiveRegs based on the iterators of the original program order, and a map of RegionIdx to these original iterators. Using this layer of indirection we can index the LiveRegs by RegionIdx.
For this version of the feature, the indirection approach is the appropriate one. In https://github.com/llvm/llvm-project/pull/88797 , I redefined getLiveRegMap to construct a map by the RegionIdx, but that introduced too many changes.
https://github.com/llvm/llvm-project/pull/93089
More information about the llvm-commits
mailing list