diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp index 066c57614e34..317fb9bcbb95 100644 --- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp +++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp @@ -1694,7 +1694,7 @@ static SDValue convertFromScalableVector(EVT VT, SDValue V, SelectionDAG &DAG, /// Return the type of the mask type suitable for masking the provided /// vector type. This is simply an i1 element type vector of the same /// (possibly scalable) length. -static MVT getMaskTypeFor(EVT VecVT) { +static MVT getMaskTypeFor(MVT VecVT) { assert(VecVT.isVector()); ElementCount EC = VecVT.getVectorElementCount(); return MVT::getVectorVT(MVT::i1, EC); @@ -9187,10 +9187,10 @@ SDValue RISCVTargetLowering::PerformDAGCombine(SDNode *N, // FIXME: Support FP. if (Val.getOpcode() == RISCVISD::VMV_X_S) { SDValue Src = Val.getOperand(0); - EVT VecVT = Src.getValueType(); + MVT VecVT = Src.getSimpleValueType(); EVT MemVT = Store->getMemoryVT(); // The memory VT and the element type must match. - if (VecVT.getVectorElementType() == MemVT) { + if (MemVT == VecVT.getVectorElementType()) { SDLoc DL(N); MVT MaskVT = getMaskTypeFor(VecVT); return DAG.getStoreVP(