Add flags for loop-versioning pass enable/disable
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Rebased and updated help-message
Also using different type of template for the option
Please could you add tests for the flag forwarding logic in flang/tests/Driver/frontend-forwarding.f90. For example see https://reviews.llvm.org/rGd0d4b635786d510cd919cadbeb7e5e19983242cf
clang/lib/Driver/ToolChains/Flang.cpp | ||
---|---|---|
95 | Does GFortran only enable this with -Ofast? I would have thought this would be an -On thing because it doesn't impact precision. | |
flang/include/flang/Frontend/CodeGenOptions.def | ||
27 | nit: comment |
Updates based on review comments:
- Add tests.
- Enable on -O3
Also changed the name to match gfortran.
Mats, thanks for working on this! Just a few minor suggestions from me.
clang/lib/Driver/ToolChains/Flang.cpp | ||
---|---|---|
54 | Could you add a short Docstring, pls? In particular, is the logic implemented by this method consistent with GFortran? Are there any external docs that could be referred to here? | |
55 | Please rewrite this to use early exit, e.g.: Arg *LoopVersionOption = Args.getLastArg(options::OPT_Ofast, options::OPT_O, options::OPT_O4, options::OPT_floop_versioning, options::OPT_fno_loop_versioning) if !(LoopVersionOption) return false; // The remaining logic HERE | |
94–95 | Would you classify this as a code-gen option? Alongside -fstack-arrays and -flang-experimental-hlfir? It sound like we could introduce another hook here, adddCodeGenOptions? | |
flang/test/Driver/version-loops.f90 | ||
3 | ||
6 | [nit] If you are using -###, then you can just skip -fsyntax-only (it doesn't really matter what "action" is requested from the frontend driver). | |
34–35 | Similar suggestion for other CHECK lines - this will make the test a bit more explicit about the expected output. |
- Add new function to help clarify the purpose of the options being used.
- Add descriptive comment to make function use clearer.
- Update tests to make them a more explicit.
Could you add a short Docstring, pls? In particular, is the logic implemented by this method consistent with GFortran? Are there any external docs that could be referred to here?