[llvm] [AMDGPU] Refine operand iterators in the SIInsertWaitcnts. NFCI. (PR #108884)
Stanislav Mekhanoshin via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 17 02:57:26 PDT 2024
rampitec wrote:
> > JBTW, any idea why is that so? Why uses() include non-registers? And why is that documented as register uses then?
>
> > And even more to it: why all_uses does not include all of the uses?
>
> Because we were lazy and sloppy :) `uses` returns a contiguous range of operands, which might be a mixture of registers and immediates because `MachineInstr` does not guarantee that the reg uses come before the imms.
>
> `all_uses` is a filtered iterator, so it already needs to test which operands are uses, so testing that they are registers (and ignoring immediates) came for free.
>
> Maybe part of the problem is a grammatical question of whether an immediate is a type of use, or something different. We don't have good words for "register uses" and "all uses including uses of immediate values".
https://github.com/llvm/llvm-project/pull/108950
https://github.com/llvm/llvm-project/pull/108884
More information about the llvm-commits
mailing list