commit | 761715c4268441545f29b157aa8565284a6c4e1e | [log] [tgz] |
---|---|---|
author | Christian Ulmann <christianulmann@gmail.com> | Tue Apr 23 08:05:55 2024 +0200 |
committer | Copybara-Service <copybara-worker@google.com> | Mon Apr 22 23:12:47 2024 -0700 |
tree | ae75b4581384c00d61ae0fca3c0a5fdf20e56152 | |
parent | d9a7fc8838d31b80b763c5151d016c56a7596793 [diff] |
[MLIR] Harmonize the behavior of the folding API functions (#88508) This commit changes `OpBuilder::tryFold` to behave more similarly to `Operation::fold`. Concretely, this ensures that even an in-place fold returns `success`. This is necessary to fix a bug in the dialect conversion that occurred when an in-place folding made an operation legal. The dialect conversion infrastructure did not check if the result of an in-place folding legalized the operation and just went ahead and tried to apply pattern anyways. The added test contains a simplified version of a breakage we observed downstream. GitOrigin-RevId: 4513050f526be8bc17883685efec91a15ae427f8
See https://mlir.llvm.org/ for more information.