[llvm] [VPlan] Add VPInst::getNumOperandsForOpcode, use to verify in ctor (NFC) (PR #142284)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 21 02:50:46 PDT 2025
fhahn 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.
https://github.com/llvm/llvm-project/pull/142284
More information about the llvm-commits
mailing list