[flang] [clang] [Flang] Add code-object-version option (PR #72638)

2023-11-17 Thread Jan Leyonberg via cfe-commits
https://github.com/jsjodin edited https://github.com/llvm/llvm-project/pull/72638 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [Flang] Add code-object-version option (PR #72638)

2023-11-17 Thread Jan Leyonberg via cfe-commits
@@ -264,6 +263,37 @@ static void addDepdendentLibs(mlir::ModuleOp &mlirModule, } } +// Add to MLIR code target specific items which are dependent on target +// configuration specified by the user +static void addTargetSpecificMLIRItems(mlir::ModuleOp &mlirModule, +

[clang] [flang] [Flang] Add code-object-version option (PR #72638)

2023-11-17 Thread Jan Leyonberg via cfe-commits
https://github.com/jsjodin requested changes to this pull request. https://github.com/llvm/llvm-project/pull/72638 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [flang] [Flang] Add code-object-version option (PR #72638)

2023-11-28 Thread Jan Leyonberg via cfe-commits
https://github.com/jsjodin approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/72638 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [mlir] [OpenMP] Migrate GPU Reductions CodeGen from Clang to OMPIRBuilder (PR #80343)

2024-02-06 Thread Jan Leyonberg via cfe-commits
jsjodin wrote: I think the patch should be split up into at least 2 pieces. First would be the migration work and changes to Clang, the second would be working on adding reduction support for flang. https://github.com/llvm/llvm-project/pull/80343 __

[clang] [mlir] [llvm] [OpenMP] Migrate GPU Reductions CodeGen from Clang to OMPIRBuilder (PR #80343)

2024-02-06 Thread Jan Leyonberg via cfe-commits
@@ -2719,10 +4051,24 @@ getKmpcForStaticLoopForType(Type *Ty, OpenMPIRBuilder *OMPBuilder, static void createTargetLoopWorkshareCall( OpenMPIRBuilder *OMPBuilder, WorksharingLoopType LoopType, BasicBlock *InsertBlock, Value *Ident, Value *LoopBodyArg, -Type *Parall

[llvm] [mlir] [clang] [OpenMP] Migrate GPU Reductions CodeGen from Clang to OMPIRBuilder (PR #80343)

2024-02-06 Thread Jan Leyonberg via cfe-commits
@@ -2042,35 +2057,1378 @@ OpenMPIRBuilder::createSection(const LocationDescription &Loc, /*IsCancellable*/ true); } -/// Create a function with a unique name and a "void (i8*, i8*)" signature in -/// the given module and return it. -Function *get

[llvm] [mlir] [clang] [OpenMP] Migrate GPU Reductions CodeGen from Clang to OMPIRBuilder (PR #80343)

2024-02-06 Thread Jan Leyonberg via cfe-commits
jsjodin wrote: > @jsjodin This PR only has the migration work. Flang/MLIR is left unchanged > other than the few necessary changes. > > Once this patch is merged, I'll put up a PR for having MLIR use these > additions. There is some code that is related to Flang/MLIR that shouldn't be in the

[llvm] [mlir] [clang] [OpenMP] Migrate GPU Reductions CodeGen from Clang to OMPIRBuilder (PR #80343)

2024-02-06 Thread Jan Leyonberg via cfe-commits
@@ -2042,35 +2057,1378 @@ OpenMPIRBuilder::createSection(const LocationDescription &Loc, /*IsCancellable*/ true); } -/// Create a function with a unique name and a "void (i8*, i8*)" signature in -/// the given module and return it. -Function *get

[clang] [OpenMP] Remove complex reduction variable support (PR #82497)

2024-03-04 Thread Jan Leyonberg via cfe-commits
jsjodin wrote: @alexey-bataev do you have any concerns about removing this case? https://github.com/llvm/llvm-project/pull/82497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Add -mlink-builtin-bitcode option to fc1 (PR #94763)

2024-06-07 Thread Jan Leyonberg via cfe-commits
https://github.com/jsjodin created https://github.com/llvm/llvm-project/pull/94763 This patch enables the -mlink-builtin-bitcode flag in fc1 so that bitcode libraries can be linked in. This is needed for OpenMP offloading libraries. >From adfeb69ba312e971cb4eae71f185f38b1cac9b8f Mon Sep 17 00:

[clang] [flang] [flang] Add -mlink-builtin-bitcode option to fc1 (PR #94763)

2024-06-10 Thread Jan Leyonberg via cfe-commits
@@ -0,0 +1,18 @@ + +!-- +! RUN lines +!-- +! Embed something that can be easily checked +! RUN: %flang_fc1 -emit-llvm -triple x86_64-unknown-linux-gnu -o - -mlink-builtin-bitcode %S/Inputs/bclib.bc %s 2>&1 | FileCheck %s jsjodin wrote: The triple

[clang] [flang] [flang] Add -mlink-builtin-bitcode option to fc1 (PR #94763)

2024-06-10 Thread Jan Leyonberg via cfe-commits
@@ -1146,6 +1150,54 @@ void CodeGenAction::embedOffloadObjects() { } } +void CodeGenAction::linkBuiltinBCLibs() { jsjodin wrote: It does come from clang but it is distributed across a few classes with a lot more options, so there was not simple way to simp

[clang] [flang] [flang] Add -mlink-builtin-bitcode option to fc1 (PR #94763)

2024-06-10 Thread Jan Leyonberg via cfe-commits
jsjodin wrote: Yes, it should be possible to add a command to generate the .bc file, that is probably a better option anyway since we would avoid specifying the triple. https://github.com/llvm/llvm-project/pull/94763 ___

[clang] [flang] [flang] Add -mlink-builtin-bitcode option to fc1 (PR #94763)

2024-06-10 Thread Jan Leyonberg via cfe-commits
https://github.com/jsjodin edited https://github.com/llvm/llvm-project/pull/94763 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [flang] Add -mlink-builtin-bitcode option to fc1 (PR #94763)

2024-06-11 Thread Jan Leyonberg via cfe-commits
https://github.com/jsjodin updated https://github.com/llvm/llvm-project/pull/94763 >From adfeb69ba312e971cb4eae71f185f38b1cac9b8f Mon Sep 17 00:00:00 2001 From: Jan Leyonberg Date: Wed, 5 Jun 2024 10:56:41 -0400 Subject: [PATCH 1/2] [flang] Add -mlink-builtin-bitcode option to fc1 This patch e

[clang] [flang] [flang] Add -mlink-builtin-bitcode option to fc1 (PR #94763)

2024-06-11 Thread Jan Leyonberg via cfe-commits
@@ -0,0 +1,18 @@ + +!-- +! RUN lines +!-- +! Embed something that can be easily checked +! RUN: %flang_fc1 -emit-llvm -triple x86_64-unknown-linux-gnu -o - -mlink-builtin-bitcode %S/Inputs/bclib.bc %s 2>&1 | FileCheck %s + +! CHECK: define internal void @libfun_ +

[clang] [flang] [flang] Add -mlink-builtin-bitcode option to fc1 (PR #94763)

2024-06-11 Thread Jan Leyonberg via cfe-commits
@@ -0,0 +1,18 @@ + +!-- +! RUN lines +!-- +! Embed something that can be easily checked +! RUN: %flang_fc1 -emit-llvm -triple x86_64-unknown-linux-gnu -o - -mlink-builtin-bitcode %S/Inputs/bclib.bc %s 2>&1 | FileCheck %s + +! CHECK: define internal void @libfun_ +

[clang] [flang] [flang] Add -mlink-builtin-bitcode option to fc1 (PR #94763)

2024-06-12 Thread Jan Leyonberg via cfe-commits
@@ -0,0 +1,15 @@ +! Test -mlink-builtin-bitcode flag +! RUN: %flang -emit-llvm -c -o %t.bc %S/Inputs/libfun.f90 +! RUN: %flang_fc1 -emit-llvm -o - -mlink-builtin-bitcode %t.bc %s 2>&1 | FileCheck %s + +! CHECK: define internal void @libfun_ + +! RUN: not %flang_fc1 -emit-llvm -tr

[clang] [flang] [flang] Add -mlink-builtin-bitcode option to fc1 (PR #94763)

2024-06-12 Thread Jan Leyonberg via cfe-commits
https://github.com/jsjodin updated https://github.com/llvm/llvm-project/pull/94763 >From adfeb69ba312e971cb4eae71f185f38b1cac9b8f Mon Sep 17 00:00:00 2001 From: Jan Leyonberg Date: Wed, 5 Jun 2024 10:56:41 -0400 Subject: [PATCH 1/3] [flang] Add -mlink-builtin-bitcode option to fc1 This patch e

[clang] [flang] [flang] Add -mlink-builtin-bitcode option to fc1 (PR #94763)

2024-06-13 Thread Jan Leyonberg via cfe-commits
https://github.com/jsjodin updated https://github.com/llvm/llvm-project/pull/94763 >From adfeb69ba312e971cb4eae71f185f38b1cac9b8f Mon Sep 17 00:00:00 2001 From: Jan Leyonberg Date: Wed, 5 Jun 2024 10:56:41 -0400 Subject: [PATCH 1/4] [flang] Add -mlink-builtin-bitcode option to fc1 This patch e

[clang] [flang] [flang] Add -mlink-builtin-bitcode option to fc1 (PR #94763)

2024-06-17 Thread Jan Leyonberg via cfe-commits
https://github.com/jsjodin closed https://github.com/llvm/llvm-project/pull/94763 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][OpenMP] Propagate debug location to OMPIRBuilder reduction codegen (PR #100358)

2024-07-24 Thread Jan Leyonberg via cfe-commits
https://github.com/jsjodin edited https://github.com/llvm/llvm-project/pull/100358 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [OpenMP] Migrate GPU Reductions CodeGen from Clang to OMPIRBuilder (PR #80343)

2024-04-24 Thread Jan Leyonberg via cfe-commits
@@ -607,15 +621,17 @@ class OpenMPIRBuilder { /// Generator for '#omp barrier' /// /// \param Loc The location where the barrier directive was encountered. - /// \param DK The kind of directive that caused the barrier. + /// \param Kind The kind of directive that caused

[clang] [llvm] [OpenMPIRBuilder][Clang][NFC] - Combine `emitOffloadingArrays` and `emitOffloadingArraysArgument` in OpenMPIRBuilder (PR #97088)

2024-07-12 Thread Jan Leyonberg via cfe-commits
https://github.com/jsjodin edited https://github.com/llvm/llvm-project/pull/97088 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [OpenMPIRBuilder][Clang][NFC] - Combine `emitOffloadingArrays` and `emitOffloadingArraysArgument` in OpenMPIRBuilder (PR #97088)

2024-07-12 Thread Jan Leyonberg via cfe-commits
https://github.com/jsjodin approved this pull request. One nit, otherwise LGTM. https://github.com/llvm/llvm-project/pull/97088 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [OpenMPIRBuilder][Clang][NFC] - Combine `emitOffloadingArrays` and `emitOffloadingArraysArgument` in OpenMPIRBuilder (PR #97088)

2024-07-12 Thread Jan Leyonberg via cfe-commits
@@ -9536,18 +9506,65 @@ static void emitTargetCallKernelLaunch( MEHandler.adjustMemberOfForLambdaCaptures( OMPBuilder, LambdaPointers, CombinedInfo.BasePointers, CombinedInfo.Pointers, CombinedInfo.Types); +} +static void +genMapInfo(MappableExprsHandler &MEHandle

[clang] [llvm] [mlir] [OpenMP] Migrate GPU Reductions CodeGen from Clang to OMPIRBuilder (PR #80343)

2024-06-25 Thread Jan Leyonberg via cfe-commits
https://github.com/jsjodin approved this pull request. This looks good to me now. You can wait a few days before merging to let @jdoerfert look it over again. https://github.com/llvm/llvm-project/pull/80343 ___ cfe-commits mailing list cfe-commits@li

[clang] [llvm] [OpenMP][Clang] Migrate OpenMP UserDefinedMapper from Clang to OMPIRBuilder (PR #110001)

2024-11-26 Thread Jan Leyonberg via cfe-commits
@@ -9041,257 +9041,65 @@ void CGOpenMPRuntime::emitUserDefinedMapper(const OMPDeclareMapperDecl *D, return; ASTContext &C = CGM.getContext(); QualType Ty = D->getType(); - QualType PtrTy = C.getPointerType(Ty).withRestrict(); - QualType Int64Ty = C.getIntTypeForBitwi

[clang] [llvm] [OpenMP][Clang] Migrate OpenMP UserDefinedMapper from Clang to OMPIRBuilder (PR #110001)

2024-12-17 Thread Jan Leyonberg via cfe-commits
https://github.com/jsjodin approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/110001 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [MLIR][OpenMP] Add codegen for teams reductions (PR #133310)

2025-04-03 Thread Jan Leyonberg via cfe-commits
@@ -4645,12 +4789,23 @@ initTargetDefaultAttrs(omp::TargetOp targetOp, Operation *capturedOp, (maxThreadsVal >= 0 && maxThreadsVal < combinedMaxThreadsVal)) combinedMaxThreadsVal = maxThreadsVal; + // Calculate reduction data size, limited to single reduction varia

[clang] [llvm] [mlir] [MLIR][OpenMP] Add codegen for teams reductions (PR #133310)

2025-04-03 Thread Jan Leyonberg via cfe-commits
@@ -3688,27 +3708,95 @@ static Function *getFreshReductionFunc(Module &M) { ".omp.reduction.func", &M); } -OpenMPIRBuilder::InsertPointOrErrorTy -OpenMPIRBuilder::createReductions(const LocationDescription &Loc, - Inse

[clang] [llvm] [mlir] [MLIR][OpenMP] Add codegen for teams reductions (PR #133310)

2025-03-27 Thread Jan Leyonberg via cfe-commits
https://github.com/jsjodin created https://github.com/llvm/llvm-project/pull/133310 This patch adds the lowering of teams reductions from the omp dialect to LLVM-IR. Some minor cleanup was done in clang to remove an unused parameter. >From 50fefbb31f4de7352c241c48fe5382785daaef21 Mon Sep 17 0

[clang] [llvm] [mlir] [MLIR][OpenMP] Add codegen for teams reductions (PR #133310)

2025-03-27 Thread Jan Leyonberg via cfe-commits
https://github.com/jsjodin updated https://github.com/llvm/llvm-project/pull/133310 >From 50fefbb31f4de7352c241c48fe5382785daaef21 Mon Sep 17 00:00:00 2001 From: Jan Leyonberg Date: Sun, 23 Mar 2025 09:56:51 -0400 Subject: [PATCH 1/9] Initial modifications to support reductions in flang. ---

[clang] [llvm] [mlir] [MLIR][OpenMP] Add codegen for teams reductions (PR #133310)

2025-03-28 Thread Jan Leyonberg via cfe-commits
https://github.com/jsjodin updated https://github.com/llvm/llvm-project/pull/133310 >From 50fefbb31f4de7352c241c48fe5382785daaef21 Mon Sep 17 00:00:00 2001 From: Jan Leyonberg Date: Sun, 23 Mar 2025 09:56:51 -0400 Subject: [PATCH 01/10] Initial modifications to support reductions in flang. ---

[clang] [llvm] [mlir] [MLIR][OpenMP] Add codegen for teams reductions (PR #133310)

2025-04-05 Thread Jan Leyonberg via cfe-commits
@@ -4161,6 +4247,37 @@ convertOmpDistribute(Operation &opInst, llvm::IRBuilderBase &builder, if (failed(checkImplementationStatus(opInst))) return failure(); + /// Process teams op reduction in distribute if the reduction is contained in + /// the distribute op. + om

[clang] [llvm] [mlir] [MLIR][OpenMP] Add codegen for teams reductions (PR #133310)

2025-04-05 Thread Jan Leyonberg via cfe-commits
https://github.com/jsjodin updated https://github.com/llvm/llvm-project/pull/133310 >From 8193adb194d456c8d8f719869d920b6214f0505e Mon Sep 17 00:00:00 2001 From: Jan Leyonberg Date: Sun, 23 Mar 2025 09:56:51 -0400 Subject: [PATCH 1/9] Initial modifications to support reductions in flang. ---

[clang] [llvm] [mlir] [MLIR][OpenMP] Add codegen for teams reductions (PR #133310)

2025-04-07 Thread Jan Leyonberg via cfe-commits
https://github.com/jsjodin updated https://github.com/llvm/llvm-project/pull/133310 >From 78f53d76e6b5fd778cd2ec4fc1aa80b0c42ce582 Mon Sep 17 00:00:00 2001 From: Jan Leyonberg Date: Sun, 23 Mar 2025 09:56:51 -0400 Subject: [PATCH 1/9] Initial modifications to support reductions in flang. ---