[clang] [flang] [llvm] [openmp] [Clang][OpenMP][LoopTransformations] Add support for "#pragma omp fuse" loop transformation directive and "looprange" clause (PR #139293)

2025-06-20 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/139293 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [openmp] [Clang][OpenMP][LoopTransformations] Add support for "#pragma omp fuse" loop transformation directive and "looprange" clause (PR #139293)

2025-06-20 Thread Michael Kruse via cfe-commits
@@ -14219,27 +14265,320 @@ bool SemaOpenMP::checkTransformableLoopNest( return false; }, [&OriginalInits](OMPLoopBasedDirective *Transform) { -Stmt *DependentPreInits; -if (auto *Dir = dyn_cast(Transform)) - DependentPreInits = Dir->

[clang] [flang] [llvm] [openmp] [Clang][OpenMP][LoopTransformations] Add support for "#pragma omp fuse" loop transformation directive and "looprange" clause (PR #139293)

2025-06-20 Thread Michael Kruse via cfe-commits
@@ -3256,9 +3256,8 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) { var, ConvertTypeForMem(VD->getType()), getContext().getDeclAlign(VD)); // No other cases for now. -} else { +} else llvm_unreachable("DeclRefExpr for Decl not

[clang] [flang] [llvm] [openmp] [Clang][OpenMP][LoopTransformations] Add support for "#pragma omp fuse" loop transformation directive and "looprange" clause (PR #139293)

2025-06-20 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur commented: Thanks for the work and sorry I could not have a look into it earlier https://github.com/llvm/llvm-project/pull/139293 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[clang] [flang] [llvm] [openmp] [Clang][OpenMP][LoopTransformations] Add support for "#pragma omp fuse" loop transformation directive and "looprange" clause (PR #139293)

2025-06-20 Thread Michael Kruse via cfe-commits
@@ -15499,6 +15836,496 @@ StmtResult SemaOpenMP::ActOnOpenMPInterchangeDirective( buildPreInits(Context, PreInits)); } +StmtResult SemaOpenMP::ActOnOpenMPFuseDirective(ArrayRef Clauses, +

[clang] [flang] [llvm] [openmp] [Clang][OpenMP][LoopTransformations] Add support for "#pragma omp fuse" loop transformation directive and "looprange" clause (PR #139293)

2025-06-20 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/139293 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [openmp] [Clang][OpenMP][LoopTransformations] Add support for "#pragma omp fuse" loop transformation directive and "looprange" clause (PR #139293)

2025-06-20 Thread Michael Kruse via cfe-commits
@@ -0,0 +1,211 @@ +// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -std=c++20 -fopenmp -fopenmp-version=60 -fsyntax-only -Wuninitialized -verify %s + +void func() { + +// expected-error@+2 {{statement after '#pragma omp fuse' must be a loop sequence containing canonical loops

[clang] [flang] [llvm] [openmp] [Clang][OpenMP][LoopTransformations] Add support for "#pragma omp fuse" loop transformation directive and "looprange" clause (PR #139293)

2025-06-20 Thread Michael Kruse via cfe-commits
@@ -11516,6 +11516,21 @@ def note_omp_implicit_dsa : Note< "implicitly determined as %0">; def err_omp_loop_var_dsa : Error< "loop iteration variable in the associated loop of 'omp %1' directive may not be %0, predetermined as %2">; +def warn_omp_different_loop_ind_var_typ

[clang] [flang] [llvm] [openmp] [Clang][OpenMP][LoopTransformations] Add support for "#pragma omp fuse" loop transformation directive and "looprange" clause (PR #139293)

2025-06-20 Thread Michael Kruse via cfe-commits
@@ -0,0 +1,50 @@ +// RUN: %libomp-compile-and-run | FileCheck %s --match-full-lines + +#ifndef HEADER +#define HEADER + +#include +#include + +int main() { + printf("do\n"); +#pragma omp fuse + { +for (int i = 5; i <= 25; i += 5) + printf("i=%d\n", i); +for (int

[clang] [flang] [llvm] [openmp] [Clang][OpenMP][LoopTransformations] Add support for "#pragma omp fuse" loop transformation directive and "looprange" clause (PR #139293)

2025-06-20 Thread Michael Kruse via cfe-commits
@@ -1479,7 +1492,109 @@ class SemaOpenMP : public SemaBase { bool checkTransformableLoopNest( OpenMPDirectiveKind Kind, Stmt *AStmt, int NumLoops, SmallVectorImpl &LoopHelpers, - Stmt *&Body, SmallVectorImpl> &OriginalInits); + Stmt *&Body, SmallVectorIm

[clang] [flang] [llvm] [openmp] [Clang][OpenMP][LoopTransformations] Add support for "#pragma omp fuse" loop transformation directive and "looprange" clause (PR #139293)

2025-06-20 Thread Michael Kruse via cfe-commits
@@ -15499,6 +15836,496 @@ StmtResult SemaOpenMP::ActOnOpenMPInterchangeDirective( buildPreInits(Context, PreInits)); } +StmtResult SemaOpenMP::ActOnOpenMPFuseDirective(ArrayRef Clauses, +

[clang] [flang] [llvm] [openmp] [Clang][OpenMP][LoopTransformations] Add support for "#pragma omp fuse" loop transformation directive and "looprange" clause (PR #139293)

2025-06-20 Thread Michael Kruse via cfe-commits
@@ -0,0 +1,400 @@ +// Check no warnings/errors +// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -std=c++20 -fopenmp-version=60 -fsyntax-only -verify %s +// expected-no-diagnostics + +// Check AST and unparsing +// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -std

[clang] [flang] [llvm] [openmp] [Clang][OpenMP][LoopTransformations] Add support for "#pragma omp fuse" loop transformation directive and "looprange" clause (PR #139293)

2025-06-20 Thread Michael Kruse via cfe-commits
@@ -11612,6 +11612,18 @@ def note_omp_implicit_dsa : Note< "implicitly determined as %0">; def err_omp_loop_var_dsa : Error< "loop iteration variable in the associated loop of 'omp %1' directive may not be %0, predetermined as %2">; +def err_omp_not_canonical_loop : Error

[clang] [flang] [llvm] [openmp] [Clang][OpenMP][LoopTransformations] Add support for "#pragma omp fuse" loop transformation directive and "looprange" clause (PR #139293)

2025-06-20 Thread Michael Kruse via cfe-commits
@@ -973,6 +976,9 @@ class OMPLoopTransformationDirective : public OMPLoopBasedDirective { /// Set the number of loops generated by this loop transformation. void setNumGeneratedLoops(unsigned Num) { NumGeneratedLoops = Num; } + /// Set the number of top level canonical l

[clang] [flang] [llvm] [openmp] [Clang][OpenMP][LoopTransformations] Add support for "#pragma omp fuse" loop transformation directive and "looprange" clause (PR #139293)

2025-06-20 Thread Michael Kruse via cfe-commits
@@ -22,6 +22,7 @@ #include "clang/AST/DeclOpenMP.h" #include "clang/AST/DynamicRecursiveASTVisitor.h" #include "clang/AST/OpenMPClause.h" +#include "clang/AST/RecursiveASTVisitor.h" Meinersbur wrote: [nit] unused https://github.com/llvm/llvm-project/pull/1392

[clang] [flang] [llvm] [openmp] [Clang][OpenMP][LoopTransformations] Add support for "#pragma omp fuse" loop transformation directive and "looprange" clause (PR #139293)

2025-06-20 Thread Michael Kruse via cfe-commits
@@ -14219,27 +14265,320 @@ bool SemaOpenMP::checkTransformableLoopNest( return false; }, [&OriginalInits](OMPLoopBasedDirective *Transform) { -Stmt *DependentPreInits; -if (auto *Dir = dyn_cast(Transform)) - DependentPreInits = Dir->

[clang] [flang] [llvm] [openmp] [Clang][OpenMP][LoopTransformations] Add support for "#pragma omp fuse" loop transformation directive and "looprange" clause (PR #139293)

2025-06-20 Thread Michael Kruse via cfe-commits
@@ -14189,10 +14196,49 @@ StmtResult SemaOpenMP::ActOnOpenMPTargetTeamsDistributeSimdDirective( getASTContext(), StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B); } +/// Overloaded base case function +template static bool tryHandleAs(T *t, F &&) { + return false;

[clang] [flang] [llvm] [openmp] [Clang][OpenMP][LoopTransformations] Add support for "#pragma omp fuse" loop transformation directive and "looprange" clause (PR #139293)

2025-06-20 Thread Michael Kruse via cfe-commits
@@ -15499,6 +15836,496 @@ StmtResult SemaOpenMP::ActOnOpenMPInterchangeDirective( buildPreInits(Context, PreInits)); } +StmtResult SemaOpenMP::ActOnOpenMPFuseDirective(ArrayRef Clauses, +

[clang] [flang] [llvm] [openmp] [Clang][OpenMP][LoopTransformations] Add support for "#pragma omp fuse" loop transformation directive and "looprange" clause (PR #139293)

2025-06-20 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur commented: Thanks for the work and sorry I could not have a look into it earlier https://github.com/llvm/llvm-project/pull/139293 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[clang] [Clang][OpenMP][LoopTransformations] Fix incorrect number of generated loops for Tile and Reverse directives (PR #140532)

2025-06-18 Thread Michael Kruse via cfe-commits
Meinersbur wrote: > Well yes but i don't have enough permissions to merge. I didn't know. Additional changes are find, I just merged it. Thanks for the patch. https://github.com/llvm/llvm-project/pull/140532 ___ cfe-commits mailing list cfe-commits@l

[clang] [Clang][OpenMP][LoopTransformations] Fix incorrect number of generated loops for Tile and Reverse directives (PR #140532)

2025-06-18 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur closed https://github.com/llvm/llvm-project/pull/140532 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][OpenMP][LoopTransformations] Fix incorrect number of generated loops for Tile and Reverse directives (PR #140532)

2025-06-16 Thread Michael Kruse via cfe-commits
Meinersbur wrote: > Thank you! But before accepting the merge, does this mean that we discard > everything that i said about refactoring these variables and just keep it as > it is in both reviews @alexey-bataev ? Also, could you @Meinersbur specify > what exactly do you mean with a regression

[clang] [Clang][OpenMP][LoopTransformations] Fix incorrect number of generated loops for Tile and Reverse directives (PR #140532)

2025-06-10 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur approved this pull request. I am OK with this patch as-is, independented of #139293 since it was cleary a (my) mistake. Just a test case to detect regressions would be nice if possible. So I LGTM this patch. If @alexey-bataev wants additional changes, this can be

[clang] [Clang][OpenMP][LoopTransformations] Fix incorrect number of generated loops for Tile and Reverse directives (PR #140532)

2025-06-03 Thread Michael Kruse via cfe-commits
Meinersbur wrote: This change makes sense to me. In principle, the information of generated loops is only needed in dependent contexts (not yet fully expanded templates); elsewhere we get the loop nest structure from `getTransformedStmt()`. The use in `doForAllLoops` is meant to delay evaluati

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-05-14 Thread Michael Kruse via cfe-commits
Meinersbur wrote: > ```c > #pragma omp simd reduction(+:v0) > #pragma unroll(4) > ``` That's not supposed to work. I think in the past the unroll pragma was just dropped. If the debug info is the issue, there hasn't been a lot of care to get OpenMP emit correct debug info, see e.g. #110700.

[clang] [flang] [llvm] [openmp] [Flang][OpenMP] Move builtin .mod generation into runtimes (PR #137828)

2025-05-13 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur updated https://github.com/llvm/llvm-project/pull/137828 Rate limit ยท GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,san

[clang] [flang] [llvm] [openmp] [Flang][OpenMP] Move builtin .mod generation into runtimes (PR #137828)

2025-05-12 Thread Michael Kruse via cfe-commits
@@ -299,6 +310,18 @@ elseif (FLANG_RT_GCC_RESOURCE_DIR) endif () endif () + + +if (CMAKE_C_BYTE_ORDER STREQUAL "BIG_ENDIAN") Meinersbur wrote: I had the same problem as you: CMake does not determine endianness when cross-compiling. This is leftover from my

[clang] [flang] [llvm] [openmp] [Flang][OpenMP] Move builtin .mod generation into runtimes (PR #137828)

2025-05-12 Thread Michael Kruse via cfe-commits
@@ -88,6 +117,67 @@ set(host_sources unit-map.cpp ) +# Module sources that are required by other modules +set(intrinsics_sources + __fortran_builtins.f90 +) + + +#set_property(SOURCE "__fortran_type_info.f90" APPEND PROPERTY OBJECT_DEPENDS "/home/meinersbur/build/llvm-pro

[clang] [flang] [llvm] [openmp] [Clang][OpenMP][LoopTransformations] Add support for "#pragma omp fuse" loop transformation directive and "looprange" clause (PR #139293)

2025-05-12 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/139293 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [openmp] [Flang][OpenMP] Move builtin .mod generation into runtimes (PR #137828)

2025-05-07 Thread Michael Kruse via cfe-commits
Meinersbur wrote: > Just want to make sure: Should it be > `$prefix/lib/clang/${LLVM_VERSION_MAJOR}/finclude//*.mod`? That is correct, I forgot the version number that is part of the resource directory. https://github.com/llvm/llvm-project/pull/137828 ___

[clang] [flang] [llvm] [openmp] [Flang][OpenMP] Move builtin .mod generation into runtimes (PR #137828)

2025-04-29 Thread Michael Kruse via cfe-commits
@@ -3979,6 +3979,16 @@ def fsyntax_only : Flag<["-"], "fsyntax-only">, Visibility<[ClangOption, CLOption, DXCOption, CC1Option, FC1Option, FlangOption]>, Group, HelpText<"Run the preprocessor, parser and semantic analysis stages">; + + +def fno_builtin_modules : Flag<["-

[clang] [flang] [llvm] [openmp] [Flang][OpenMP] Move builtin .mod generation into runtimes (PR #137828)

2025-04-29 Thread Michael Kruse via cfe-commits
Meinersbur wrote: While I appreciate the review, it is not yet in the state that warants one. It is still in an experimentation stage, so I did not yet care about formatting. There are also a lot of changes in here that will eventually not be needed. Goals are: 1. Currently modules files are

[clang] [llvm] [mlir] [OMPIRBuilder] Don't discard the debug record from entry block. (PR #135161)

2025-04-29 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur approved this pull request. LGTM, thank you. https://github.com/llvm/llvm-project/pull/135161 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [mlir][OpenMP] Convert omp.cancel sections to LLVMIR (PR #137193)

2025-04-29 Thread Michael Kruse via cfe-commits
@@ -2264,6 +2263,14 @@ OpenMPIRBuilder::InsertPointOrErrorTy OpenMPIRBuilder::createSections( AfterIP = {FiniBB, FiniBB->begin()}; } + // Now we can fix the dummy branch to point to the right place + if (!CancellationBranches.empty()) { Meinersbur wro

[clang] [llvm] [mlir] [mlir][OpenMP] Convert omp.cancel sections to LLVMIR (PR #137193)

2025-04-29 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/137193 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [mlir][OpenMP] Convert omp.cancel sections to LLVMIR (PR #137193)

2025-04-29 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/137193 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-04-23 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/135163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-04-23 Thread Michael Kruse via cfe-commits
@@ -5237,8 +5237,8 @@ width/count of the set of target architectures supported by your application. ... } -Specifying a width/count of 1 disables the optimization, and is equivalent to -``vectorize(disable)`` or ``interleave(disable)``. Meinersbur wrote

[clang] [clang][CodeGen] Fix metadata when vectorization is disabled by pragma (PR #135163)

2025-04-23 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur commented: Unfortuantely IIRC there is a semantic difference between pragma and metadata: * llvm.loop.vectorize.enable==false disables vectorization AND interleaving (by switching off the entire LoopVectorize pass which does both of thise things) * llvm.loop.vect

[clang] [llvm] [openmp] [OpenMP] Change build of OpenMP device runtime to be a separate runtime (PR #136729)

2025-04-23 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/136729 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [openmp] [OpenMP] Change build of OpenMP device runtime to be a separate runtime (PR #136729)

2025-04-23 Thread Michael Kruse via cfe-commits
@@ -113,6 +113,13 @@ else() set(CMAKE_CXX_EXTENSIONS NO) endif() +# Emit a warning for people who haven't updated their build. +if(NOT "openmp" IN_LIST RUNTIMES_amdgcn-amd-amdhsa_LLVM_ENABLE_RUNTIMES AND + NOT "openmp" IN_LIST RUNTIMES_nvptx64-nvidia-cuda_LLVM_ENABLE_RUNTI

[clang] [llvm] [openmp] [OpenMP] Change build of OpenMP device runtime to be a separate runtime (PR #136729)

2025-04-23 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur commented: I think using the LLVM_ENABLE_RUNTIMES-machanism is a great idea. Regarding the move back to `openmp/device`, I don't really have an opinion. However, there are some arguments to make: 1. The same arguments apply to `libomptarget` as well 2. Definitions

[clang] [llvm] [openmp] [OpenMP] Change build of OpenMP device runtime to be a separate runtime (PR #136729)

2025-04-23 Thread Michael Kruse via cfe-commits
@@ -122,35 +130,41 @@ else() get_clang_resource_dir(LIBOMP_HEADERS_INSTALL_PATH SUBDIR include) endif() -# Build host runtime library, after LIBOMPTARGET variables are set since they are needed -# to enable time profiling support in the OpenMP runtime. -add_subdirectory(run

[clang] [llvm] [OpenMP] Update the bitcode library install and search path (PR #136754)

2025-04-23 Thread Michael Kruse via cfe-commits
@@ -2794,6 +2794,11 @@ void tools::addOpenMPDeviceRTL(const Driver &D, for (const auto &LibPath : HostTC.getFilePaths()) LibraryPaths.emplace_back(LibPath); + // Check the target specific library path for the triple as well. + SmallString<128> P(D.Dir); + llvm::sys::p

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

2025-04-07 Thread Michael Kruse via cfe-commits
Meinersbur wrote: This PR may allow us to build the shared library by default https://github.com/llvm/llvm-project/blob/6c7c8b4776f51dc66138f71333e6ada0c33ca5e2/flang-rt/CMakeLists.txt#L159-L165 I would generally prefer if we could avoid having driver behavior depend on the existance of files,

[clang] [flang] [llvm] [flang-rt] Pass the whole path of libflang_rt.runtime.a to linker on AIX (PR #131041)

2025-03-31 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/131041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [flang-rt] Pass the whole path of libflang_rt.runtime.a to linker on AIX (PR #131041)

2025-03-31 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur approved this pull request. LGTM, thank you https://github.com/llvm/llvm-project/pull/131041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-28 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/131985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-28 Thread Michael Kruse via cfe-commits
@@ -44,23 +44,19 @@ MDNode *LoopInfo::createPipeliningMetadata(const LoopAttributes &Attrs, else if (Attrs.PipelineInitiationInterval != 0) Enabled = true; + SmallVector Args; + Args.append(LoopProperties.begin(), LoopProperties.end()); + if (Enabled != true) { -

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-27 Thread Michael Kruse via cfe-commits
@@ -44,23 +44,19 @@ MDNode *LoopInfo::createPipeliningMetadata(const LoopAttributes &Attrs, else if (Attrs.PipelineInitiationInterval != 0) Enabled = true; + SmallVector Args; + Args.append(LoopProperties.begin(), LoopProperties.end()); + if (Enabled != true) { -

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-26 Thread Michael Kruse via cfe-commits
@@ -227,36 +226,26 @@ void for_test_scalable_1(int *List, int Length) { // CHECK: ![[LOOP_5]] = distinct !{![[LOOP_5]], ![[UNROLL_DISABLE:.*]], ![[DISTRIBUTE_DISABLE:.*]], ![[WIDTH_1:.*]]} // CHECK: ![[WIDTH_1]] = !{!"llvm.loop.vectorize.width", i32 1} -// CHECK: ![[LOOP_6]]

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-26 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/131985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-26 Thread Michael Kruse via cfe-commits
@@ -170,11 +161,10 @@ LoopInfo::createUnrollAndJamMetadata(const LoopAttributes &Attrs, MDNode::get(Ctx, MDString::get(Ctx, "llvm.loop.unroll_and_jam.disable"))); bool FollowupHasTransforms = false; - MDNode *Followup = createPartialUnrollMetadata(Attrs, FollowupLoo

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-26 Thread Michael Kruse via cfe-commits
@@ -44,23 +44,19 @@ MDNode *LoopInfo::createPipeliningMetadata(const LoopAttributes &Attrs, else if (Attrs.PipelineInitiationInterval != 0) Enabled = true; + SmallVector Args; + Args.append(LoopProperties.begin(), LoopProperties.end()); + if (Enabled != true) { -

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-26 Thread Michael Kruse via cfe-commits
@@ -44,23 +44,19 @@ MDNode *LoopInfo::createPipeliningMetadata(const LoopAttributes &Attrs, else if (Attrs.PipelineInitiationInterval != 0) Enabled = true; + SmallVector Args; + Args.append(LoopProperties.begin(), LoopProperties.end()); + if (Enabled != true) { -

[clang] [llvm] [clang][CodeGen] Generate follow-up metadata for loops in correct format (PR #131985)

2025-03-26 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur approved this pull request. LGTM, great work! https://github.com/llvm/llvm-project/pull/131985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Flang] Link `-lflang_rt.runtime` if available on the device (PR #132737)

2025-03-24 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/132737 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Flang] Link `-lflang_rt.runtime` if available on the device (PR #132737)

2025-03-24 Thread Michael Kruse via cfe-commits
@@ -9337,6 +9337,11 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back( Args.MakeArgString("--device-linker=" + TC.getTripleString() + "=" + "-lclang_rt.builtins")); + bool HasFlan

[clang] [llvm] [flang-rt] Pass the whole path of libflang_rt.runtime.a to linker on AIX (PR #131041)

2025-03-17 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/131041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [flang-rt] Pass the whole path of libflang_rt.runtime.a to linker on AIX (PR #131041)

2025-03-17 Thread Michael Kruse via cfe-commits
@@ -101,3 +102,19 @@ bool PPCLinuxToolChain::SupportIEEEFloat128( return GlibcSupportsFloat128((Twine(D.DyldPrefix) + Linker).str()) && !(D.CCCIsCXX() && HasUnsupportedCXXLib); } + +void PPCLinuxToolChain::addFortranRuntimeLibs( +const ArgList &Args, llvm::opt::A

[clang] [llvm] [flang-rt] Pass the whole path of libflang_rt.runtime.a to linker on AIX (PR #131041)

2025-03-17 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur commented: Approach look OK to me. Could you add test(s) along the lines of [aix-rlib.c](https://github.com/llvm/llvm-project/blob/main/clang/test/Driver/aix-rtlib.c). If we make further changes, knowing what is expected on AIX/PPCLunux would be very helpful. A

[clang] [Clang] Remove use of 'temporary' toolchains for offload deduction (PR #131332)

2025-03-14 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/131332 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Remove use of 'temporary' toolchains for offload deduction (PR #131332)

2025-03-14 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/131332 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang-rt] Pass the whole path of libflang_rt.runtime.a to linker on AIX (PR #131041)

2025-03-13 Thread Michael Kruse via cfe-commits
@@ -1345,7 +1345,16 @@ void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args, if (AsNeeded) addAsNeededOption(TC, Args, CmdArgs, /*as_needed=*/false); } -CmdArgs.push_back("-lflang_rt.runtime"); +if (TC.getTriple().isOSAIX()) { +

[clang] [flang-rt] Pass the whole path of libflang_rt.runtime.a to linker on AIX (PR #131041)

2025-03-13 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/131041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang-rt] Pass the whole path of libflang_rt.runtime.a to linker on AIX (PR #131041)

2025-03-13 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/131041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang-rt] Pass the whole path of libflang_rt.runtime.a to linker on AIX (PR #131041)

2025-03-13 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/131041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang-rt] Pass the whole path of libflang_rt.runtime.a to linker on AIX (PR #131041)

2025-03-13 Thread Michael Kruse via cfe-commits
Meinersbur wrote: > Right. I tried with `FLANG_RT_ENABLE_SHARED=ON` on AIX. I was able to > dynamically link to the shared `flang-rt` and execute the `a.out` > successfully. With this PR applied? It hardcodes `libflang_rt.runtime.a` on AIX, how can it find the `.so`? > As for buildCompilerRT

[clang] [flang] [lld] [llvm] [Flang] LLVM_ENABLE_RUNTIMES=flang-rt (PR #110217)

2025-03-13 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/110217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang-rt] Pass the whole path of libflang_rt.runtime.a to linker on AIX (PR #131041)

2025-03-12 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur commented: This is what I would like to do more generally, not just for AIX. This PR however will break using a shared library libflang_rt.runtime.so. Ideally, we would synchronize with the compiler-rt implementation which already has many supporting functions su

[clang] [flang-rt] Pass the whole path of libflang_rt.runtime.a to linker on AIX (PR #131041)

2025-03-12 Thread Michael Kruse via cfe-commits
@@ -1345,7 +1345,16 @@ void tools::addFortranRuntimeLibs(const ToolChain &TC, const ArgList &Args, if (AsNeeded) addAsNeededOption(TC, Args, CmdArgs, /*as_needed=*/false); } -CmdArgs.push_back("-lflang_rt.runtime"); +if (TC.getTriple().isOSAIX()) { +

[clang] [LinkerWrapper] Try to fix testing on Windows (PR #130285)

2025-03-07 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/130285 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LinkerWrapper] Try to fix testing on Windows (PR #130285)

2025-03-07 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/130285 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LinkerWrapper] Try to fix testing on Windows (PR #130285)

2025-03-07 Thread Michael Kruse via cfe-commits
@@ -599,9 +599,11 @@ Expected writeOffloadFile(const OffloadFile &File) { StringRef Prefix = sys::path::stem(Binary.getMemoryBufferRef().getBufferIdentifier()); - - auto TempFileOrErr = createOutputFile( - Prefix + "-" + Binary.getTriple() + "-" + Binary.getArch

[clang] [LinkerWrapper] Try to fix testing on Windows (PR #130285)

2025-03-07 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/130285 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LinkerWrapper] Try to fix testing on Windows (PR #130285)

2025-03-07 Thread Michael Kruse via cfe-commits
@@ -599,9 +599,11 @@ Expected writeOffloadFile(const OffloadFile &File) { StringRef Prefix = sys::path::stem(Binary.getMemoryBufferRef().getBufferIdentifier()); - - auto TempFileOrErr = createOutputFile( - Prefix + "-" + Binary.getTriple() + "-" + Binary.getArch

[clang] [LinkerWrapper] Try to fix testing on Windows (PR #130285)

2025-03-07 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur requested changes to this pull request. Not aware of any filename sanitizer utility either. https://github.com/llvm/llvm-project/pull/130285 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] clang: Enable linker-wrapper test on windows (PR #130248)

2025-03-07 Thread Michael Kruse via cfe-commits
Meinersbur wrote: Pre-merge on Linux fails too, but different symptoms. Let me try on my machine. https://github.com/llvm/llvm-project/pull/130248 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [LinkerWrapper] Try to fix testing on Windows (PR #130285)

2025-03-07 Thread Michael Kruse via cfe-commits
@@ -599,9 +599,10 @@ Expected writeOffloadFile(const OffloadFile &File) { StringRef Prefix = sys::path::stem(Binary.getMemoryBufferRef().getBufferIdentifier()); - - auto TempFileOrErr = createOutputFile( - Prefix + "-" + Binary.getTriple() + "-" + Binary.getArch

[clang] clang: Enable linker-wrapper test on windows (PR #130248)

2025-03-07 Thread Michael Kruse via cfe-commits
Meinersbur wrote: clang-offload-wrapper tries to write a file `linker-wrapper.c.tmp-on-amdgcn-amd-amdhsa-gfx90a:xnack+-0c971c.o` in the temp directory. `:` is not a valid character in filenames one Windows. The colon comes from the `Binary.getArch()` call here: https://github.com/llvm/llvm-pr

[clang] [flang] [llvm] [mlir] [mlir][OpenMP] fix crash outlining infinite loop (PR #129872)

2025-03-06 Thread Michael Kruse via cfe-commits
Meinersbur wrote: @tblah I don't think it is blocking cancellation, we just don't know what is going on. The `omp.par.outlined.exit` apparently was once need for cancellation points. Looking at the `cancel_codegen.cpp` test case, it seems to evantually jump to `omp.par.exit.exitStub`. That one

[clang] [flang] [lld] [llvm] [Flang] Remove FLANG_INCLUDE_RUNTIME (PR #124126)

2025-02-17 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/124126 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [lld] [llvm] [Flang-RT] Build libflang_rt.so (PR #121782)

2025-02-17 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur closed https://github.com/llvm/llvm-project/pull/121782 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [lld] [llvm] [Flang-RT] Build libflang_rt.so (PR #121782)

2025-02-16 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/121782 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [lld] [llvm] [Flang] LLVM_ENABLE_RUNTIMES=flang-rt (PR #110217)

2025-02-16 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur closed https://github.com/llvm/llvm-project/pull/110217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [lld] [llvm] [Flang] LLVM_ENABLE_RUNTIMES=flang-rt (PR #110217)

2025-02-16 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/110217 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [lld] [llvm] [Flang][NFC] Move runtime library files to flang-rt. (PR #110298)

2025-02-16 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur closed https://github.com/llvm/llvm-project/pull/110298 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [lld] [llvm] [Flang][NFC] Move runtime library files to flang-rt. (PR #110298)

2025-02-15 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/110298 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Offload] Treat an empty packager archicture as 'generic' (PR #126655)

2025-02-11 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/126655 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Offload] Treat an empty packager architecture as 'generic' (PR #126655)

2025-02-11 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/126655 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Offload] Treat an empty packager archicture as 'generic' (PR #126655)

2025-02-11 Thread Michael Kruse via cfe-commits
Meinersbur wrote: What happens with `-march` not specified? I only know about gcc falling back on `-march=x86-64`, but depends on the target triple. https://github.com/llvm/llvm-project/pull/126655 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang] [Offload] Treat an empty packager archicture as 'generic' (PR #126655)

2025-02-11 Thread Michael Kruse via cfe-commits
@@ -474,7 +474,7 @@ Expected clang(ArrayRef InputFiles, const ArgList &Args) { const llvm::Triple Triple(Args.getLastArgValue(OPT_triple_EQ)); StringRef Arch = Args.getLastArgValue(OPT_arch_EQ); - if (Arch.empty()) + if (Arch.empty() || Arch == "generic") --

[clang] [flang] [lld] [llvm] [Flang][NFC] Move runtime library files to flang-rt. (PR #110298)

2025-02-10 Thread Michael Kruse via cfe-commits
Meinersbur wrote: The intention was to leave the files included in both, runtime and compile, inside the `flang/` subtree. This leaves cross-project include-dependencies only in one direction: "flang-rt" -> "flang/include". This applies header files in "flang/include/Common" and "flang/include

[clang] [flang] [lld] [llvm] [Flang][NFC] Move runtime library files to flang-rt. (PR #110298)

2025-02-10 Thread Michael Kruse via cfe-commits
Meinersbur wrote: @clementval You agreed to a new folder structure in https://discourse.llvm.org/t/rfc-names-for-flang-rt-libraries/84321/4. Could you please review this PR again? The "Check code formatting" stage does not pass by design. For moved/renamed files it requires a complete reforma

[clang] [flang] [lld] [llvm] [Flang][NFC] Move runtime library files to flang-rt. (PR #110298)

2025-02-08 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/110298 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [lld] [Flang] Rename libFortranRuntime.a to libflang_rt.runtime.a (PR #122341)

2025-02-08 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur closed https://github.com/llvm/llvm-project/pull/122341 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [lld] [Flang] Rename libFortranRuntime.a to libflang_rt.runtime.a (PR #122341)

2025-02-08 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/122341 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [lld] [Flang] Rename libFortranRuntime.a to libflang_rt.runtime.a (PR #122341)

2025-02-07 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/122341 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [lld] [Flang] Rename libFortranRuntime.a to libflang_rt.a (PR #122341)

2025-02-07 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur edited https://github.com/llvm/llvm-project/pull/122341 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [lld] [Flang] Optionally do not compile the runtime in-tree (PR #122336)

2025-02-07 Thread Michael Kruse via cfe-commits
https://github.com/Meinersbur closed https://github.com/llvm/llvm-project/pull/122336 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   >