From d36028120a6ef6346bfaafe82d4d1a2887cf5e33 Mon Sep 17 00:00:00 2001 From: Sebastian Pop Date: Wed, 21 May 2025 08:27:39 -0500 Subject: [flang] add -floop-interchange and enable it with opt levels (#140182) Enable the use of -floop-interchange from the flang driver. Enable in flang LLVM's loop interchange at levels -O2, -O3, -Ofast, and -Os. --- flang/lib/Frontend/CompilerInvocation.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'flang/lib/Frontend/CompilerInvocation.cpp') diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index b6c3771..ba25318 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -270,6 +270,9 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts, clang::driver::options::OPT_fno_stack_arrays, false)) opts.StackArrays = 1; + if (args.getLastArg(clang::driver::options::OPT_floop_interchange)) + opts.InterchangeLoops = 1; + if (args.getLastArg(clang::driver::options::OPT_vectorize_loops)) opts.VectorizeLoop = 1; -- cgit v1.1