From: Nikita Popov Date: Mon, 30 Mar 2020 19:31:00 +0000 (+0200) Subject: [InstCombine] Use replaceOperand() in descaling X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c538c57d6dae548e644449352d9350d58be9a4af;p=platform%2Fupstream%2Fllvm.git [InstCombine] Use replaceOperand() in descaling To make sure the old operand gets DCEd. NFC apart from worklist order. --- diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index d7798bd..6879766 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