Skip to content

Commit

Permalink
Post-merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ergawy committed Dec 17, 2024
1 parent c5cda76 commit 1c396f0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 92 deletions.
3 changes: 3 additions & 0 deletions flang/lib/Lower/OpenMP/OpenMP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ extractOmpDirective(const parser::OpenMPConstruct &ompConstruct) {
[](const parser::OpenMPDeclarativeAllocate &c) {
return llvm::omp::OMPD_allocate;
},
[](const parser::OpenMPErrorConstruct &c) {
return llvm::omp::OMPD_error;
},
[](const parser::OpenMPExecutableAllocate &c) {
return llvm::omp::OMPD_allocate;
},
Expand Down
73 changes: 0 additions & 73 deletions flang/test/Lower/OpenMP/target_private.f90

This file was deleted.

4 changes: 4 additions & 0 deletions flang/test/Semantics/OpenMP/linear-clause01.f90
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,19 @@ end subroutine linear_clause_01

! Case 2
subroutine linear_clause_02(arg_01, arg_02)
!WARNING: The 'modifier(<list>)' syntax is deprecated in OpenMP v5.2, use '<list> : modifier' instead
!ERROR: The list item 'arg_01' specified without the REF 'linear-modifier' must be of INTEGER type
!$omp declare simd linear(val(arg_01))
real, intent(in) :: arg_01(:)

!WARNING: The 'modifier(<list>)' syntax is deprecated in OpenMP v5.2, use '<list> : modifier' instead
!ERROR: The list item 'arg_02' specified without the REF 'linear-modifier' must be of INTEGER type
!ERROR: If the `linear-modifier` is REF or UVAL, the list item 'arg_02' must be a dummy argument without the VALUE attribute
!$omp declare simd linear(uval(arg_02))
!ERROR: The type of 'arg_02' has already been implicitly declared
integer, value, intent(in) :: arg_02

!WARNING: The 'modifier(<list>)' syntax is deprecated in OpenMP v5.2, use '<list> : modifier' instead
!ERROR: The list item 'var' specified without the REF 'linear-modifier' must be of INTEGER type
!ERROR: If the `linear-modifier` is REF or UVAL, the list item 'var' must be a dummy argument without the VALUE attribute
!ERROR: The list item `var` must be a dummy argument
Expand All @@ -38,6 +41,7 @@ end subroutine linear_clause_02
! Case 3
subroutine linear_clause_03(arg)
integer, intent(in) :: arg
!WARNING: The 'modifier(<list>)' syntax is deprecated in OpenMP v5.2, use '<list> : modifier' instead
!ERROR: The list item `arg` specified with the REF 'linear-modifier' must be polymorphic variable, assumed-shape array, or a variable with the `ALLOCATABLE` attribute
!ERROR: List item 'arg' present at multiple LINEAR clauses
!ERROR: 'arg' appears in more than one data-sharing clause on the same OpenMP directive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2219,7 +2219,7 @@ convertOmpWsloop(Operation &opInst, llvm::IRBuilderBase &builder,

SmallVector<omp::DeclareReductionOp> reductionDecls;
collectReductionDecls(wsloopOp, reductionDecls);
llvm::OpenMPIRBuilder::InsertPointTy redAllocaIP =
llvm::OpenMPIRBuilder::InsertPointTy allocaIP =
findAllocaInsertPoint(builder, moduleTranslation);

SmallVector<llvm::Value *> privateReductionVariables(
Expand All @@ -2232,7 +2232,7 @@ convertOmpWsloop(Operation &opInst, llvm::IRBuilderBase &builder,

llvm::Expected<llvm::BasicBlock *> afterAllocas = allocatePrivateVars(
builder, moduleTranslation, privateBlockArgs, privateDecls,
mlirPrivateVars, llvmPrivateVars, redAllocaIP);
mlirPrivateVars, llvmPrivateVars, allocaIP);
if (handleError(afterAllocas, opInst).failed())
return failure();

Expand All @@ -2244,7 +2244,7 @@ convertOmpWsloop(Operation &opInst, llvm::IRBuilderBase &builder,
SmallVector<DeferredStore> deferredStores;

if (failed(allocReductionVars(wsloopOp, reductionArgs, builder,
moduleTranslation, redAllocaIP, reductionDecls,
moduleTranslation, allocaIP, reductionDecls,
privateReductionVariables, reductionVariableMap,
deferredStores, isByRef)))
return failure();
Expand Down Expand Up @@ -2300,8 +2300,6 @@ convertOmpWsloop(Operation &opInst, llvm::IRBuilderBase &builder,
return failure();

// Process the reductions if required.
llvm::OpenMPIRBuilder::InsertPointTy allocaIP =
findAllocaInsertPoint(builder, moduleTranslation);
if (failed(createReductionsAndCleanup(
wsloopOp, builder, moduleTranslation, allocaIP, reductionDecls,
privateReductionVariables, isByRef, wsloopOp.getNowait(),
Expand Down Expand Up @@ -4930,9 +4928,6 @@ convertOmpTarget(Operation &opInst, llvm::IRBuilderBase &builder,
if (!getTargetEntryUniqueInfo(entryInfo, targetOp, parentName))
return failure();

int32_t defaultValTeams = -1;
int32_t defaultValThreads = 0;

MapInfoData mapData;
collectMapDataFromMapOperands(mapData, mapVars, moduleTranslation, dl,
builder);
Expand Down
11 changes: 0 additions & 11 deletions mlir/test/Target/LLVMIR/openmp-todo.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -292,17 +292,6 @@ llvm.func @target_firstprivate(%x : !llvm.ptr) {

// -----

llvm.func @target_thread_limit(%x : i32) {
// expected-error@below {{not yet implemented: Unhandled clause thread_limit in omp.target operation}}
// expected-error@below {{LLVM Translation failed for operation: omp.target}}
omp.target thread_limit(%x : i32) {
omp.terminator
}
llvm.return
}

// -----

llvm.func @target_enter_data_depend(%x: !llvm.ptr) {
// expected-error@below {{not yet implemented: Unhandled clause depend in omp.target_enter_data operation}}
// expected-error@below {{LLVM Translation failed for operation: omp.target_enter_data}}
Expand Down

0 comments on commit 1c396f0

Please sign in to comment.