[llvm] [VPlan] Support masked VPInsts, use for predication (NFC) (PR #142285)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 21 21:10:27 PST 2026
================
@@ -1282,6 +1282,48 @@ class LLVM_ABI_FOR_TEST VPInstruction : public VPRecipeWithIRFlags,
}
}
+ /// Returns true if the VPInstruction has a mask operand.
+ bool isMasked() const {
+ return getNumOperandsForOpcode() + 1 == getNumOperands();
+ }
+
+ /// Returns true if the opcode needs and supports masking.
+ bool needsMask() const {
+ // Don't use masks to synthetic VPInstructions for now, i.e. ones that do
+ // not have underlying values.
+ if (!getUnderlyingValue())
+ return false;
+
+ return Opcode != Instruction::ExtractValue && Opcode != Instruction::PHI &&
+ Opcode != Instruction::ICmp && Opcode != Instruction::FCmp &&
----------------
lukel97 wrote:
How come we don't predicate ICmp/FCmp/GetElementPtr? Can they not end up using the mask in handleReplication?
https://github.com/llvm/llvm-project/pull/142285
More information about the llvm-commits
mailing list