This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Fix assert if v_mov_b32_dpp is last instruction in the block
ClosedPublic

Authored by arsenm on Apr 8 2022, 8:17 AM.

Details

Reviewers
foad
Group Reviewers
Restricted Project
Summary

Fixes issue 49961

Diff Detail

Event Timeline

arsenm created this revision.Apr 8 2022, 8:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 8 2022, 8:17 AM
arsenm requested review of this revision.Apr 8 2022, 8:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 8 2022, 8:17 AM
Herald added a subscriber: wdng. · View Herald Transcript
foad added inline comments.Apr 8 2022, 9:41 AM
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
8073

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.

arsenm added inline comments.Apr 8 2022, 11:04 AM
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
8073

That's a bit too clever for me. I'd rather just have normal looking end iterator checks

foad added inline comments.Apr 8 2022, 11:50 AM
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
8073

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.

arsenm updated this revision to Diff 422332.Apr 12 2022, 2:10 PM

Check if phi

llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
8073

This already has a MaxInstScan to avoid pathological blocks

foad accepted this revision.Apr 13 2022, 6:21 AM

Thanks.

This revision is now accepted and ready to land.Apr 13 2022, 6:21 AM