[clang] [flang] [llvm] [flang][AArch64] Always link compiler-rt to flang after libgcc (PR #144710)

2025-06-20 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. Other than the question about `Flang-RT` vs `compiler-rt` in the `llvm/CMakeLists`, this looks good to me. Thanks. https://github.com/llvm/llvm-project/pull/144710 ___ cfe-commits mailing list

[clang] [flang] [llvm] [flang][AArch64] Always link compiler-rt to flang after libgcc (PR #144710)

2025-06-20 Thread Tarun Prabhu via cfe-commits
@@ -653,6 +653,13 @@ if(LLVM_EXPERIMENTAL_TARGETS_TO_BUILD STREQUAL "all") set(LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ${LLVM_ALL_EXPERIMENTAL_TARGETS}) endif() +if("flang" IN_LIST LLVM_ENABLE_PROJECTS AND + "AArch64" IN_LIST LLVM_TARGETS_TO_BUILD AND + NOT "compiler-rt" IN_

[clang] [flang] [llvm] [flang][AArch64] Always link compiler-rt to flang after libgcc (PR #144710)

2025-06-20 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu edited https://github.com/llvm/llvm-project/pull/144710 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] Fix and reapply IR PGO support for Flang (PR #142892)

2025-06-16 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: Thanks for the fix @kiranchandramohan. I didn't spot the issue with `llvm-profdata` https://github.com/llvm/llvm-project/pull/142892 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] [flang] [llvm] Fix and reapply IR PGO support for Flang (PR #142892)

2025-06-14 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: There is a similar build failure [here](https://github.com/llvm/llvm-project/pull/143603) that seems to be even older. I don't think these are related. https://github.com/llvm/llvm-project/pull/142892 ___ cfe-commits mailing list c

[clang] [flang] [llvm] Fix and reapply IR PGO support for Flang (PR #142892)

2025-06-13 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu closed https://github.com/llvm/llvm-project/pull/142892 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] Fix and reapply IR PGO support for Flang (PR #142892)

2025-06-12 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. Thanks. I'll merge this tomorrow morning (my time), so I can keep an eye on the buildbots, just in case. https://github.com/llvm/llvm-project/pull/142892 ___ cfe-commits mailing list cfe-commi

[clang] [flang] [mlir] [flang][flang-driver] atomic control support (PR #143441)

2025-06-12 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. Other than the one comment, the frontend related parts LGTM, but please wait for someone more familiar with the OpenMP side of things. https://github.com/llvm/llvm-project/pull/143441 ___ cfe-

[clang] [flang] [mlir] [flang][flang-driver] atomic control support (PR #143441)

2025-06-12 Thread Tarun Prabhu via cfe-commits
@@ -88,6 +88,44 @@ void fir::setTuneCPU(mlir::ModuleOp mod, llvm::StringRef cpu) { mod->setAttr(tuneCpuName, mlir::StringAttr::get(ctx, cpu)); } +static constexpr const char *amdgpuIgnoreDenormalModeName = +"fir.amdgpu.ignore.denormal.mode"; +void fir::setAmdgpuIgnoreDe

[clang] [flang] [mlir] [flang][flang-driver] atomic control support (PR #143441)

2025-06-12 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu edited https://github.com/llvm/llvm-project/pull/143441 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][Driver] Enable support for -mmacos-version-min= (PR #143508)

2025-06-10 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. LGTM. Thanks. https://github.com/llvm/llvm-project/pull/143508 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [mlir] [flang] Add support for -mrecip[=] (PR #143418)

2025-06-10 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu closed https://github.com/llvm/llvm-project/pull/143418 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][Driver] Enable support for -mmacos-version-min= (PR #143508)

2025-06-10 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu commented: Thanks Tom. Since this has been enabled for `fc1` as well, could you add a test to ensure that it is accepted by `fc1` as well. Just one should be fine. We don't have to check everything in both cases. https://github.com/llvm/llvm-project/pull/143508 _

[clang] [flang] [mlir] [flang][flang-driver] atomic control support (PR #143441)

2025-06-09 Thread Tarun Prabhu via cfe-commits
@@ -58,10 +58,24 @@ void setTargetCPU(mlir::ModuleOp mod, llvm::StringRef cpu); /// Get the target CPU string from the Module or return a null reference. llvm::StringRef getTargetCPU(mlir::ModuleOp mod); +// Setters and Getters for atomic control options +void setAmdgpuIgnoreD

[clang] [flang] [mlir] [flang][flang-driver] atomic control support (PR #143441)

2025-06-09 Thread Tarun Prabhu via cfe-commits
@@ -2911,8 +2911,13 @@ static void genAtomicUpdateStatement( if (rightHandClauseList) genOmpAtomicHintAndMemoryOrderClauses(converter, *rightHandClauseList, hint, memoryOrder); + auto module = firOpBuilder.getModule(); -

[clang] [flang] [mlir] [flang][flang-driver] atomic control support (PR #143441)

2025-06-09 Thread Tarun Prabhu via cfe-commits
@@ -53,6 +53,11 @@ class TargetOptions { /// Print verbose assembly bool asmVerbose = false; + + /// Atomic Control Options for AMD GPU tarunprabhu wrote: Nit ```suggestion /// Atomic control options for AMD GPU ``` https://github.com/llvm/llvm-projec

[clang] [flang] [mlir] [flang][flang-driver] atomic control support (PR #143441)

2025-06-09 Thread Tarun Prabhu via cfe-commits
@@ -58,10 +58,24 @@ void setTargetCPU(mlir::ModuleOp mod, llvm::StringRef cpu); /// Get the target CPU string from the Module or return a null reference. llvm::StringRef getTargetCPU(mlir::ModuleOp mod); +// Setters and Getters for atomic control options tarun

[clang] [flang] [mlir] [flang][flang-driver] atomic control support (PR #143441)

2025-06-09 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu commented: Thanks for this. Since you have added both `FlangOption` and `FC1Option` in `Options.td`, could you add a test that checks that the option is handled by the main driver as well as `fc1`. One that simply checks that the option gets passed down to `fc1`

[clang] [flang] [mlir] [flang][flang-driver] atomic control support (PR #143441)

2025-06-09 Thread Tarun Prabhu via cfe-commits
@@ -54,6 +54,20 @@ def FlagsAttr : OpenMP_Attr<"Flags", "flags"> { let assemblyFormat = "`<` struct(params) `>`"; } +//===--===// +// AtomicControlAttr +//===-

[clang] [flang] [mlir] [flang][flang-driver] atomic control support (PR #143441)

2025-06-09 Thread Tarun Prabhu via cfe-commits
@@ -88,6 +88,46 @@ void fir::setTuneCPU(mlir::ModuleOp mod, llvm::StringRef cpu) { mod->setAttr(tuneCpuName, mlir::StringAttr::get(ctx, cpu)); } +static constexpr const char *amdgpuIgnoreDenormalModeName = +"fir.amdgpu.ignore.denormal.mode"; +void fir::setAmdgpuIgnoreDe

[clang] [flang] [mlir] [flang][flang-driver] atomic control support (PR #143441)

2025-06-09 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu edited https://github.com/llvm/llvm-project/pull/143441 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [mlir] [flang] Add support for -mrecip[=] (PR #143418)

2025-06-09 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. Thanks for the changes, Cameron. LGTM. https://github.com/llvm/llvm-project/pull/143418 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [flang] [mlir] [flang] Add support for -mrecip[=] (PR #143418)

2025-06-09 Thread Tarun Prabhu via cfe-commits
@@ -2636,6 +2636,11 @@ void ModuleImport::processFunctionAttributes(llvm::Function *func, funcOp.setTargetFeaturesAttr( LLVM::TargetFeaturesAttr::get(context, attr.getValueAsString())); + if (llvm::Attribute attr = func->getFnAttribute("reciprocal-estimates"); +

[clang] [flang] [mlir] [flang] Add support for -mrecip[=] (PR #143418)

2025-06-09 Thread Tarun Prabhu via cfe-commits
@@ -1549,6 +1549,9 @@ LogicalResult ModuleTranslation::convertOneFunction(LLVMFuncOp func) { if (auto tuneCpu = func.getTuneCpu()) llvmFunc->addFnAttr("tune-cpu", *tuneCpu); + if (auto reciprocalEstimates = func.getReciprocalEstimates()) tarunprabhu wr

[clang] [flang] [mlir] [flang] Add support for -mrecip[=] (PR #143418)

2025-06-09 Thread Tarun Prabhu via cfe-commits
@@ -0,0 +1,27 @@ +! Test that -mrecip[=] works as expected. + tarunprabhu wrote: Since you have added both `FlangOption` and `FC1Option` in `Options.td`, could we test that the option is recognized by the main driver as well, not just `-fc1`? https://github.co

[clang] [flang] [mlir] [flang] Add support for -mrecip[=] (PR #143418)

2025-06-09 Thread Tarun Prabhu via cfe-commits
@@ -0,0 +1,9 @@ +; RUN: mlir-translate -import-llvm -split-input-file %s | FileCheck %s + +; CHECK-LABEL: llvm.func @reciprocal_estimates() +; CHECK-SAME: reciprocal_estimates = "all" +define void @reciprocal_estimates() #0 { + ret void +} + +attributes #0 = { "reciprocal-estimat

[clang] [flang] [mlir] [flang] Add support for -mrecip[=] (PR #143418)

2025-06-09 Thread Tarun Prabhu via cfe-commits
@@ -1549,6 +1549,9 @@ LogicalResult ModuleTranslation::convertOneFunction(LLVMFuncOp func) { if (auto tuneCpu = func.getTuneCpu()) llvmFunc->addFnAttr("tune-cpu", *tuneCpu); + if (auto reciprocalEstimates = func.getReciprocalEstimates()) tarunprabhu wr

[clang] [flang] [mlir] [flang] Add support for -mrecip[=] (PR #143418)

2025-06-09 Thread Tarun Prabhu via cfe-commits
@@ -2636,6 +2636,11 @@ void ModuleImport::processFunctionAttributes(llvm::Function *func, funcOp.setTargetFeaturesAttr( LLVM::TargetFeaturesAttr::get(context, attr.getValueAsString())); + if (llvm::Attribute attr = func->getFnAttribute("reciprocal-estimates"); +

[clang] [flang] [mlir] [flang] Add support for -mrecip[=] (PR #143418)

2025-06-09 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu edited https://github.com/llvm/llvm-project/pull/143418 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [mlir] [flang] Add support for -mrecip[=] (PR #143418)

2025-06-09 Thread Tarun Prabhu via cfe-commits
@@ -56,6 +56,9 @@ class CodeGenOptions : public CodeGenOptionsBase { // The prefered vector width, if requested by -mprefer-vector-width. std::string PreferVectorWidth; + // List of reciprocal estimate sub-options. tarunprabhu wrote: Should this be a doc

[clang] [flang] [mlir] [flang] Add support for -mrecip[=] (PR #143418)

2025-06-09 Thread Tarun Prabhu via cfe-commits
@@ -3189,3 +3189,144 @@ StringRef tools::ParseMPreferVectorWidthOption(clang::DiagnosticsEngine &Diags, return Value; } + +// This is a helper function for validating the optional refinement step +// parameter in reciprocal argument strings. Return false if there is an erro

[clang] [flang] [mlir] [flang] Add support for -mrecip[=] (PR #143418)

2025-06-09 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu commented: Thanks for this. Just some minor comments. https://github.com/llvm/llvm-project/pull/143418 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [Driver] Move CommonArgs to a location visible by the Frontend Drivers (PR #142800)

2025-06-06 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. https://github.com/llvm/llvm-project/pull/142800 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [Driver] Move CommonArgs to a location visible by the Frontend Drivers (PR #142800)

2025-06-06 Thread Tarun Prabhu via cfe-commits
@@ -238,6 +238,12 @@ #define LLVM_PREFETCH(addr, rw, locality) #endif +#if __has_attribute(uninitialized) +#define LLVM_ATTRIBUTE_UNINITIALIED __attribute__((uninitialized)) tarunprabhu wrote: Spelling: ```suggestion #define LLVM_ATTRIBUTE_UNINITIALIZED __a

[clang] [flang] [llvm] [Driver] Move CommonArgs to a location visible by the Frontend Drivers (PR #142800)

2025-06-06 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu requested changes to this pull request. https://github.com/llvm/llvm-project/pull/142800 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [Driver] Move CommonArgs to a location visible by the Frontend Drivers (PR #142800)

2025-06-06 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: > I had 1 minor objection, see my concern on the `uninitialized` attribute > removal. Would it be simpler just to initialize the variable before use? I assume that the attribute is present to eliminate compiler warnings about uninitialized variables being passed by referenc

[clang] [flang] [Driver] Move CommonArgs to a location visible by the Frontend Drivers (PR #142800)

2025-06-06 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. Thanks for the changes, Cameron. Could you take a look at the [failing buildkite](https://github.com/llvm/llvm-project/actions/runs/15493623574/job/43624895590?pr=142800) and see if it is something relevant? It seems to be a Windows b

[clang] [flang] [Driver] Move CommonArgs to a location visible by the Frontend Drivers (PR #142800)

2025-06-06 Thread Tarun Prabhu via cfe-commits
@@ -3167,3 +3167,29 @@ void tools::handleInterchangeLoopsArgs(const ArgList &Args, options::OPT_fno_loop_interchange, EnableInterchange)) CmdArgs.push_back("-floop-interchange"); } + +std::optional tools::ParseMPreferVectorWidthOption( +clang::Diagno

[clang] [flang] [Driver] Move CommonArgs to a location visible by the Frontend Drivers (PR #142800)

2025-06-05 Thread Tarun Prabhu via cfe-commits
@@ -3167,3 +3167,29 @@ void tools::handleInterchangeLoopsArgs(const ArgList &Args, options::OPT_fno_loop_interchange, EnableInterchange)) CmdArgs.push_back("-floop-interchange"); } + +std::optional tools::ParseMPreferVectorWidthOption( +clang::Diagno

[clang] [flang] [Driver] Move CommonArgs to a location visible by the Frontend Drivers (PR #142800)

2025-06-05 Thread Tarun Prabhu via cfe-commits
@@ -3167,3 +3167,29 @@ void tools::handleInterchangeLoopsArgs(const ArgList &Args, options::OPT_fno_loop_interchange, EnableInterchange)) CmdArgs.push_back("-floop-interchange"); } + +std::optional tools::ParseMPreferVectorWidthOption( +clang::Diagno

[clang] [flang] [Driver] Move CommonArgs to a location visible by the Frontend Drivers (PR #142800)

2025-06-05 Thread Tarun Prabhu via cfe-commits
@@ -270,6 +270,11 @@ void handleVectorizeLoopsArgs(const llvm::opt::ArgList &Args, /// Enable -fslp-vectorize based on the optimization level selected. void handleVectorizeSLPArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs); +

[clang] [flang] [llvm] Fix and reapply IR PGO support for Flang (PR #142892)

2025-06-05 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: Thanks for the fix and the explanation. I will try this PR out, but it might take me a day or two. Do you have merge access? If not, I will merge it if everything passes for me. https://github.com/llvm/llvm-project/pull/142892 ___

[clang] [flang] [Driver] Move CommonArgs to a location visible by the Frontend Drivers (PR #142800)

2025-06-04 Thread Tarun Prabhu via cfe-commits
@@ -270,6 +270,12 @@ void handleVectorizeLoopsArgs(const llvm::opt::ArgList &Args, /// Enable -fslp-vectorize based on the optimization level selected. void handleVectorizeSLPArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs); +

[clang] [flang] [Driver] Move CommonArgs to a location visible by the Frontend Drivers (PR #142800)

2025-06-04 Thread Tarun Prabhu via cfe-commits
@@ -3167,3 +3167,30 @@ void tools::handleInterchangeLoopsArgs(const ArgList &Args, options::OPT_fno_loop_interchange, EnableInterchange)) CmdArgs.push_back("-floop-interchange"); } + +void tools::ParseMPreferVectorWidthOption(clang::DiagnosticsEngine &Di

[clang] [flang] [Driver] Move CommonArgs to a location visible by the Frontend Drivers (PR #142800)

2025-06-04 Thread Tarun Prabhu via cfe-commits
@@ -270,6 +270,12 @@ void handleVectorizeLoopsArgs(const llvm::opt::ArgList &Args, /// Enable -fslp-vectorize based on the optimization level selected. void handleVectorizeSLPArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs); +

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-06-02 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: > I'm very sorry for this trouble.I'll check carefully and fix it before > submitting again. Happens to all of us. As a reviewer, I should have spotted this before approving it. Let's both try to get it right the second time around :-) https://github.com/llvm/llvm-project/p

[clang] [flang] [mlir] [flang] Add support for -mrecip[=] (PR #142172)

2025-05-31 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: > > LGTM, though, I think we'd better reuse the code from `Clang.cpp`. > > `flangFrontend` already depends on `clangDriver`, so we just need to export > > `ParseMRecip` and `getRefinementStep` from `clangDriver` (and probably > > replace their `Driver` argument with a `Diagn

[clang] [flang] [flang][driver] Introduce FCC_OVERRIDE_OPTIONS. (PR #140556)

2025-05-30 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. Thanks Abid. LGTM. https://github.com/llvm/llvm-project/pull/140556 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [mlir] [flang] Add support for -mprefer-vector-width= (PR #142073)

2025-05-30 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: @mcinally, It looks like the buildbot failure is because a test is written expecting a single attribute, but two are present, although the attribute being checked for is present. https://github.com/llvm/llvm-project/pull/142073 _

[clang] [flang] [flang][driver] Introduce FCC_OVERRIDE_OPTIONS. (PR #140556)

2025-05-30 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu edited https://github.com/llvm/llvm-project/pull/140556 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] Revert "Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler" (PR #142159)

2025-05-30 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu created https://github.com/llvm/llvm-project/pull/142159 Reverts llvm/llvm-project#136098 >From b9503fe262c416111ee77be30767a791cf750fb8 Mon Sep 17 00:00:00 2001 From: Tarun Prabhu Date: Fri, 30 May 2025 08:22:15 -0600 Subject: [PATCH] =?UTF-8?q?Revert=20"Add=20I

[clang] [flang] [mlir] [flang] Add support for -mprefer-vector-width= (PR #142073)

2025-05-30 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu closed https://github.com/llvm/llvm-project/pull/142073 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-05-30 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: @fanju110 The PR caused some buildbot failures, so I have [reverted](https://github.com/llvm/llvm-project/commit/597340b5b666bdee2887f56c111407b6737cbf34) it. You can see the error [here](https://lab.llvm.org/buildbot/#/builders/203/builds/12089/steps/7/logs/stdio). htt

[clang] [flang] [flang][driver] Introduce FCC_OVERRIDE_OPTIONS. (PR #140556)

2025-05-30 Thread Tarun Prabhu via cfe-commits
@@ -0,0 +1,17 @@ +! RUN: env FCC_OVERRIDE_OPTIONS="#+-Os +-Oz +-O +-O3 +-Oignore +a +b +c xb Xa Omagic ^-### " %flang -target x86_64-unknown-linux-gnu %s -O2 b -O3 2>&1 | FileCheck %s tarunprabhu wrote: Should this also be `--target`? ```suggestion ! RUN: env

[clang] [flang] [llvm] Revert "Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler" (PR #142159)

2025-05-30 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu closed https://github.com/llvm/llvm-project/pull/142159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-05-30 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu closed https://github.com/llvm/llvm-project/pull/136098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [mlir] [flang] Add support for -mprefer-vector-width= (PR #142073)

2025-05-30 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/142073 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][driver] Introduce FCC_OVERRIDE_OPTIONS. (PR #140556)

2025-05-29 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu commented: Thanks for the changes, Abid. Regarding my suggestions in the documentation, feel free to incorporate or discard them as you see fit. I'll leave it you and @kiranchandramohan to decide what the name of the environment variable should be. Other than

[clang] [flang] [flang][driver] Introduce FCC_OVERRIDE_OPTIONS. (PR #140556)

2025-05-29 Thread Tarun Prabhu via cfe-commits
@@ -614,3 +614,30 @@ nvfortran defines `-fast` as - `-Mcache_align`: there is no equivalent flag in Flang or Clang. - `-Mflushz`: flush-to-zero mode - when `-ffast-math` is specified, Flang will link to `crtfastmath.o` to ensure denormal numbers are flushed to zero. + + +#

[clang] [flang] [flang][driver] Introduce FCC_OVERRIDE_OPTIONS. (PR #140556)

2025-05-29 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu edited https://github.com/llvm/llvm-project/pull/140556 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [mlir] [flang] Add support for -mprefer-vector-width= (PR #141380)

2025-05-29 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: > > Seems ok now: "Changes can be cleanly merged." > > If it's still not available, I may have messed something up on my side. > > I'll review the GitHub docs to see if I missed something... > > It's probably fine, but I'd like to give the buildkites a chance to finish > bef

[clang] [flang] [mlir] [flang] Add support for -mprefer-vector-width= (PR #141380)

2025-05-29 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: > Seems ok now: "Changes can be cleanly merged." > > If it's still not available, I may have messed something up on my side. I'll > review the GitHub docs to see if I missed something... It's probably fine, but I'd like to give the buildkites a chance to finish before I mer

[clang] [flang] [mlir] [flang] Add support for -mprefer-vector-width= (PR #141380)

2025-05-29 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: > @tarunprabhu Would you mind mashing the "Merge" button? It looks like getting > commit access approval is taking longer than expected. You may need to rebase before I can merge. https://github.com/llvm/llvm-project/pull/141380 __

[clang] [flang] [mlir] [flang] Add support for -mprefer-vector-width= (PR #141380)

2025-05-29 Thread Tarun Prabhu via cfe-commits
@@ -126,6 +127,8 @@ struct MLIRToLLVMPassPipelineConfig : public FlangEPCallBacks { bool NoSignedZerosFPMath = false; ///< Set no-signed-zeros-fp-math attribute for functions. bool UnsafeFPMath = false; ///< Set unsafe-fp-math attribute for functions. + std::string

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-05-29 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: > > @fanju110, Thanks for seeing this through! > > Hi @tarunprabhu , If everything looks good, could you please merge this PR at > your convenience (I don't have merge rights)? Thank you! It looks like you need to run `clang-format` on some of the code. See [here](https://g

[clang] [flang] [flang][driver] Introduce FCC_OVERRIDE_OPTIONS. (PR #140556)

2025-05-29 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: > > Does `CCC_OVERRIDE_OPTIONS` expands to Clang Compiler Commandline Override > > Options? If so `FCC_OVERRIDE_OPTIONS` expanding to Fortran Compiler > > Commandline Override Options seems the right replacement. > > If `CCC_OVERRIDE_OPTIONS` expands to Clang C Compiler Overr

[clang] [flang] [flang][driver] Introduce FCC_OVERRIDE_OPTIONS. (PR #140556)

2025-05-29 Thread Tarun Prabhu via cfe-commits
@@ -0,0 +1,12 @@ +! RUN: env FCC_OVERRIDE_OPTIONS="#+-Os +-Oz +-O +-O3 +-Oignore +a +b +c xb Xa Omagic ^-### " %flang -target x86_64-unknown-linux-gnu %s -O2 b -O3 2>&1 | FileCheck %s tarunprabhu wrote: We may also want to have a test for the interaction of th

[clang] [flang] [flang][driver] Introduce FCC_OVERRIDE_OPTIONS. (PR #140556)

2025-05-29 Thread Tarun Prabhu via cfe-commits
@@ -614,3 +614,28 @@ nvfortran defines `-fast` as - `-Mcache_align`: there is no equivalent flag in Flang or Clang. - `-Mflushz`: flush-to-zero mode - when `-ffast-math` is specified, Flang will link to `crtfastmath.o` to ensure denormal numbers are flushed to zero. + + +#

[clang] [flang] [mlir] [flang] Add support for -mprefer-vector-width= (PR #141380)

2025-05-28 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. Thanks for the all the changes. LGTM. https://github.com/llvm/llvm-project/pull/141380 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [flang] [mlir] [flang] Add support for -mprefer-vector-width= (PR #141380)

2025-05-28 Thread Tarun Prabhu via cfe-commits
@@ -0,0 +1,9 @@ +; RUN: mlir-translate -import-llvm -split-input-file %s | FileCheck %s + +; CHECK-LABEL: llvm.func @prefer_vector_width() +; CHECK: prefer_vector_width = "128" tarunprabhu wrote: Thanks for the update and clarification. https://github.com/llvm/l

[clang] [clang] Move opt level in clang toolchain to clang::ConstructJob start (PR #141036)

2025-05-28 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu closed https://github.com/llvm/llvm-project/pull/141036 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-05-28 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. @fanju110, Thanks for seeing this through! https://github.com/llvm/llvm-project/pull/136098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [flang] [mlir] [flang] Add support for -mprefer-vector-width= (PR #141380)

2025-05-28 Thread Tarun Prabhu via cfe-commits
@@ -0,0 +1,9 @@ +; RUN: mlir-translate -import-llvm -split-input-file %s | FileCheck %s + +; CHECK-LABEL: llvm.func @prefer_vector_width() +; CHECK: prefer_vector_width = "128" tarunprabhu wrote: Oh, does `CHECK-LABEL` allow one to continue checking on the same l

[clang] [flang] [mlir] [flang] Add support for -mprefer-vector-width= (PR #141380)

2025-05-28 Thread Tarun Prabhu via cfe-commits
@@ -0,0 +1,9 @@ +; RUN: mlir-translate -import-llvm -split-input-file %s | FileCheck %s + +; CHECK-LABEL: llvm.func @prefer_vector_width() +; CHECK: prefer_vector_width = "128" tarunprabhu wrote: Should this be `CHECK-SAME`? I assume that you intend to match `pr

[clang] [clang] Move opt level in clang toolchain to clang::ConstructJob start (PR #141036)

2025-05-27 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. Thanks. Any cleanup of this code is helpful. https://github.com/llvm/llvm-project/pull/141036 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] [flang] [mlir] [flang] Add support for -mprefer-vector-width= (PR #141380)

2025-05-26 Thread Tarun Prabhu via cfe-commits
@@ -309,6 +309,20 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts, for (auto *a : args.filtered(clang::driver::options::OPT_fpass_plugin_EQ)) opts.LLVMPassPlugins.push_back(a->getValue()); + // -mprefer_vector_width option + if (const llvm::opt

[clang] [flang] [mlir] [flang] Add support for -mprefer-vector-width= (PR #141380)

2025-05-26 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu edited https://github.com/llvm/llvm-project/pull/141380 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [mlir] [flang] Add support for -mprefer-vector-width= (PR #141380)

2025-05-26 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu requested changes to this pull request. Thanks for this. I second @jeanPerier's request for an MLIR test https://github.com/llvm/llvm-project/pull/141380 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang] [flang] [flang] add -floop-interchange and enable it with opt levels (PR #140182)

2025-05-20 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. LGTM. Thanks! https://github.com/llvm/llvm-project/pull/140182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [Clang][Flang][Driver] Fix target parsing for -fveclib=AMDLIBM option (PR #140544)

2025-05-19 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: Is this doing a lot that is similar to #140533? https://github.com/llvm/llvm-project/pull/140544 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang][driver] Introduce FCC_OVERRIDE_OPTIONS. (PR #140556)

2025-05-19 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: > The `FCC_OVERRIDE_OPTIONS` seemed like the most obvious name to me but I am > open to other ideas. Thanks Abid. Perhaps `FFC_OVERRIDE_OPTIONS`? It has a similar correspondence to `CCC_OVERRIDE_OPTIONS` as `FCFLAGS` does to `CCFLAGS`. But I don't have a strong opinion on

[clang] [flang] [flang][veclib] Adding AMDLIBM target to fveclib (PR #140533)

2025-05-19 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. LGTM. Thanks. https://github.com/llvm/llvm-project/pull/140533 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] add -floop-interchange and enable it with opt levels (PR #140182)

2025-05-16 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu edited https://github.com/llvm/llvm-project/pull/140182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] add -floop-interchange and enable it with opt levels (PR #140182)

2025-05-16 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu commented: Could you add a test that ensures that the loop-interchange pass is added to the pipeline. Perhaps something like [flang/test/Driver/slp-vectorize.f90](https://github.com/llvm/llvm-project/blob/04fde85057cb4da2e560da629df7a52702eac489/flang/test/Driver/

[clang] [flang] [flang] add -floop-interchange and enable it with opt levels (PR #140182)

2025-05-16 Thread Tarun Prabhu via cfe-commits
@@ -421,7 +421,8 @@ static void CheckSubscripts( static void CheckSubscripts( semantics::SemanticsContext &context, CoarrayRef &ref) { - const Symbol &coarraySymbol{ref.GetBase().GetLastSymbol()}; + const auto &base = ref.GetBase(); + const Symbol &coarraySymbol{base.Ge

[clang] [flang] [Flang][Sanitizer] Support sanitizer flag for Flang Driver. (PR #137759)

2025-05-15 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu requested changes to this pull request. Thanks. We should try to share code between `clang` and `flang` where appropriate. https://github.com/llvm/llvm-project/pull/137759 ___ cfe-commits mailing list cfe-commits@lists.l

[clang] [flang] [Flang][Sanitizer] Support sanitizer flag for Flang Driver. (PR #137759)

2025-05-15 Thread Tarun Prabhu via cfe-commits
@@ -11,17 +11,46 @@ //===--===// #include "flang/Frontend/CodeGenOptions.h" +#include "llvm/TargetParser/Triple.h" #include #include namespace Fortran::frontend { +using namespace llvm; + CodeGenOpt

[clang] [flang] [Flang][Sanitizer] Support sanitizer flag for Flang Driver. (PR #137759)

2025-05-15 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu edited https://github.com/llvm/llvm-project/pull/137759 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [Flang][Sanitizer] Support sanitizer flag for Flang Driver. (PR #137759)

2025-05-15 Thread Tarun Prabhu via cfe-commits
@@ -11,17 +11,46 @@ //===--===// #include "flang/Frontend/CodeGenOptions.h" +#include "llvm/TargetParser/Triple.h" #include #include namespace Fortran::frontend { +using namespace llvm; -

[clang] [flang] [Flang][Sanitizer] Support sanitizer flag for Flang Driver. (PR #137759)

2025-05-15 Thread Tarun Prabhu via cfe-commits
@@ -787,6 +792,11 @@ void CodeGenAction::generateLLVMIR() { return; } + for (llvm::Function &F : llvmModule->getFunctionList()) { tarunprabhu wrote: We use slightly different coding conventions in flang. In particular, we use camel-casing in most plac

[clang] [flang] [flang][driver] Separate the actions of the `-emit-fir` and `-emit-mlir` options (PR #139857)

2025-05-15 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: > I think the appropriate core MLIR dialects are those that most closely > reflect the original FIR representation. Do you have any suggestions on how > to approach this? I am not exactly clear on what sort of suggestions you are looking for. I haven't thought a lot about t

[clang] [flang] [flang][driver] Separate the actions of the `-emit-fir` and `-emit-mlir` options (PR #139857)

2025-05-14 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: > A new parent class for code-gen frontend actions is > introduced:`CodeGenAction`. Should this instead be a "A new code-gen action class is introduced: `EmitMLIRAction`?" That seems to be the only new class that has been introduced and it is not (yet, at least) a parent fo

[clang] [flang] [flang][driver] Separate the actions of the `-emit-fir` and `-emit-mlir` options (PR #139857)

2025-05-14 Thread Tarun Prabhu via cfe-commits
@@ -635,6 +635,49 @@ void CodeGenAction::lowerHLFIRToFIR() { } } +void CodeGenAction::lowerFIRToMLIR() { + assert(mlirModule && "The MLIR module has not been generated yet."); + + CompilerInstance &ci = this->getInstance(); + CompilerInvocation &invoc = ci.getInvocation()

[clang] [flang] [flang][driver] Separate the actions of the `-emit-fir` and `-emit-mlir` options (PR #139857)

2025-05-14 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu commented: I tend to prefer @jeanPerier's suggestion of having the option name reflect that only the LLVM dialect is being used. In the future, do you intend to provide a way to choose the set of dialects to use? In that case, we could consider something a bit m

[clang] [flang] [flang][driver] Separate the actions of the `-emit-fir` and `-emit-mlir` options (PR #139857)

2025-05-14 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu edited https://github.com/llvm/llvm-project/pull/139857 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-05-01 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu edited https://github.com/llvm/llvm-project/pull/136098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-05-01 Thread Tarun Prabhu via cfe-commits
@@ -8,8 +8,14 @@ #include "llvm/Frontend/Driver/CodeGenOptions.h" #include "llvm/Analysis/TargetLibraryInfo.h" +#include "llvm/ProfileData/InstrProfCorrelator.h" #include "llvm/TargetParser/Triple.h" +namespace llvm { +extern llvm::cl::opt DebugInfoCorrelate; +extern llvm::

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-05-01 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu commented: Thank you for seeing this through and making all the little changes. I have requested reviews from @MaskRay and @aeubanks for the clang side of things. https://github.com/llvm/llvm-project/pull/136098 ___ cfe

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-05-01 Thread Tarun Prabhu via cfe-commits
@@ -33,9 +35,18 @@ enum class VectorLibrary { AMDLIBM // AMD vector math library. }; +enum ProfileInstrKind { + ProfileNone, // Profile instrumentation is turned off. + ProfileClangInstr, // Clang instrumentation to generate execution counts +

[clang] [flang] [llvm] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-04-30 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu commented: Thanks for making all the changes. Just a few minor comments. https://github.com/llvm/llvm-project/pull/136098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

  1   2   3   4   >