[llvm] b7f5f48 - [RISCV] Use Selection::getElementCount to simplify code. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 7 17:02:27 PDT 2023


Author: Craig Topper
Date: 2023-06-07T17:02:01-07:00
New Revision: b7f5f48973898d997e18b06974aec88acddc4ba7

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

LOG: [RISCV] Use Selection::getElementCount to simplify code. NFC

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 70fcfe719b5e4..95ef1fc09f9e7 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -2334,9 +2334,8 @@ getDefaultScalableVLOps(MVT VecVT, const SDLoc &DL, SelectionDAG &DAG,
 SDValue RISCVTargetLowering::computeVLMax(MVT VecVT, const SDLoc &DL,
                                           SelectionDAG &DAG) const {
   assert(VecVT.isScalableVector() && "Expected scalable vector");
-  unsigned MinElts = VecVT.getVectorMinNumElements();
-  return DAG.getNode(ISD::VSCALE, DL, Subtarget.getXLenVT(),
-                     getVLOp(MinElts, DL, DAG, Subtarget));
+  return DAG.getElementCount(DL, Subtarget.getXLenVT(),
+                             VecVT.getVectorElementCount());
 }
 
 // The state of RVV BUILD_VECTOR and VECTOR_SHUFFLE lowering is that very few


        


More information about the llvm-commits mailing list