[PATCH] D90596: [AMDGPU] Fix iterating in SIFixSGPRCopies

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 2 09:24:51 PST 2020


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp:653-654
           TII->moveToVALU(MI, MDT);
+          MBB = I->getParent();
+          E = MBB->end();
         } else if (isSGPRToVGPRCopy(SrcRC, DstRC, *TRI)) {
----------------
I'm not sure this is an entirely reliable way to get the parent if the instruction was erased (I guess this doesn't happen for any of the copy-like cases). Other places that change the control flow in situations like this return the new block from the modifying function and check if it matches the original


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90596



More information about the llvm-commits mailing list