[llvm] c538c57 - [InstCombine] Use replaceOperand() in descaling

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 31 13:07:22 PDT 2020


Author: Nikita Popov
Date: 2020-03-31T22:05:53+02:00
New Revision: c538c57d6dae548e644449352d9350d58be9a4af

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

LOG: [InstCombine] Use replaceOperand() in descaling

To make sure the old operand gets DCEd.

NFC apart from worklist order.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
index d7798bdb7e16..68797662f45e 100644
--- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -1481,7 +1481,7 @@ Value *InstCombiner::Descale(Value *Val, APInt Scale, bool &NoSignedWrap) {
   assert(Parent.first->hasOneUse() && "Drilled down when more than one use!");
   assert(Op != Parent.first->getOperand(Parent.second) &&
          "Descaling was a no-op?");
-  Parent.first->setOperand(Parent.second, Op);
+  replaceOperand(*Parent.first, Parent.second, Op);
   Worklist.push(Parent.first);
 
   // Now work back up the expression correcting nsw flags.  The logic is based


        


More information about the llvm-commits mailing list