[llvm] df4fa47 - [RISCV] Use MVT::changeVectorElementType. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 23 09:02:26 PDT 2024


Author: Craig Topper
Date: 2024-07-23T09:02:15-07:00
New Revision: df4fa47b57a782851d29c0cf7934051f12dda32e

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

LOG: [RISCV] Use MVT::changeVectorElementType. 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 823fb428472ef..1beff2e5bcb38 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -8273,11 +8273,9 @@ SDValue RISCVTargetLowering::lowerVectorTruncLike(SDValue Op,
         getDefaultVLOps(SrcVT, ContainerVT, DL, DAG, Subtarget);
   }
 
-  LLVMContext &Context = *DAG.getContext();
-  const ElementCount Count = ContainerVT.getVectorElementCount();
   do {
     SrcEltVT = MVT::getIntegerVT(SrcEltVT.getSizeInBits() / 2);
-    EVT ResultVT = EVT::getVectorVT(Context, SrcEltVT, Count);
+    MVT ResultVT = ContainerVT.changeVectorElementType(SrcEltVT);
     Result = DAG.getNode(RISCVISD::TRUNCATE_VECTOR_VL, DL, ResultVT, Result,
                          Mask, VL);
   } while (SrcEltVT != DstEltVT);


        


More information about the llvm-commits mailing list