[PATCH] D111150: [AMDGPU] Remove dead frame indices after sgpr spill.

Christudasan Devadasan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 6 00:02:30 PDT 2021


cdevadas added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp:459
 
+  for (auto DFI : DeadFrameIndices)
+    SGPRToVGPRSpills.erase(DFI);
----------------
hsmhsm wrote:
> cdevadas wrote:
> > Isn't it possible to avoid this loop by handling the erase inside the original loop itself?
> > Maybe convert the range-based loop above into an iterator-based one?
> As I understand it, it does not help. The llvm DensMap<>::erase() function does not return next iterator. So, erasing DensMap entries while iterating it seems to be *not* possible. Please let me know if you have any idea.
If erase doesn't return the iterator, better retain this loop. Thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111150/new/

https://reviews.llvm.org/D111150



More information about the llvm-commits mailing list