[flang] [clang] [flang] Enable alias tags pass by default (PR #73111)

Andrzej WarzyƄski via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 27 06:38:32 PST 2023


https://github.com/banach-space commented:

I think that what's being proposed here is quite non-standard. In particular, what should happen here:
```bash
flang-new {A very long list of options copied from somewhere, including -fno-alias-analysis) -O3 file.f90
```

How is the user meant to know that they need to add `-falias-analysis` at the end to enable alias analysis? And in general, how are they supposed to know that `-fno-alias-analysis` overrides `-O3`?

If it was the case of "the last relevant option takes priority" (as is the case with most/all options) then that would be easy - identical logic would always apply. 

This should be easy to fix if you use this instead of what's currently implemented (apologies for GitHub being unable to format this properly):
```cpp
Args.getLastArg(options::OPT_falias_analysis,
                              options::OPT_fno_alias_analysis,
                               options::OPT_Ofast,
                               options::OPT_O,
                               options::OPT_O4);
```
(I'm skipping other changes that would also be required - hopefully this is clear enough). This should still give you all the flexibility that you need for testing and be less surprising for end users.

If you are in a rush to land this then this LGTM, but I would like the relationship between `-O{1|2|3|4}` and `-f{no}-alias-analysis` to be refined in a follow-up patch. Unless there's a good reason to avoid that? WDYT?

Sorry, I've only really realised this after @tblah updated [falias-analysis.f90](https://github.com/llvm/llvm-project/pull/73111/files#diff-9e3d54cea408f6f309c22f64040afb821ceba52f3b73e2001b3a4b72114f2a10). 

https://github.com/llvm/llvm-project/pull/73111


More information about the cfe-commits mailing list