From c538c57d6dae548e644449352d9350d58be9a4af Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 30 Mar 2020 21:31:00 +0200 Subject: [PATCH] [InstCombine] Use replaceOperand() in descaling To make sure the old operand gets DCEd. NFC apart from worklist order. --- llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.7.4