[llvm] c3c17b1 - [RISCV] Use MVT for the argument to getMaskTypeFor. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 11 15:15:01 PDT 2022


Author: Craig Topper
Date: 2022-07-11T15:14:44-07:00
New Revision: c3c17b169568131b391f25cb0b5ac27499a6857b

URL: https://github.com/llvm/llvm-project/commit/c3c17b169568131b391f25cb0b5ac27499a6857b
DIFF: https://github.com/llvm/llvm-project/commit/c3c17b169568131b391f25cb0b5ac27499a6857b.diff

LOG: [RISCV] Use MVT for the argument to getMaskTypeFor. NFC

Only one caller didn't already have an MVT and that was easy to
fix. Since the return type is MVT and it uses MVT::getVectorVT,
taking an MVT as input makes the most sense.

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Removed: 
    


################################################################################
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(


        


More information about the llvm-commits mailing list