[llvm] 1061c6d - [RISCV] Fix -Wunused-variable in RISCVISelLowering.cpp (NFC)

Jie Fu via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 31 07:19:47 PDT 2024


Author: Jie Fu
Date: 2024-08-31T22:18:59+08:00
New Revision: 1061c6da53a7a2c36b6ce8f7499b850212483562

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

LOG: [RISCV] Fix -Wunused-variable in RISCVISelLowering.cpp (NFC)

/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp:21558:14: error: unused variable 'ValLMUL' [-Werror,-Wunused-variable]
    unsigned ValLMUL =
             ^
/llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp:21561:14: error: unused variable 'PartLMUL' [-Werror,-Wunused-variable]
    unsigned PartLMUL =
             ^
2 errors generated.

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 4a33e8bcbaa2b5..ebe3ac8620c8e5 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -21555,10 +21555,10 @@ bool RISCVTargetLowering::splitValueIntoRegisterParts(
 
   if (ValueVT.isRISCVVectorTuple() && PartVT.isRISCVVectorTuple()) {
     unsigned ValNF = ValueVT.getRISCVVectorTupleNumFields();
-    unsigned ValLMUL =
+    [[maybe_unused]] unsigned ValLMUL =
         divideCeil(ValueVT.getSizeInBits(), ValNF * RISCV::RVVBitsPerBlock);
     unsigned PartNF = PartVT.getRISCVVectorTupleNumFields();
-    unsigned PartLMUL =
+    [[maybe_unused]] unsigned PartLMUL =
         divideCeil(PartVT.getSizeInBits(), PartNF * RISCV::RVVBitsPerBlock);
     assert(ValNF == PartNF && ValLMUL == PartLMUL &&
            "RISC-V vector tuple type only accepts same register class type "


        


More information about the llvm-commits mailing list