SSlava Zakharin[flang] Run algebraic simplification optimization pass.
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[flang][driver] Switch to the MLIR coding style in the driver (nfc) This patch re-factors the driver code in LLVM Flang (frontend + compiler) to use the MLIR style. For more context, please see: https://discourse.llvm.org/t/rfc-coding-style-in-the-driver/ Most changes here are rather self-explanatory. Accessors are renamed to be more consistent with the rest of LLVM (e.g. allSource --> getAllSources). Additionally, MLIR clang-tidy files are added in the affected directories. clang-tidy and clang-format files were copied from MLIR. Small additional changes are made to silence clang-tidy/clang-format warnings. [1] https://mlir.llvm.org/getting_started/DeveloperGuide/ Differential Revision: https://reviews.llvm.org/D125007 | 4 年前 | |
[flang][driver] Switch to the MLIR coding style in the driver (nfc) This patch re-factors the driver code in LLVM Flang (frontend + compiler) to use the MLIR style. For more context, please see: https://discourse.llvm.org/t/rfc-coding-style-in-the-driver/ Most changes here are rather self-explanatory. Accessors are renamed to be more consistent with the rest of LLVM (e.g. allSource --> getAllSources). Additionally, MLIR clang-tidy files are added in the affected directories. clang-tidy and clang-format files were copied from MLIR. Small additional changes are made to silence clang-tidy/clang-format warnings. [1] https://mlir.llvm.org/getting_started/DeveloperGuide/ Differential Revision: https://reviews.llvm.org/D125007 | 4 年前 | |
[flang][driver] Add support for -O{0|1|2|3} This patch adds support for most common optimisation compiler flags: -O{0|1|2|3}. This is implemented in both the compiler and frontend drivers. At this point, these options are only used to configure the LLVM optimisation pipelines (aka middle-end). LLVM backend or MLIR/FIR optimisations are not supported yet. Previously, the middle-end pass manager was only required when generating LLVM bitcode (i.e. for flang-new -c -emit-llvm <file> or flang-new -fc1 -emit-llvm-bc <file>). With this change, it becomes required for all frontend actions that are represented as CodeGenAction and CodeGenAction::executeAction is refactored accordingly (in the spirit of better code re-use). Additionally, the -fdebug-pass-manager option is enabled to facilitate testing. This flag can be used to configure the pass manager to print the middle-end passes that are being run. Similar option exists in Clang and the semantics in Flang are identical. This option translates to extra configuration when setting up the pass manager. This is implemented in CodeGenAction::runOptimizationPipeline. This patch also adds some bolier plate code to manage code-gen options ("code-gen" refers to generating machine code in LLVM in this context). This was extracted from Clang. In Clang, it simplifies defining code-gen options and enables option marshalling. In Flang, option marshalling is not yet supported (we might do at some point), but being able to auto-generate some code with macros is beneficial. This will become particularly apparent when we start adding more options (at least in Clang, the list of code-gen options is rather long). Differential Revision: https://reviews.llvm.org/D128043 | 3 年前 | |
[flang][driver] Add support for -O{0|1|2|3} This patch adds support for most common optimisation compiler flags: -O{0|1|2|3}. This is implemented in both the compiler and frontend drivers. At this point, these options are only used to configure the LLVM optimisation pipelines (aka middle-end). LLVM backend or MLIR/FIR optimisations are not supported yet. Previously, the middle-end pass manager was only required when generating LLVM bitcode (i.e. for flang-new -c -emit-llvm <file> or flang-new -fc1 -emit-llvm-bc <file>). With this change, it becomes required for all frontend actions that are represented as CodeGenAction and CodeGenAction::executeAction is refactored accordingly (in the spirit of better code re-use). Additionally, the -fdebug-pass-manager option is enabled to facilitate testing. This flag can be used to configure the pass manager to print the middle-end passes that are being run. Similar option exists in Clang and the semantics in Flang are identical. This option translates to extra configuration when setting up the pass manager. This is implemented in CodeGenAction::runOptimizationPipeline. This patch also adds some bolier plate code to manage code-gen options ("code-gen" refers to generating machine code in LLVM in this context). This was extracted from Clang. In Clang, it simplifies defining code-gen options and enables option marshalling. In Flang, option marshalling is not yet supported (we might do at some point), but being able to auto-generate some code with macros is beneficial. This will become particularly apparent when we start adding more options (at least in Clang, the list of code-gen options is rather long). Differential Revision: https://reviews.llvm.org/D128043 | 3 年前 | |
[flang][driver] Switch to the MLIR coding style in the driver (nfc) This patch re-factors the driver code in LLVM Flang (frontend + compiler) to use the MLIR style. For more context, please see: https://discourse.llvm.org/t/rfc-coding-style-in-the-driver/ Most changes here are rather self-explanatory. Accessors are renamed to be more consistent with the rest of LLVM (e.g. allSource --> getAllSources). Additionally, MLIR clang-tidy files are added in the affected directories. clang-tidy and clang-format files were copied from MLIR. Small additional changes are made to silence clang-tidy/clang-format warnings. [1] https://mlir.llvm.org/getting_started/DeveloperGuide/ Differential Revision: https://reviews.llvm.org/D125007 | 4 年前 | |
[flang][driver] Fix opt-level option parsing This update makes sure that flang-new -O2 -O0 will run at -O0 rather than -O2. This bug was identified and originally fixed by Vyacheslav Zakharin in https://reviews.llvm.org/D130035. I've extracted the fix into a separate patch. co-authored by: Vyacheslav Zakharin <vyacheslav.p.zakharin@intel.com> Differential Revision: https://reviews.llvm.org/D130104 | 3 年前 | |
[flang][driver] Switch to the MLIR coding style in the driver (nfc) This patch re-factors the driver code in LLVM Flang (frontend + compiler) to use the MLIR style. For more context, please see: https://discourse.llvm.org/t/rfc-coding-style-in-the-driver/ Most changes here are rather self-explanatory. Accessors are renamed to be more consistent with the rest of LLVM (e.g. allSource --> getAllSources). Additionally, MLIR clang-tidy files are added in the affected directories. clang-tidy and clang-format files were copied from MLIR. Small additional changes are made to silence clang-tidy/clang-format warnings. [1] https://mlir.llvm.org/getting_started/DeveloperGuide/ Differential Revision: https://reviews.llvm.org/D125007 | 4 年前 | |
[flang] Run algebraic simplification optimization pass. 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 | 3 年前 | |
[flang][driver] Make flang-new -fc1 accept MLIR files This relatively small change will allow Flang's frontend driver, flang-new -fc1, to consume and parse MLIR files. Semantically (i.e. from user's perspective) this is identical to reading LLVM IR files. Two file extensions are associated with MLIR files: .fir and .mlir. Note that reading MLIR files makes only sense when running one of the code-generation actions, i.e. when using one of the following action flags: -S, -emit-obj, -emit-llvm, -emit-llvm-bc. The majority of tests that required tco to run are updated to also run with flang-new -fc1. A few tests are updated to use fir-opt instead of tco (that's the preferred choice when testing a particular MLIR pass). basic-program.fir is not updated as that test is intended to verify the behaviour of tco specifically. Differential Revision: https://reviews.llvm.org/D126890 | 3 年前 | |
[flang][driver] Switch to the MLIR coding style in the driver (nfc) This patch re-factors the driver code in LLVM Flang (frontend + compiler) to use the MLIR style. For more context, please see: https://discourse.llvm.org/t/rfc-coding-style-in-the-driver/ Most changes here are rather self-explanatory. Accessors are renamed to be more consistent with the rest of LLVM (e.g. allSource --> getAllSources). Additionally, MLIR clang-tidy files are added in the affected directories. clang-tidy and clang-format files were copied from MLIR. Small additional changes are made to silence clang-tidy/clang-format warnings. [1] https://mlir.llvm.org/getting_started/DeveloperGuide/ Differential Revision: https://reviews.llvm.org/D125007 | 4 年前 | |
[flang][driver] Switch to the MLIR coding style in the driver (nfc) This patch re-factors the driver code in LLVM Flang (frontend + compiler) to use the MLIR style. For more context, please see: https://discourse.llvm.org/t/rfc-coding-style-in-the-driver/ Most changes here are rather self-explanatory. Accessors are renamed to be more consistent with the rest of LLVM (e.g. allSource --> getAllSources). Additionally, MLIR clang-tidy files are added in the affected directories. clang-tidy and clang-format files were copied from MLIR. Small additional changes are made to silence clang-tidy/clang-format warnings. [1] https://mlir.llvm.org/getting_started/DeveloperGuide/ Differential Revision: https://reviews.llvm.org/D125007 | 4 年前 | |
Remove redundant return statements (NFC) Identified with readability-redundant-control-flow. | 3 年前 |