aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorAlexis Perry-Holby <AlexisPerry@users.noreply.github.com>2024-06-25 11:39:35 -0600
committerGitHub <noreply@github.com>2024-06-25 18:39:35 +0100
commita790279bf2a8be2f9c42bf80f55a63933e398d0e (patch)
treec9f2be9657baf65c09860fbb5b548c8d06bf79e1 /flang/lib/Frontend/CompilerInvocation.cpp
parent928b7808406b893b24edb8d8462491dc82f9ce43 (diff)
downloadllvm-a790279bf2a8be2f9c42bf80f55a63933e398d0e.zip
llvm-a790279bf2a8be2f9c42bf80f55a63933e398d0e.tar.gz
llvm-a790279bf2a8be2f9c42bf80f55a63933e398d0e.tar.bz2
[flang] Add basic -mtune support (#95043)
This PR adds -mtune as a valid flang flag and passes the information through to LLVM IR as an attribute on all functions. No specific architecture optimizations are added at this time.
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 f96d72f..ed19aaa 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -407,6 +407,10 @@ static void parseTargetArgs(TargetOptions &opts, llvm::opt::ArgList &args) {
args.getLastArg(clang::driver::options::OPT_target_cpu))
opts.cpu = a->getValue();
+ if (const llvm::opt::Arg *a =
+ args.getLastArg(clang::driver::options::OPT_tune_cpu))
+ opts.cpuToTuneFor = a->getValue();
+
for (const llvm::opt::Arg *currentArg :
args.filtered(clang::driver::options::OPT_target_feature))
opts.featuresAsWritten.emplace_back(currentArg->getValue());