Skip to content

Conversation

@mgehre-amd
Copy link
Collaborator

@mgehre-amd mgehre-amd commented Nov 12, 2025

Add action to enable listener for RewriterBase::replaceOp, RewriterBase::replaceAllUsesWith and friends.

@mgehre-amd mgehre-amd force-pushed the matthias.replace_op_action_public branch from a84528d to a1da90b Compare November 13, 2025 07:51
@mgehre-amd mgehre-amd marked this pull request as ready for review November 13, 2025 07:51
Copy link
Contributor

@cferry-AMD cferry-AMD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaceAllUsesWith(ValueRange, ValueRange) should also be modified, shouldn't it?

@mgehre-amd
Copy link
Collaborator Author

replaceAllUsesWith(ValueRange, ValueRange)
this calls the replaceAllUsesWith(Value from, Value to), which calls the action here

void replaceAllUsesWith(ValueRange from, ValueRange to) {
    assert(from.size() == to.size() && "incorrect number of replacements");
    for (auto it : llvm::zip(from, to))
      replaceAllUsesWith(std::get<0>(it), std::get<1>(it));
  }

cferry-AMD
cferry-AMD previously approved these changes Nov 14, 2025
Copy link
Contributor

@cferry-AMD cferry-AMD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the claraifications, that looks good.

josel-amd
josel-amd previously approved these changes Nov 14, 2025
jorickert
jorickert previously approved these changes Nov 17, 2025
roberteg16
roberteg16 previously approved these changes Nov 17, 2025
Copy link
Contributor

@roberteg16 roberteg16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants