[llvm] aa74649 - [InstCombine] Remove unused variable in InstCombineCompares.cpp (NFC)

Jie Fu via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 21 05:05:29 PST 2024


Author: Jie Fu
Date: 2024-11-21T21:04:44+08:00
New Revision: aa746495affb3ab94daafcbe09bfb229dd27429f

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

LOG: [InstCombine] Remove unused variable in InstCombineCompares.cpp (NFC)

/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:3190:14:
 error: unused variable 'CmpBW' [-Werror,-Wunused-variable]
    unsigned CmpBW = Ty->getScalarSizeInBits();
             ^
1 error generated.

Added: 
    

Modified: 
    llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
index 4be576c8ce3b0f..857724470f2223 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -3187,7 +3187,6 @@ Instruction *InstCombinerImpl::foldICmpAddConstant(ICmpInst &Cmp,
   Value *V;
   if (match(X, m_ZExt(m_Value(V)))) {
     Type *NewCmpTy = V->getType();
-    unsigned CmpBW = Ty->getScalarSizeInBits();
     unsigned NewCmpBW = NewCmpTy->getScalarSizeInBits();
     if (shouldChangeType(Ty, NewCmpTy)) {
       if (CR.getActiveBits() <= NewCmpBW) {


        


More information about the llvm-commits mailing list