[llvm] [CodeGen] Fix EVT::changeVectorElementType assertion on simple-to-extended fallback (PR #173413)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 28 07:13:29 PST 2025


================
@@ -17351,7 +17352,8 @@ static bool narrowIndex(SDValue &N, ISD::MemIndexType IndexType, SelectionDAG &D
     EVT ResultVT = EVT::getIntegerVT(C, ActiveBits).getRoundIntegerType(C);
     if (ResultVT.bitsLT(VT.getVectorElementType())) {
       N = DAG.getNode(ISD::TRUNCATE, DL,
-                      VT.changeVectorElementType(ResultVT), N);
+                      VT.changeVectorElementType(*DAG.getContext(), ResultVT),
----------------
RKSimon wrote:

We've already called getContext above:
```suggestion
                      VT.changeVectorElementType(C, ResultVT),
```

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


More information about the llvm-commits mailing list