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

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 8 11:50:31 PDT 2022


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:8073
     // doesn't modify exec.
     if (UseInst.getParent() != DefBB)
       return true;
----------------
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.


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

https://reviews.llvm.org/D123393



More information about the llvm-commits mailing list