[InstCombine] Use replaceOperand() in descaling

To make sure the old operand gets DCEd.

NFC apart from worklist order.
This commit is contained in:
Nikita Popov 2020-03-30 21:31:00 +02:00
parent 34dcec4690
commit dcd53dc437

View File

@ -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