This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Fix assert on function argument as loop condition
ClosedPublic

Authored by arsenm on Dec 13 2021, 1:57 PM.

Diff Detail

Unit TestsFailed

Event Timeline

arsenm created this revision.Dec 13 2021, 1:57 PM
arsenm requested review of this revision.Dec 13 2021, 1:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 13 2021, 1:57 PM
Herald added a subscriber: wdng. · View Herald Transcript
This revision is now accepted and ready to land.Dec 13 2021, 2:34 PM
rampitec added inline comments.Dec 13 2021, 2:37 PM
llvm/test/CodeGen/AMDGPU/loop-on-function-argument.ll
23

A side note, we could instead lower it into v_cmp_ne_u32_e32 vcc, 0, v0 and then dead-code v_and_b32_e32 v0, 1, v0.

foad added inline comments.Jan 14 2022, 3:12 AM
llvm/test/CodeGen/AMDGPU/loop-on-function-argument.ll
23

Shouldn't the v_and be removed automatically, but only if the argument is marked as zeroext?

arsenm added inline comments.Jan 14 2022, 6:45 AM
llvm/test/CodeGen/AMDGPU/loop-on-function-argument.ll
23

Yes. I've also been thinking of a future ABI change where we interpret i1 function arguments as being an SGPR bool mask instead of a VGPR