[llvm] [VPlan] Support VPWidenCastRecipe in narrowToSingleScalarRecipes. (PR #141080)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 10 02:48:34 PDT 2025


Mel-Chen wrote:

> @Mel-Chen I think this one should be good to merge?

I suspect `truncateToMinimalBitwidths` may be causing the issue. https://github.com/llvm/llvm-project/pull/143498 shows the situation where the issue occurs. In the `CLONE xor` , the type of the underlying instruction is different from the type inferred by TypeAnalysis.
```
llvm-project/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp:2721: void scalarizeInstruction(const llvm::Instruction*, llvm::VPReplicateRecipe*, const llvm::VPLane&, llvm::VPTransformState&): Assertion `State.TypeAnalysis.inferScalarType(RepRecipe) == Cloned->getType() && "inferred type and type from generated instructions do not match"' failed.
```
I think the fastest way might be to move `narrowToSingleScalarRecipes` forward before `truncateToMinimalBitwidths` ?


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


More information about the llvm-commits mailing list