[llvm] [LoopVectorize] Don't replace widen with replicate for ExtractValueInst (PR #193404)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 23 01:43:15 PDT 2026


================
@@ -869,6 +870,16 @@ static void legalizeAndOptimizeInductions(VPlan &Plan) {
       if (!vputils::isSingleScalar(Def) && !vputils::onlyFirstLaneUsed(Def))
         continue;
 
+      // VPWidenRecipe with an underlying ExtractValueInst stores the
+      // ExtractValue's indices() as part of the recipe's operands. This makes
+      // it incompatible with conversion to VPReplicateRecipe, because
+      // VPReplicateRecipe's scalarizeInstruction() will attempt to set each
+      // operand of the ExtractValueInst, but the indices cannot be set via
+      // setOperand().
----------------
fhahn wrote:

not sure about going to much into the implementation details of the recipes here, probably sufficient and more compact
```suggestion
      // TODO: Support scalarizing ExtractValue.
```

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


More information about the llvm-commits mailing list