[NFCI] Fix set-but-unused warning in InstCombineAddSub.cpp
authorDávid Bolvanský <david.bolvansky@gmail.com>
Thu, 24 Mar 2022 07:33:29 +0000 (08:33 +0100)
committerDávid Bolvanský <david.bolvansky@gmail.com>
Thu, 24 Mar 2022 07:33:40 +0000 (08:33 +0100)
llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp

index de79fe0..5e4d842 100644 (file)
@@ -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.