[PATCH] D123393: AMDGPU: Fix assert if v_mov_b32_dpp is last instruction in the block

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 12 14:10:56 PDT 2022


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:8073
     // doesn't modify exec.
     if (UseInst.getParent() != DefBB)
       return true;
----------------
foad wrote:
> arsenm wrote:
> > foad wrote:
> > > It would be more in keeping with the original design to just exclude PHI instructions here. The assumption is that all the uses counted in NumUse will necessarily come after DefMI in the same BB, so the second loop below will always terminate before hitting the end of the BB.
> > That's a bit too clever for me. I'd rather just have normal looking end iterator checks
> One argument in favour of the clever version is that you never have to run all the way to end(), which could be a long way away in a pathologically large basic block.
This already has a MaxInstScan to avoid pathological blocks


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

https://reviews.llvm.org/D123393



More information about the llvm-commits mailing list