[clang] [flang] [mlir] Add basic -mtune support (PR #98517)

2024-07-16 Thread Alexis Perry-Holby via cfe-commits
AlexisPerry wrote: @banach-space If this PR is indeed ready to go, would you mind committing it on my behalf? I don't have commit privileges any more. Thanks so much for all your help! And thanks to all the reviewers on previous versions of this PR as well! https://github.com/llvm/llvm-pro

[clang] [flang] [mlir] Add basic -mtune support (PR #98517)

2024-07-11 Thread Alexis Perry-Holby via cfe-commits
https://github.com/AlexisPerry updated https://github.com/llvm/llvm-project/pull/98517 >From 2e26f0f66f070cd0b684531efc63e63e2e584dfa Mon Sep 17 00:00:00 2001 From: Alexis Perry-Holby Date: Thu, 11 Jul 2024 12:51:39 -0600 Subject: [PATCH 1/2] Add basic -mtune support Initial implementation for

[clang] [flang] [mlir] Add basic -mtune support (PR #98517)

2024-07-11 Thread Alexis Perry-Holby via cfe-commits
https://github.com/AlexisPerry created https://github.com/llvm/llvm-project/pull/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 >From 2e26f0f66f070cd0b684531efc63e63e2e584dfa Mon Sep 17 00:00:00 2001 From: Ale

[clang] [flang] [mlir] [flang] Retry add basic -mtune support (PR #96688)

2024-07-02 Thread Alexis Perry-Holby via cfe-commits
@@ -0,0 +1,9 @@ +; RUN: mlir-translate -import-llvm -split-input-file %s | FileCheck %s AlexisPerry wrote: I have been trying to reproduce my error ever since saying I had one and have been unsuccessful. It now appears that mlir-translate doesn't care about the

[clang] [flang] [mlir] [flang] Retry add basic -mtune support (PR #96688)

2024-06-27 Thread Alexis Perry-Holby via cfe-commits
@@ -0,0 +1,9 @@ +; RUN: mlir-translate -import-llvm -split-input-file %s | FileCheck %s AlexisPerry wrote: I ran into failures if I didn't include the guard. I have separate builds for x86 and Aarch64. https://github.com/llvm/llvm-project/pull/96688 __

[clang] [flang] [mlir] [flang] Retry add basic -mtune support (PR #96688)

2024-06-27 Thread Alexis Perry-Holby via cfe-commits
https://github.com/AlexisPerry updated https://github.com/llvm/llvm-project/pull/96688 >From 2312d31b14aecc6eeea2e81d221ee004e5de3efc Mon Sep 17 00:00:00 2001 From: Alexis Perry-Holby Date: Thu, 6 Jun 2024 14:02:52 -0600 Subject: [PATCH 01/13] [flang] Add basic -mtune support --- clang/includ

[clang] [flang] [mlir] [flang] Retry add basic -mtune support (PR #96688)

2024-06-27 Thread Alexis Perry-Holby via cfe-commits
@@ -0,0 +1,7 @@ +// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s AlexisPerry wrote: Thanks again! Yes, you are absolutely correct. https://github.com/llvm/llvm-project/pull/96688 ___ cfe-commits mailing list

[clang] [flang] [mlir] [flang] Retry add basic -mtune support (PR #96688)

2024-06-27 Thread Alexis Perry-Holby via cfe-commits
@@ -0,0 +1,9 @@ +; RUN: mlir-translate -import-llvm -split-input-file %s | FileCheck %s AlexisPerry wrote: Thank you so much for the catch! Yes, this guard is absolutely needed. https://github.com/llvm/llvm-project/pull/96688 ___

[clang] [flang] [mlir] [flang] Retry add basic -mtune support (PR #96688)

2024-06-25 Thread Alexis Perry-Holby via cfe-commits
https://github.com/AlexisPerry created https://github.com/llvm/llvm-project/pull/96688 This aims to reland the changes and fix the broken test from PR https://github.com/llvm/llvm-project/pull/95043 >From 2312d31b14aecc6eeea2e81d221ee004e5de3efc Mon Sep 17 00:00:00 2001 From: Alexis Perry-Holb

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-25 Thread Alexis Perry-Holby via cfe-commits
AlexisPerry wrote: I believe I've addressed all the review comments and all the checks have passed. Could someone with commit access please merge this on my behalf? Thank you. https://github.com/llvm/llvm-project/pull/95043 ___ cfe-commits mailing

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-24 Thread Alexis Perry-Holby via cfe-commits
AlexisPerry wrote: Thanks for explaining more thoroughly. I have moved the test to the Driver directory as requested. https://github.com/llvm/llvm-project/pull/95043 ___ cfe-commits mailing list cfe-commits@lists.ll

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-24 Thread Alexis Perry-Holby via cfe-commits
https://github.com/AlexisPerry updated https://github.com/llvm/llvm-project/pull/95043 >From 2312d31b14aecc6eeea2e81d221ee004e5de3efc Mon Sep 17 00:00:00 2001 From: Alexis Perry-Holby Date: Thu, 6 Jun 2024 14:02:52 -0600 Subject: [PATCH 01/11] [flang] Add basic -mtune support --- clang/includ

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-24 Thread Alexis Perry-Holby via cfe-commits
@@ -0,0 +1,9 @@ +; RUN: mlir-translate -import-llvm -split-input-file %s | FileCheck %s + +; CHECK-LABEL: llvm.func @tune_cpu() +; CHECK-SAME: tune_cpu = "pentium4" AlexisPerry wrote: Alright, after some digging, I can confirm that `tune-cpu` is listed among the

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-20 Thread Alexis Perry-Holby via cfe-commits
AlexisPerry wrote: I have lost my upstream commit privileges due to inactivity, so once this is fully approved, could someone merge it on my behalf? Thank you. https://github.com/llvm/llvm-project/pull/95043 ___ cfe-commits mailing list cfe-commits@l

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-20 Thread Alexis Perry-Holby via cfe-commits
https://github.com/AlexisPerry updated https://github.com/llvm/llvm-project/pull/95043 >From 2312d31b14aecc6eeea2e81d221ee004e5de3efc Mon Sep 17 00:00:00 2001 From: Alexis Perry-Holby Date: Thu, 6 Jun 2024 14:02:52 -0600 Subject: [PATCH 01/10] [flang] Add basic -mtune support --- clang/includ

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-20 Thread Alexis Perry-Holby via cfe-commits
https://github.com/AlexisPerry edited https://github.com/llvm/llvm-project/pull/95043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-20 Thread Alexis Perry-Holby via cfe-commits
AlexisPerry wrote: I hear you. I modeled this test closely after target-features-*.f90 in that same directory, which is why I put it in flang/test/Lower. I am willing to move it to flang/test/Driver, but if I do so should I also move the target-features-*.f

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-20 Thread Alexis Perry-Holby via cfe-commits
@@ -411,6 +412,13 @@ void Flang::addTargetOptions(const ArgList &Args, } // TODO: Add target specific flags, ABI, mtune option etc. + if (const Arg *A = Args.getLastArg(options::OPT_mtune_EQ)) { +CmdArgs.push_back("-tune-cpu"); +if (strcmp(A->getValue(), "native")

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-20 Thread Alexis Perry-Holby via cfe-commits
@@ -0,0 +1,9 @@ +; RUN: mlir-translate -import-llvm -split-input-file %s | FileCheck %s + +; CHECK-LABEL: llvm.func @tune_cpu() +; CHECK-SAME: tune_cpu = "pentium4" AlexisPerry wrote: >From what I can see, L1685 of ModuleImport.cpp has tune-cpu listed among the

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-12 Thread Alexis Perry-Holby via cfe-commits
https://github.com/AlexisPerry updated https://github.com/llvm/llvm-project/pull/95043 >From 2312d31b14aecc6eeea2e81d221ee004e5de3efc Mon Sep 17 00:00:00 2001 From: Alexis Perry-Holby Date: Thu, 6 Jun 2024 14:02:52 -0600 Subject: [PATCH 1/9] [flang] Add basic -mtune support --- clang/include/

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-12 Thread Alexis Perry-Holby via cfe-commits
@@ -371,7 +371,7 @@ static mlir::LogicalResult convertFortranSourceToMLIR( ctx, semanticsContext, defKinds, semanticsContext.intrinsics(), semanticsContext.targetCharacteristics(), parsing.allCooked(), targetTriple, kindMap, loweringOptions, envDefaults, -

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-12 Thread Alexis Perry-Holby via cfe-commits
https://github.com/AlexisPerry updated https://github.com/llvm/llvm-project/pull/95043 >From 2312d31b14aecc6eeea2e81d221ee004e5de3efc Mon Sep 17 00:00:00 2001 From: Alexis Perry-Holby Date: Thu, 6 Jun 2024 14:02:52 -0600 Subject: [PATCH 1/8] [flang] Add basic -mtune support --- clang/include/

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-12 Thread Alexis Perry-Holby via cfe-commits
@@ -1796,6 +1797,10 @@ void ModuleImport::processFunctionAttributes(llvm::Function *func, attr.isStringAttribute()) funcOp.setTargetCpuAttr(StringAttr::get(context, attr.getValueAsString())); + if (llvm::Attribute attr = func->getFnAttribute("tune-cpu"); + att

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-12 Thread Alexis Perry-Holby via cfe-commits
https://github.com/AlexisPerry updated https://github.com/llvm/llvm-project/pull/95043 >From 2312d31b14aecc6eeea2e81d221ee004e5de3efc Mon Sep 17 00:00:00 2001 From: Alexis Perry-Holby Date: Thu, 6 Jun 2024 14:02:52 -0600 Subject: [PATCH 1/7] [flang] Add basic -mtune support --- clang/include/

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-12 Thread Alexis Perry-Holby via cfe-commits
@@ -32,6 +32,9 @@ class TargetOptions { /// If given, the name of the target CPU to generate code for. std::string cpu; + /// If given, the name of the target CPU to tune code for. + std::string tuneCPU; AlexisPerry wrote: Thank you for the suggestion.

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-12 Thread Alexis Perry-Holby via cfe-commits
https://github.com/AlexisPerry updated https://github.com/llvm/llvm-project/pull/95043 >From 2312d31b14aecc6eeea2e81d221ee004e5de3efc Mon Sep 17 00:00:00 2001 From: Alexis Perry-Holby Date: Thu, 6 Jun 2024 14:02:52 -0600 Subject: [PATCH 1/6] [flang] Add basic -mtune support --- clang/include/

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-12 Thread Alexis Perry-Holby via cfe-commits
AlexisPerry wrote: Those are great suggestions, thank you. I have made the appropriate updates. https://github.com/llvm/llvm-project/pull/95043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-12 Thread Alexis Perry-Holby via cfe-commits
AlexisPerry wrote: Thank you for the catch! Yes, the CPU-NOT line was missing. I have rectified this. https://github.com/llvm/llvm-project/pull/95043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-12 Thread Alexis Perry-Holby via cfe-commits
https://github.com/AlexisPerry updated https://github.com/llvm/llvm-project/pull/95043 >From 2312d31b14aecc6eeea2e81d221ee004e5de3efc Mon Sep 17 00:00:00 2001 From: Alexis Perry-Holby Date: Thu, 6 Jun 2024 14:02:52 -0600 Subject: [PATCH 1/5] [flang] Add basic -mtune support --- clang/include/

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-12 Thread Alexis Perry-Holby via cfe-commits
https://github.com/AlexisPerry updated https://github.com/llvm/llvm-project/pull/95043 >From 2312d31b14aecc6eeea2e81d221ee004e5de3efc Mon Sep 17 00:00:00 2001 From: Alexis Perry-Holby Date: Thu, 6 Jun 2024 14:02:52 -0600 Subject: [PATCH 1/4] [flang] Add basic -mtune support --- clang/include/

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-12 Thread Alexis Perry-Holby via cfe-commits
https://github.com/AlexisPerry updated https://github.com/llvm/llvm-project/pull/95043 >From 2312d31b14aecc6eeea2e81d221ee004e5de3efc Mon Sep 17 00:00:00 2001 From: Alexis Perry-Holby Date: Thu, 6 Jun 2024 14:02:52 -0600 Subject: [PATCH 1/4] [flang] Add basic -mtune support --- clang/include/

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-11 Thread Alexis Perry-Holby via cfe-commits
https://github.com/AlexisPerry updated https://github.com/llvm/llvm-project/pull/95043 >From 2312d31b14aecc6eeea2e81d221ee004e5de3efc Mon Sep 17 00:00:00 2001 From: Alexis Perry-Holby Date: Thu, 6 Jun 2024 14:02:52 -0600 Subject: [PATCH 1/3] [flang] Add basic -mtune support --- clang/include/

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-11 Thread Alexis Perry-Holby via cfe-commits
@@ -411,6 +412,13 @@ void Flang::addTargetOptions(const ArgList &Args, } // TODO: Add target specific flags, ABI, mtune option etc. + if (const Arg *A = Args.getLastArg(options::OPT_mtune_EQ)) { +CmdArgs.push_back("-tune-cpu"); +if (strcmp(A->getValue(), "native")

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-11 Thread Alexis Perry-Holby via cfe-commits
@@ -371,7 +371,7 @@ static mlir::LogicalResult convertFortranSourceToMLIR( ctx, semanticsContext, defKinds, semanticsContext.intrinsics(), semanticsContext.targetCharacteristics(), parsing.allCooked(), targetTriple, kindMap, loweringOptions, envDefaults, -

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-11 Thread Alexis Perry-Holby via cfe-commits
@@ -58,6 +58,15 @@ def FramePointerKindAttr : LLVM_Attr<"FramePointerKind", "framePointerKind"> { let assemblyFormat = "`<` $framePointerKind `>`"; } +//===--===// +// TuneCPUAttr +//===

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-10 Thread Alexis Perry-Holby via cfe-commits
https://github.com/AlexisPerry updated https://github.com/llvm/llvm-project/pull/95043 >From 2312d31b14aecc6eeea2e81d221ee004e5de3efc Mon Sep 17 00:00:00 2001 From: Alexis Perry-Holby Date: Thu, 6 Jun 2024 14:02:52 -0600 Subject: [PATCH 1/2] [flang] Add basic -mtune support --- clang/include/

[clang] [flang] [mlir] [flang] Add basic -mtune support (PR #95043)

2024-06-10 Thread Alexis Perry-Holby via cfe-commits
https://github.com/AlexisPerry created https://github.com/llvm/llvm-project/pull/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. >From 2312d31b14aecc