[llvm] [VPlan] Verify scalar types in VPlanVerifier. NFCI (PR #122679)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 13 08:50:04 PST 2025
================
@@ -71,15 +74,17 @@ Type *VPTypeAnalysis::inferScalarTypeForRecipe(const VPInstruction *R) {
case VPInstruction::FirstOrderRecurrenceSplice:
case VPInstruction::Not:
case VPInstruction::ResumePhi:
+ case VPInstruction::CalculateTripCountMinusVF:
+ case VPInstruction::CanonicalIVIncrementForPart:
+ case VPInstruction::AnyOf:
----------------
david-arm wrote:
The documentation for `AnyOf` says
```
// Returns a scalar boolean value, which is true if any lane of its single
// operand is true.
```
which implies to me that the input does not have to be a vector of i1 types. For example, the input could be a vector of i32s and any lane that's non-zero could lead to a return value of `true`. However, the code to handle AnyOf in `VPInstruction::generate` certainly matches up with your change, i.e.
```
case VPInstruction::AnyOf: {
Value *A = State.get(getOperand(0));
return Builder.CreateOrReduce(A);
}
```
I wonder if it's also worth tightening up the documentation of AnyOf to say something like:
```
// Returns a scalar boolean value, which is true if any lane of its only
// boolean vector operand is true.
```
https://github.com/llvm/llvm-project/pull/122679
More information about the llvm-commits
mailing list