[llvm] [VPlan] Verify scalar types in VPlanVerifier. NFCI (PR #122679)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 13 20:41:36 PST 2025


================
@@ -195,6 +197,9 @@ bool VPlanVerifier::verifyVPBasicBlock(const VPBasicBlock *VPBB) {
       return false;
     }
     for (const VPValue *V : R.definedValues()) {
+      // Verify that recipes' operands have matching types.
+      TypeInfo.inferScalarType(V);
----------------
lukel97 wrote:

We hit either an llvm_unreachable or fail an assert if there's an uncovered case:

```c++

Type *VPTypeAnalysis::inferScalarType(const VPValue *V) {
  Type *ResultTy = ...
  assert(ResultTy && "could not infer type for the given VPValue");
  CachedTypes[V] = ResultTy;
  return ResultTy;
}
```

So I don't think it will ever return null. Do we still want to move this out of VPlanAnalysis then?

https://github.com/llvm/llvm-project/pull/122679


More information about the llvm-commits mailing list