[llvm] [SDAG] Fix incorrect usage of VECREDUCE_ADD (PR #171459)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 9 09:28:40 PST 2025


================
@@ -2664,7 +2664,8 @@ void DAGTypeLegalizer::SplitVecRes_VECTOR_COMPRESS(SDNode *N, SDValue &Lo,
 
   // We store LoVec and then insert HiVec starting at offset=|1s| in LoMask.
   SDValue WideMask =
-      DAG.getNode(ISD::ZERO_EXTEND, DL, LoMask.getValueType(), LoMask);
+      DAG.getNode(ISD::ZERO_EXTEND, DL,
----------------
topperc wrote:

EVT::changeElementType is semi broken. If LoMask is a SimpleVT, but the type with the i32 element type isn't a SimpleVT, this will fail. Creating an non-SimpleVT requires a LLVMContext, but there's no where to get it from so the function just fails.

Use `EVT::getVectorVT(MVT::i32, LoMask.getValueType().getVectorElementCount())`

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


More information about the llvm-commits mailing list