[flang-commits] [clang] [flang] [Clang][Flang] Enable loop interchange by default at -O3 (PR #216920)

Ryotaro Kasuga via flang-commits flang-commits at lists.llvm.org
Mon Aug 17 23:57:44 PDT 2026


================
@@ -3564,9 +3564,10 @@ void tools::handleVectorizeSLPArgs(const ArgList &Args,
 
 void tools::handleInterchangeLoopsArgs(const ArgList &Args,
                                        ArgStringList &CmdArgs) {
-  if (Args.hasFlag(options::OPT_floop_interchange,
-                   options::OPT_fno_loop_interchange, false))
-    CmdArgs.push_back("-floop-interchange");
+  // Forward the user's explicit choice; the frontend applies the -O3
+  // default when neither flag is present.
+  Args.AddLastArg(CmdArgs, options::OPT_floop_interchange,
+                  options::OPT_fno_loop_interchange);
----------------
kasuga-fj wrote:

I see. Thanks for the clarification.

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


More information about the flang-commits mailing list