Skip to content

Commit

Permalink
[LSR] If there still has some uses of the value, do not set the value
Browse files Browse the repository at this point in the history
with nullpter.
  • Loading branch information
coderchenlin committed Mar 12, 2024
1 parent 8d61f82 commit 52be592
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Utils/Local.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 52be592

Please sign in to comment.