[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

[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
@@ -0,0 +1,39 @@ +! Tests for -fprofile-generate and -fprofile-use flag compatibility. These two +! flags behave similarly to their GCC counterparts: +! +! -fprofile-generate Generates the profile file ./default.profraw +! -fprofile-use=/file Uses the profile file /file

[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
@@ -36,6 +37,15 @@ enum class VectorLibrary { TargetLibraryInfoImpl *createTLII(const llvm::Triple &TargetTriple, VectorLibrary Veclib); +enum ProfileInstrKind { tarunprabhu wrote: Nit: It may be better to move this above the

[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
@@ -13,6 +13,7 @@ #ifndef LLVM_FRONTEND_DRIVER_CODEGENOPTIONS_H #define LLVM_FRONTEND_DRIVER_CODEGENOPTIONS_H +#include tarunprabhu wrote: An empty line should separate the last include and the namespace below https://github.com/llvm/llvm-project/pull/13609

[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
@@ -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-04-30 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] [flang][flang-driver] Support flag -finstrument-functions (PR #137996)

2025-04-30 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. Other than the nit about the documentation text, LGTM. Thanks for the changes. https://github.com/llvm/llvm-project/pull/137996 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [flang] [flang][flang-driver] Support flag -finstrument-functions (PR #137996)

2025-04-30 Thread Tarun Prabhu via cfe-commits
@@ -81,6 +81,9 @@ class CodeGenOptions : public CodeGenOptionsBase { /// Options to add to the linker for the object file std::vector DependentLibs; + /// Indicates whether -finstrument-functions option is passed tarunprabhu wrote: nit ```suggestion /

[clang] [flang] [flang][flang-driver] Support flag -finstrument-functions (PR #137996)

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

[clang] [flang] [flang][flang-driver] Support flag -finstrument-functions (PR #137996)

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

[clang] [flang] [flang][flang-driver] Support flag -finstrument-functions (PR #137996)

2025-04-30 Thread Tarun Prabhu via cfe-commits
@@ -81,6 +81,8 @@ class CodeGenOptions : public CodeGenOptionsBase { /// Options to add to the linker for the object file std::vector DependentLibs; + bool InstrumentFunctions{false}; tarunprabhu wrote: I missed this in the first round. A documentation c

[clang] [flang] [flang][flang-driver] Support flag -finstrument-functions (PR #137996)

2025-04-30 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu commented: Thanks for the changes. Other than the documentation comment this looks good. https://github.com/llvm/llvm-project/pull/137996 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [flang] [flang][flang-driver] Support flag -finstrument-functions (PR #137996)

2025-04-30 Thread Tarun Prabhu via cfe-commits
@@ -310,6 +310,10 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts, args.filtered(clang::driver::options::OPT_fembed_offload_object_EQ)) opts.OffloadObjects.push_back(a->getValue()); + if (args.hasFlag(clang::driver::options::OPT_finstrument

[clang] [flang] [flang][flang-driver] Support flag -finstrument-functions (PR #137996)

2025-04-30 Thread Tarun Prabhu via cfe-commits
@@ -124,6 +128,8 @@ struct MLIRToLLVMPassPipelineConfig : public FlangEPCallBacks { bool UnsafeFPMath = false; ///< Set unsafe-fp-math attribute for functions. bool NSWOnLoopVarInc = true; ///< Add nsw flag to loop variable increments. bool EnableOpenMP = false; ///< Ena

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

2025-04-28 Thread Tarun Prabhu via cfe-commits
@@ -20,8 +20,13 @@ #include "mlir/IR/OwningOpRef.h" #include "llvm/ADT/StringRef.h" #include "llvm/IR/Module.h" +#include "llvm/Support/CommandLine.h" +#include "llvm/Support/PGOOptions.h" #include +namespace llvm { +extern cl::opt ClPGOColdFuncAttr; tarunp

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

2025-04-28 Thread Tarun Prabhu via cfe-commits
@@ -13,9 +13,14 @@ #ifndef LLVM_FRONTEND_DRIVER_CODEGENOPTIONS_H #define LLVM_FRONTEND_DRIVER_CODEGENOPTIONS_H +#include "llvm/ProfileData/InstrProfCorrelator.h" +#include namespace llvm { class Triple; class TargetLibraryInfoImpl; +extern llvm::cl::opt DebugInfoCorrelate;

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

2025-04-28 Thread Tarun Prabhu via cfe-commits
@@ -19,6 +21,7 @@ template class Expected; template class IntrusiveRefCntPtr; class Module; class MemoryBufferRef; +extern cl::opt ClPGOColdFuncAttr; tarunprabhu wrote: Since this is an experimental option that will likely be removed and is only to be used

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

2025-04-28 Thread Tarun Prabhu via cfe-commits
@@ -28,6 +28,7 @@ #include "flang/Semantics/unparse-with-symbols.h" #include "flang/Support/default-kinds.h" #include "flang/Tools/CrossToolHelpers.h" +#include "clang/CodeGen/BackendUtil.h" tarunprabhu wrote: We should not include clang headers unless necessa

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

2025-04-28 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu requested changes to this pull request. Thanks for the updating the PR. There seems to be a [buildkite failure](https://buildkite.com/llvm-project/github-pull-requests/builds/173137#01967cab-3f69-4ec6-8175-49795d1a2819). These failures are often worth checking b

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

2025-04-28 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] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-04-25 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: If I understand what you are saying correctly, this would involve, for example, duplicating the definition of `enum ProfileInstrKind` in `flang` in this PR, then a second PR that moves it from both `flang` and `clang` to `llvm/Frontend`. This is churn that can be distracting

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

2025-04-24 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: There is precedent for changing the clang source in order to share code or to augment it for use with flang. For what needs to be done here, I think it should be fine. We will have to request reviews from the clang developers as well. https://github.com/llvm/llvm-project/pu

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

2025-04-22 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] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-04-22 Thread Tarun Prabhu via cfe-commits
@@ -130,6 +133,20 @@ static bool saveMLIRTempFile(const CompilerInvocation &ci, // Custom BeginSourceFileAction //===--===// + +static llvm::cl::opt ClPGOColdFuncAttr( tarunprabhu wrote: Thi

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

2025-04-22 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu commented: Thanks for working on this. 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] Add IR Profile-Guided Optimization (IR PGO) support to the Flang compiler (PR #136098)

2025-04-22 Thread Tarun Prabhu via cfe-commits
@@ -0,0 +1,14 @@ +# IR level Instrumentation Flag +:ir +:entry_first +_QQmain +# Func Hash: +146835646621254984 +# Num Counters: +2 +# Counter Values: +100 +1 + tarunprabhu wrote: Are the trailing newlines here necessary? https://github.com/llvm/llvm-project/pul

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

2025-04-22 Thread Tarun Prabhu via cfe-commits
@@ -892,6 +909,20 @@ static void generateMachineCodeOrAssemblyImpl(clang::DiagnosticsEngine &diags, delete tlii; } + +// Default filename used for profile generation. +namespace llvm { + extern llvm::cl::opt DebugInfoCorrelate; + extern llvm::cl::opt ProfileCorrelate; +

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

2025-04-22 Thread Tarun Prabhu via cfe-commits
@@ -148,6 +148,55 @@ class CodeGenOptions : public CodeGenOptionsBase { /// OpenMP is enabled. using DoConcurrentMappingKind = flangomp::DoConcurrentMappingKind; + enum ProfileInstrKind { tarunprabhu wrote: Can this enum be shared between `clang` and `fl

[clang] [flang] Enable `-m32`, `-maix32` and `-maix64` for Flang on AIX. (PR #136202)

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

[clang] [flang] Enable `-m32`, `-maix32` and `-maix64` for Flang on AIX. (PR #136202)

2025-04-17 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. Other than the missing braces around the `if`, LGTM. Thanks. https://github.com/llvm/llvm-project/pull/136202 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [flang] Enable `-m32`, `-maix32` and `-maix64` for Flang on AIX. (PR #136202)

2025-04-17 Thread Tarun Prabhu via cfe-commits
@@ -733,11 +733,16 @@ static llvm::Triple computeTargetTriple(const Driver &D, Target.setEnvironment(llvm::Triple::GNUX32); } else if (A->getOption().matches(options::OPT_m32) || A->getOption().matches(options::OPT_maix32)) { - AT = Target.get32B

[clang] [flang] [driver] Generalize the code that adds the path of libflang_rt.runtime.a. (PR #134362)

2025-04-10 Thread Tarun Prabhu via cfe-commits
@@ -6880,6 +6880,13 @@ let Flags = [TargetSpecific] in { defm android_pad_segment : BooleanFFlag<"android-pad-segment">, Group; } // let Flags = [TargetSpecific] +def shared_libflangrt : Flag<["-"], "shared-libflangrt">, + HelpText<"Dynamically link the shared flang-rt">, Gro

[clang] [flang] [driver] Generalize the code that adds the path of libflang_rt.runtime.a. (PR #134362)

2025-04-08 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. Thanks Daniel. I don't think a separate PR is necessary for the changes, but perhaps wait to see if @MaskRay has a different opinion https://github.com/llvm/llvm-project/pull/134362 ___ cfe-co

[clang] [flang] [driver] Generalize the code that adds the path of libflang_rt.runtime.a. (PR #134362)

2025-04-08 Thread Tarun Prabhu via cfe-commits
@@ -6880,6 +6880,13 @@ let Flags = [TargetSpecific] in { defm android_pad_segment : BooleanFFlag<"android-pad-segment">, Group; } // let Flags = [TargetSpecific] +def shared_libflangrt : Flag<["-"], "shared-libflangrt">, + HelpText<"Dynamically link the shared flang-rt">, Gro

[clang] [flang] [driver] Generalize the code that adds the path of libflang_rt.runtime.a. (PR #134362)

2025-04-08 Thread Tarun Prabhu via cfe-commits
@@ -746,7 +746,8 @@ std::string ToolChain::buildCompilerRTBasename(const llvm::opt::ArgList &Args, case ToolChain::FT_Shared: Suffix = TT.isOSWindows() ? (TT.isWindowsGNUEnvironment() ? ".dll.a" : ".lib") - : ".so"; + : TT.isO

[clang] [flang] [flang] Added driver options for arrays repacking. (PR #134002)

2025-04-04 Thread Tarun Prabhu via cfe-commits
@@ -0,0 +1,27 @@ +! Test forwarding just the forwarding of -frepack-arrays-contiguity options: +! RUN: %flang -frepack-arrays-contiguity=whole %s -### -fsyntax-only 2>&1 | FileCheck --check-prefix=WHOLECMD %s +! RUN: %flang -frepack-arrays-contiguity=innermost %s -### -fsyntax-on

[clang] [flang] [driver] Generalize the code that adds the path of libflang_rt.runtime.a. (PR #134362)

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

[clang] [flang] [Flang][OpenMP][Driver][AMDGPU] Fix -mcode-object-version (PR #134230)

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

[clang] [flang] [flang] Added driver options for arrays repacking. (PR #134002)

2025-04-02 Thread Tarun Prabhu via cfe-commits
@@ -0,0 +1,27 @@ +! Test forwarding just the forwarding of -frepack-arrays-contiguity options: tarunprabhu wrote: ```suggestion ! Test forwarding of -frepack-arrays-contiguity options: ``` https://github.com/llvm/llvm-project/pull/134002

[clang] [flang] [flang] Added driver options for arrays repacking. (PR #134002)

2025-04-02 Thread Tarun Prabhu via cfe-commits
@@ -0,0 +1,24 @@ +! Test forwarding just the forwarding of -f[no-]repack-arrays options: tarunprabhu wrote: ```suggestion ! Test forwarding of -f[no-]repack-arrays options: ``` https://github.com/llvm/llvm-project/pull/134002

[clang] [flang] [flang] Complete alignment of -x language modes with gfortran (PR #133775)

2025-04-02 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. Thanks for the changes, David. :-) https://github.com/llvm/llvm-project/pull/133775 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [flang] [flang] Added driver options for arrays repacking. (PR #134002)

2025-04-02 Thread Tarun Prabhu via cfe-commits
@@ -0,0 +1,24 @@ +! Test forwarding just the forwarding of -f[no-]stack-repack-arrays options: tarunprabhu wrote: ```suggestion ! Test forwarding of -f[no-]stack-repack-arrays options: ``` https://github.com/llvm/llvm-project/pull/134002

[clang] [flang] [flang] Added driver options for arrays repacking. (PR #134002)

2025-04-02 Thread Tarun Prabhu via cfe-commits
@@ -6974,6 +7019,22 @@ defm loop_versioning : BoolOptionWithoutMarshalling<"f", "version-loops-for-stri PosFlag, NegFlag>; +defm stack_repack_arrays +: BoolOptionWithoutMarshalling< + "f", "stack-repack-arrays", + PosFlag, + NegFlag< +

[clang] [flang] [flang] Complete alignment of -x language modes with gfortran (PR #133775)

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

[clang] [flang] [flang] Complete alignment of -x language modes with gfortran (PR #133775)

2025-03-31 Thread Tarun Prabhu via cfe-commits
@@ -88,8 +88,8 @@ TYPE("assembler-with-cpp", Asm, PP_Asm, "S", phases // modules when Flang needs to emit pre-processed files. Therefore, the // `PP_TYPE` is set to `PP_Fortran` so that the driver is fine with // "pre-processing a pre-processed fil

[clang] [flang] [flang] Complete alignment of -x language modes with gfortran (PR #133775)

2025-03-31 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu commented: Other than the nit, this looks ok. However, I must admit that I don't fully understand the nuances of the various modes, and I got a bit lost with the previous PR as well, so I'll leave it to someone else to approve as they see fit. https://github.com

[clang] [flang] [flang][OpenMP] Bump default OpenMP version to 3.1 (PR #133745)

2025-03-31 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. Thanks Tom. This looks fine to me, but please wait for those more familiar with OpenMP before merging. https://github.com/llvm/llvm-project/pull/133745 ___ cfe-commits mailing list cfe-commits

[clang] [flang] [flang] Expose -m32 and -m64 options (PR #132409)

2025-03-26 Thread Tarun Prabhu via cfe-commits
@@ -0,0 +1,4 @@ +! Check support of -m64. +! RUN: %flang -target i386-pc-win32 -m64 -### - %s 2>&1 | FileCheck -check-prefix=M64 %s + +! M64: "-triple" "{{[^-]+}}64-{{.*}}" tarunprabhu wrote: If the `-target` is given as `i386-*`, this should always return `x86_

[clang] [flang] [flang] Expose -m32 and -m64 options (PR #132409)

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

[clang] [flang] [flang] Add -f[no-]slp-vectorize flags (PR #132801)

2025-03-26 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: Is this buildbot failure related: [https://lab.llvm.org/buildbot/#/builders/89/builds/19482](https://lab.llvm.org/buildbot/#/builders/89/builds/19482)? https://github.com/llvm/llvm-project/pull/132801 ___ cfe-commits mailing list cf

[clang] [flang] [flang] Add -f[no-]slp-vectorize flags (PR #132801)

2025-03-25 Thread Tarun Prabhu via cfe-commits
@@ -3177,3 +3177,25 @@ bool tools::shouldEnableVectorizerAtOLevel(const ArgList &Args, bool isSlpVec) { return false; } + +/// Enable -fvectorize based on the optimization level selected. tarunprabhu wrote: It might be better to move the docstrings to `Com

[clang] [flang] [flang] Add -f[no-]slp-vectorize flags (PR #132801)

2025-03-25 Thread Tarun Prabhu via cfe-commits
@@ -3177,3 +3177,25 @@ bool tools::shouldEnableVectorizerAtOLevel(const ArgList &Args, bool isSlpVec) { return false; } + +/// Enable -fvectorize based on the optimization level selected. +void tools::handleVectorizeLoopsArgs(const ArgList &Args, +

[clang] [flang] [flang] Add -f[no-]slp-vectorize flags (PR #132801)

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

[clang] [flang] [flang] Add -f[no-]slp-vectorize flags (PR #132801)

2025-03-25 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. Apart from the docstrings, this looks good. Thanks for the changes :-) https://github.com/llvm/llvm-project/pull/132801 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [flang] [flang] Add -f[no-]slp-vectorize flags (PR #132801)

2025-03-25 Thread Tarun Prabhu via cfe-commits
@@ -3177,3 +3177,25 @@ bool tools::shouldEnableVectorizerAtOLevel(const ArgList &Args, bool isSlpVec) { return false; } + +/// Enable -fvectorize based on the optimization level selected. +void tools::handleVectorizeLoopsArgs(const ArgList &Args, +

[clang] [flang] [flang] Add -f[no-]slp-vectorize flags (PR #132801)

2025-03-24 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: > cc @tblah @DavidTruby If you are soliciting reviews, you could also use the "Reviewers" box on the top right of this page https://github.com/llvm/llvm-project/pull/132801 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[clang] [flang] [flang] Add -f[no-]slp-vectorize flags (PR #132801)

2025-03-24 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: > > If you are soliciting reviews, you could also use the "Reviewers" box on > > the top right of this page > > I would, but I do not currently have the right permissions to use the box. > Hence the ccs - I need someone else to do it. Huh. I didn't realize that one needed s

[clang] [flang] [flang] Add -f[no-]slp-vectorize flags (PR #132801)

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

[clang] [flang] [flang] Add -f[no-]slp-vectorize flags (PR #132801)

2025-03-24 Thread Tarun Prabhu via cfe-commits
@@ -4032,11 +4032,14 @@ def : Flag<["-"], "ftree-vectorize">, Alias; def : Flag<["-"], "fno-tree-vectorize">, Alias; } +let Visibility = [ClangOption, FlangOption] in { tarunprabhu wrote: I think we should merge this with the visibility block for `fvectorize`

[clang] [flang] [flang] Add -f[no-]slp-vectorize flags (PR #132801)

2025-03-24 Thread Tarun Prabhu via cfe-commits
@@ -161,6 +161,14 @@ void Flang::addCodegenOptions(const ArgList &Args, options::OPT_fno_vectorize, enableVec)) CmdArgs.push_back("-vectorize-loops"); + // -fslp-vectorize is enabled based on the optimization level selected. + bool EnableSLPVec = shoul

[clang] [flang] [flang] Add -f[no-]slp-vectorize flags (PR #132801)

2025-03-24 Thread Tarun Prabhu via cfe-commits
@@ -0,0 +1,10 @@ +! RUN: %flang -### -S -fslp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-SLP-VECTORIZE %s +! RUN: %flang -### -S -fno-slp-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-SLP-VECTORIZE %s +! RUN: %flang -### -S -O1 %s 2>&1 | FileCheck -check-prefix=CH

[clang] [flang] [flang] Add support for -f[no-]verbose-asm (PR #130788)

2025-03-13 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. Thanks for all the changes, Tom! LGTM. https://github.com/llvm/llvm-project/pull/130788 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [flang] [flang] Add support for -f[no-]verbose-asm (PR #130788)

2025-03-12 Thread Tarun Prabhu via cfe-commits
@@ -172,7 +172,8 @@ void Flang::addCodegenOptions(const ArgList &Args, options::OPT_finit_global_zero, options::OPT_fno_init_global_zero, options::OPT_ftime_report, options::OPT_ftime_report_EQ, options::OPT_funroll_loop

[clang] [flang] [flang] Add support for -f[no-]verbose-asm (PR #130788)

2025-03-12 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu commented: Do we really want to maintain an equivalence with clang by keeping this in `CodeGenOptions` when it really ought to be a `TargetOption`? It looks like almost all of the handling of this option takes place in `flang`, so we probably shouldn't be bound t

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-12 Thread Tarun Prabhu via cfe-commits
=?utf-8?q?I=C3=B1aki?= Amatria Barral Message-ID: In-Reply-To: https://github.com/tarunprabhu approved this pull request. Thanks for all the changes :-) https://github.com/llvm/llvm-project/pull/130268 ___ cfe-commits mailing list cfe-commits@lists.

[clang] [flang] [flang/clang] Adding use of Clang's diagnostics in Flang (PR #130593)

2025-03-11 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: For compiler options, we have various "categories" in `Options.td`, `ClangOptions`, `FlangOptions` etc. which only apply to specific frontends. I haven't looked very closely at this, but I believe that there is only one "category" for warnings. Is this correct? If that the c

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-07 Thread Tarun Prabhu via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: @@ -0,0 +1,35 @@ +program main + print *, __FILE__, __LINE__ +end + +! This test verifies that `flang`'s `-x` options behave like `gfortran`'s. +! Specifically: +! - `-x f95` should process the file based on its extensi

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-07 Thread Tarun Prabhu via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: https://github.com/tarunprabhu edited https://github.com/llvm/llvm-project/pull/130268 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [flang] [flang] Add options -W[no-]unused-dummy-argument and -W[no-]unused-variable (PR #127214)

2025-03-07 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: Thanks for working on this @JDPailleux. This looks like a substantial change including to parts of clang. Is it possible to split this into two. One PR for just the "infrastructure" and another for the flang-specifc warnings. This would make it easier to focus the discussi

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-07 Thread Tarun Prabhu via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: @@ -0,0 +1,12 @@ +! This test verifies that using `-x f95` does not cause the driver to assume +! this file is in fixed-form. + +program main + print *, "Hello, World!" +end + +! RUN: %flang -### -x f95 %s 2>&1 | FileCh

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-07 Thread Tarun Prabhu via cfe-commits
=?utf-8?q?I=C3=B1aki?= Amatria Barral Message-ID: In-Reply-To: https://github.com/tarunprabhu commented: Thanks for continuing to see this through https://github.com/llvm/llvm-project/pull/130268 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang] [flang] [flang] Align `-x` language modes with `gfortran` (PR #130268)

2025-03-07 Thread Tarun Prabhu via cfe-commits
=?utf-8?q?Iñaki?= Amatria Barral Message-ID: In-Reply-To: @@ -0,0 +1,35 @@ +program main + print *, __FILE__, __LINE__ +end + +! This test verifies that `flang`'s `-x` options behave like `gfortran`'s. +! Specifically: +! - `-x f95` should process the file based on its extensi

[clang] [flang] [flang][Driver] Add support of -fd-lines-as-comments and -fd-lines-as-code flags (PR #127605)

2025-02-24 Thread Tarun Prabhu via cfe-commits
https://github.com/tarunprabhu approved this pull request. Thanks for seeing this through. https://github.com/llvm/llvm-project/pull/127605 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

[clang] [flang] [flang] Align `-x f95[-cpp-input]` language modes with `gfortran` (PR #127986)

2025-02-20 Thread Tarun Prabhu via cfe-commits
=?utf-8?q?I=C3=B1aki?= Amatria Barral Message-ID: In-Reply-To: tarunprabhu wrote: This looks ok to me, but please wait for others to approve. https://github.com/llvm/llvm-project/pull/127986 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[clang] [flang] [flang][Driver] Add support of -fd-lines-as-comments and -fd-lines-as-code flags (PR #127605)

2025-02-19 Thread Tarun Prabhu via cfe-commits
@@ -6747,8 +6747,16 @@ defm backtrace : BooleanFFlag<"backtrace">, Group; defm bounds_check : BooleanFFlag<"bounds-check">, Group; defm check_array_temporaries : BooleanFFlag<"check-array-temporaries">, Group; defm cray_pointer : BooleanFFlag<"cray-pointer">, Group; -defm d_l

[clang] [flang] [flang][Driver] Add support of -fd-lines-as-comments and -fd-lines-as-code flags (PR #127605)

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

[clang] [flang] [flang] Add -f[no-]vectorize flags (PR #119718)

2025-02-18 Thread Tarun Prabhu via cfe-commits
@@ -3986,11 +3986,15 @@ defm assumptions : BoolFOption<"assumptions", "Disable codegen and compile-time checks for C++23's [[assume]] attribute">, PosFlag>; + +let Visibility = [ClangOption, FlangOption] in { tarunprabhu wrote: > You'd hope that

[clang] [flang] [flang][OpenMP] Upstream first part of `do concurrent` mapping (PR #126026)

2025-02-18 Thread Tarun Prabhu via cfe-commits
tarunprabhu wrote: LGTM. Thanks. https://github.com/llvm/llvm-project/pull/126026 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Add -f[no-]vectorize flags (PR #119718)

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

  1   2   3   >