[llvm] [VPlan] Add VPInst::getNumOperandsForOpcode, use to verify in ctor (NFC) (PR #142284)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 22 11:01:17 PDT 2025
ayalz wrote:
> > > This can also be used in a follow-up to determine if a VPInstruction is masked based on the number of arguments.
> >
> >
> > BTW, masking could alternatively have an explicit API for setting and getting, possibly maintaining a pointer to a VPInstruction's mask or null when unmasked.
>
> Yep, the WIP patch to use this for masking provides such an API, although based on the number of operands (https://github.com/llvm/llvm-project/pull/142285/files#diff-dabd8bf9956285f5ddab712af4e0494647a106234f07283b0bd9f8b4d9b887caR1039-R1073)
>
> I think the mask operand still needs to be part of the operands of the VPInstruction, to make sure it is part of the def-use graph, to get updated automatically when the mask value gets RAUWs.
Agreed, the mask should be a regular operand, and in addition have a setter and getter to set and retrieve it.
https://github.com/llvm/llvm-project/pull/142284
More information about the llvm-commits
mailing list