diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index d3bb89075015e..2f97de6bb046e 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -588,10 +588,10 @@ void llvm::RecursivelyDeleteTriviallyDeadInstructions( // dead as we go. for (Use &OpU : I->operands()) { Value *OpV = OpU.get(); - OpU.set(nullptr); - if (!OpV->use_empty()) continue; + + OpU.set(nullptr); // If the operand is an instruction that became dead as we nulled out the // operand, and if it is 'trivially' dead, delete it in a future loop