From f1d3fe7aae7867b5de96b84d6d26b5c9f02f209a Mon Sep 17 00:00:00 2001 From: Alexis Perry-Holby Date: Tue, 16 Jul 2024 09:48:24 -0600 Subject: Add basic -mtune support (#98517) Initial implementation for the -mtune flag in Flang. This PR is a clean version of PR #96688, which is a re-land of PR #95043 --- flang/lib/Frontend/CompilerInvocation.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'flang/lib/Frontend/CompilerInvocation.cpp') diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index 37b5070..8c892d9 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -431,6 +431,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()); -- cgit v1.1