[llvm] cf1de0a - [RISCV] Reuse Factor variable instead of hardcoding 2 in other places. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 25 16:36:30 PDT 2024


Author: Craig Topper
Date: 2024-09-25T16:36:18-07:00
New Revision: cf1de0a7b47b5d1a05eac42a18a2cd6d6b33ba50

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

LOG: [RISCV] Reuse Factor variable instead of hardcoding 2 in other places. 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 3b61cb5dfe090a..95fc69af0a0124 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -21462,7 +21462,7 @@ bool RISCVTargetLowering::lowerDeinterleaveIntrinsicToLoad(
   if (DI->getIntrinsicID() != Intrinsic::vector_deinterleave2)
     return false;
 
-  unsigned Factor = 2;
+  const unsigned Factor = 2;
 
   VectorType *VTy = cast<VectorType>(DI->getOperand(0)->getType());
   VectorType *ResVTy = cast<VectorType>(DI->getType()->getContainedType(0));
@@ -21497,7 +21497,7 @@ bool RISCVTargetLowering::lowerDeinterleaveIntrinsicToLoad(
         LI->getContext(), "riscv.vector.tuple",
         ScalableVectorType::get(Type::getInt8Ty(LI->getContext()),
                                 NumElts * SEW / 8),
-        2);
+        Factor);
 
     VlsegNFunc = Intrinsic::getDeclaration(LI->getModule(), IntrIds[Factor - 2],
                                            {VecTupTy, XLenTy});
@@ -21533,7 +21533,7 @@ bool RISCVTargetLowering::lowerInterleaveIntrinsicToStore(
   if (II->getIntrinsicID() != Intrinsic::vector_interleave2)
     return false;
 
-  unsigned Factor = 2;
+  const unsigned Factor = 2;
 
   VectorType *VTy = cast<VectorType>(II->getType());
   VectorType *InVTy = cast<VectorType>(II->getOperand(0)->getType());
@@ -21567,7 +21567,7 @@ bool RISCVTargetLowering::lowerInterleaveIntrinsicToStore(
         SI->getContext(), "riscv.vector.tuple",
         ScalableVectorType::get(Type::getInt8Ty(SI->getContext()),
                                 NumElts * SEW / 8),
-        2);
+        Factor);
 
     VssegNFunc = Intrinsic::getDeclaration(SI->getModule(), IntrIds[Factor - 2],
                                            {VecTupTy, XLenTy});


        


More information about the llvm-commits mailing list