Skip to content

Commit

Permalink
avoid spurious references of constants
Browse files Browse the repository at this point in the history
We now remove more dead agg consts
  • Loading branch information
nunoplopes committed Dec 25, 2023
1 parent a6a3c19 commit ff88897
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ir/function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,11 @@ static void add_users(Function::UsersTy &users, Value *i, BasicBlock *bb,
Value *val) {
if (auto *agg = dynamic_cast<AggregateValue*>(val)) {
for (auto elem : agg->getVals()) {
add_users(users, i, bb, elem);
add_users(users, val, bb, elem);
}
}
users[val].emplace(i, bb);
if (i != val)
users[val].emplace(i, bb);
}

void Function::addFnDecl(FnDecl &&decl) {
Expand Down

0 comments on commit ff88897

Please sign in to comment.