aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authormacurtis-amd <macurtis@amd.com>2025-01-14 08:02:02 -0600
committerGitHub <noreply@github.com>2025-01-14 08:02:02 -0600
commit310c281b020b169e760ca75f878f5873ffbb2a9f (patch)
tree79b81f4101229536c82eddf60bd1f09461dd281d /flang/lib/Frontend/CompilerInvocation.cpp
parent8fe11a26ae8f12622ddec83a7b80637080843a8b (diff)
downloadllvm-310c281b020b169e760ca75f878f5873ffbb2a9f.zip
llvm-310c281b020b169e760ca75f878f5873ffbb2a9f.tar.gz
llvm-310c281b020b169e760ca75f878f5873ffbb2a9f.tar.bz2
[flang][Driver] Preliminary support for -ftime-report (#122894)
The behavior is not entirely consistent with that of clang for the moment since detailed timing information on the LLVM IR optimization and code generation passes is not provided. The -ftime-report= option is also not enabled since that is only relevant for information about the LLVM IR passes. However, some code to handle that option has been included, to make it easier to support the option when the issues blocking it are resolved. A FortranSupport library has been created that is intended to mirror the LLVM and MLIR support libraries. Based on @tarunprabhu's PR https://github.com/llvm/llvm-project/pull/107270 with minor changes addressing latest review feedback. He's busy and we'd like to get this support in ASAP. Co-authored-by: Tarun Prabhu <tarun.prabhu@gmail.com>
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--flang/lib/Frontend/CompilerInvocation.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp
index 340efb1..5e71273 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -1436,6 +1436,10 @@ bool CompilerInvocation::createFromArgs(
}
}
+ // Process the timing-related options.
+ if (args.hasArg(clang::driver::options::OPT_ftime_report))
+ invoc.enableTimers = true;
+
invoc.setArgv0(argv0);
return success;