[llvm] 4397504 - [NFCI] Fix set-but-unused warning in InstCombineAddSub.cpp

Dávid Bolvanský via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 24 00:33:56 PDT 2022


Author: Dávid Bolvanský
Date: 2022-03-24T08:33:40+01:00
New Revision: 4397504c2d12c0101367b941308773d1504ac5fe

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

LOG: [NFCI] Fix set-but-unused warning in InstCombineAddSub.cpp

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
index de79fe0ec507d..5e4d842dd8e79 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
@@ -693,9 +693,6 @@ unsigned FAddCombine::calcInstrNumber(const AddendVect &Opnds) {
   unsigned OpndNum = Opnds.size();
   unsigned InstrNeeded = OpndNum - 1;
 
-  // The number of addends in the form of "(-1)*x".
-  unsigned NegOpndNum = 0;
-
   // Adjust the number of instructions needed to emit the N-ary add.
   for (const FAddend *Opnd : Opnds) {
     if (Opnd->isConstant())
@@ -707,9 +704,6 @@ unsigned FAddCombine::calcInstrNumber(const AddendVect &Opnds) {
       continue;
 
     const FAddendCoef &CE = Opnd->getCoef();
-    if (CE.isMinusOne() || CE.isMinusTwo())
-      NegOpndNum++;
-
     // Let the addend be "c * x". If "c == +/-1", the value of the addend
     // is immediately available; otherwise, it needs exactly one instruction
     // to evaluate the value.


        


More information about the llvm-commits mailing list