Skip to content
Commit 0ddd0439 authored by Uday Bondhugula's avatar Uday Bondhugula
Browse files

[MLIR] Fix op folding to not run pre-replace when not constant folding



 OperationFolder::tryToFold was running the pre-replacement
action even when there was no constant folding, i.e., when the operation
was just being updated in place but was not going to be replaced. This
led to nested ops being unnecessarily removed from the worklist and only
being processed in the next outer iteration of the greedy pattern
rewriter, which is also why this didn't affect the final output IR but
only the convergence rate. It also led to an op's results' users to be
unnecessarily added to the worklist.

Signed-off-by: default avatarUday Bondhugula <uday@polymagelabs.com>

Differential Revision: https://reviews.llvm.org/D76268
parent 6ef1f371
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment