summaryrefslogtreecommitdiff
path: root/flang/lib/Optimizer/Transforms/AlgebraicSimplification.cpp
AgeCommit message (Collapse)Author
2024-12-20[mlir] Enable decoupling two kinds of greedy behavior. (#104649)Jacques Pienaar
The greedy rewriter is used in many different flows and it has a lot of convenience (work list management, debugging actions, tracing, etc). But it combines two kinds of greedy behavior 1) how ops are matched, 2) folding wherever it can. These are independent forms of greedy and leads to inefficiency. E.g., cases where one need to create different phases in lowering and is required to applying patterns in specific order split across different passes. Using the driver one ends up needlessly retrying folding/having multiple rounds of folding attempts, where one final run would have sufficed. Of course folks can locally avoid this behavior by just building their own, but this is also a common requested feature that folks keep on working around locally in suboptimal ways. For downstream users, there should be no behavioral change. Updating from the deprecated should just be a find and replace (e.g., `find ./ -type f -exec sed -i 's|applyPatternsAndFoldGreedily|applyPatternsGreedily|g' {} \;` variety) as the API arguments hasn't changed between the two.
2022-08-31[MLIR] Update pass declarations to new autogenerated filesMichele Scuttari
The patch introduces the required changes to update the pass declarations and definitions to use the new autogenerated files and allow dropping the old infrastructure. Reviewed By: mehdi_amini, rriddle Differential Review: https://reviews.llvm.org/D132838
2022-08-30Revert "[MLIR] Update pass declarations to new autogenerated files"Michele Scuttari
This reverts commit 2be8af8f0e0780901213b6fd3013a5268ddc3359.
2022-08-30[MLIR] Update pass declarations to new autogenerated filesMichele Scuttari
The patch introduces the required changes to update the pass declarations and definitions to use the new autogenerated files and allow dropping the old infrastructure. Reviewed By: mehdi_amini, rriddle Differential Review: https://reviews.llvm.org/D132838
2022-08-09[flang] Pass the pipeline config to the passValentin Clement
The newly added AlgebraicSimplification pass is triggering the greedy pattern rewriter. Since we define a specific config in the flang pipeline, this patch adds the ability to pass the config to the pass directly. Reviewed By: jeanPerier Differential Revision: https://reviews.llvm.org/D131474
2022-07-21[flang] Run algebraic simplification optimization pass.Slava Zakharin
Try 2 to merge 4fbd1d6c872e8228f23a6e13914222af40ca6461. Flang algebraic simplification pass will run algebraic simplification rewrite patterns for Math/Complex/etc. dialects. It is enabled under opt-for-speed optimization levels (i.e. for O1/O2/O3; Os/Oz will not enable it). With this change the FIR/MLIR optimization pipeline becomes affected by the -O* optimization level switches. Until now these switches only affected the middle-end and back-end. Differential Revision: https://reviews.llvm.org/D130035
2022-07-20Revert "[flang] Run algebraic simplification optimization pass."Slava Zakharin
This reverts commit 4fbd1d6c872e8228f23a6e13914222af40ca6461.
2022-07-20[flang] Run algebraic simplification optimization pass.Slava Zakharin
Flang algebraic simplification pass will run algebraic simplification rewrite patterns for Math/Complex/etc. dialects. It is enabled under opt-for-speed optimization levels (i.e. for O1/O2/O3; Os/Oz will not enable it). With this change the FIR/MLIR optimization pipeline becomes affected by the -O* optimization level switches. Until now these switches only affected the middle-end and back-end. Differential Revision: https://reviews.llvm.org/D130035