[flang-commits] [flang] [clang] [flang] Enable alias tags pass by default (PR #73111)
Tom Eccles via flang-commits
flang-commits at lists.llvm.org
Thu Nov 23 08:26:28 PST 2023
================
@@ -242,10 +242,24 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts,
clang::driver::options::OPT_fno_loop_versioning, false))
opts.LoopVersioning = 1;
- opts.AliasAnalysis =
- args.hasFlag(clang::driver::options::OPT_falias_analysis,
- clang::driver::options::OPT_fno_alias_analysis,
- /*default=*/false);
+ bool aliasAnalysis = false;
+ bool noAliasAnalysis = false;
+ if (auto *arg =
+ args.getLastArg(clang::driver::options::OPT_falias_analysis,
+ clang::driver::options::OPT_fno_alias_analysis)) {
+ if (arg->getOption().matches(clang::driver::options::OPT_falias_analysis))
+ aliasAnalysis = true;
+ else
+ noAliasAnalysis = true;
+ }
+ opts.AliasAnalysis = 0;
+ if (opts.OptimizationLevel > 0) {
+ if (!noAliasAnalysis)
+ opts.AliasAnalysis = 1;
+ } else {
+ if (aliasAnalysis)
+ opts.AliasAnalysis = 1;
+ }
----------------
tblah wrote:
Thanks for explaining. Is https://github.com/llvm/llvm-project/pull/73111/commits/c2b7674546588d9e5227f1d71cada670bf61166b acceptable?
https://github.com/llvm/llvm-project/pull/73111
More information about the flang-commits
mailing list