diff --git a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h --- a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h +++ b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h @@ -724,11 +724,10 @@ // Make sure that we reprocess all operands now that we reduced their // use counts. - if (I.getNumOperands() < 8) { - for (Use &Operand : I.operands()) - if (auto *Inst = dyn_cast(Operand)) - Worklist.add(Inst); - } + for (Use &Operand : I.operands()) + if (auto *Inst = dyn_cast(Operand)) + Worklist.add(Inst); + Worklist.remove(&I); I.eraseFromParent(); MadeIRChange = true;