Skip to content

Commit 09c430c

Browse files
SC llvm teamSC llvm team
SC llvm team
authored and
SC llvm team
committed
Merged main:cbe583b0bd8d into amd-gfx:2cf84b60928b
Local branch amd-gfx 2cf84b6 Manually merged main:cea738bc9a9e into amd-gfx:0756140e2ff7 Remote branch main cbe583b [Flang] Add translation support for MutexInOutSet and InOutSet (llvm#120715)
2 parents 2cf84b6 + cbe583b commit 09c430c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+382
-317
lines changed

flang/lib/Lower/OpenMP/ClauseProcessor.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,13 @@ genDependKindAttr(lower::AbstractConverter &converter,
153153
pbKind = mlir::omp::ClauseTaskDepend::taskdependinout;
154154
break;
155155
case omp::clause::DependenceType::Mutexinoutset:
156+
pbKind = mlir::omp::ClauseTaskDepend::taskdependmutexinoutset;
157+
break;
156158
case omp::clause::DependenceType::Inoutset:
159+
pbKind = mlir::omp::ClauseTaskDepend::taskdependinoutset;
160+
break;
157161
case omp::clause::DependenceType::Depobj:
158-
TODO(currentLocation,
159-
"INOUTSET, MUTEXINOUTSET and DEPOBJ dependence-types");
162+
TODO(currentLocation, "DEPOBJ dependence-type");
160163
break;
161164
case omp::clause::DependenceType::Sink:
162165
case omp::clause::DependenceType::Source:

flang/test/Lower/OpenMP/Todo/depend-clause-depobj.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
!RUN: %not_todo_cmd bbc -emit-hlfir -fopenmp -fopenmp-version=52 -o - %s 2>&1 | FileCheck %s
22
!RUN: %not_todo_cmd %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 -o - %s 2>&1 | FileCheck %s
33

4-
!CHECK: not yet implemented: INOUTSET, MUTEXINOUTSET and DEPOBJ dependence-types
4+
!CHECK: not yet implemented: DEPOBJ dependence-type
55

66
subroutine f00(x)
77
integer :: x

flang/test/Lower/OpenMP/Todo/depend-clause-inoutset.f90

Lines changed: 0 additions & 11 deletions
This file was deleted.

flang/test/Lower/OpenMP/Todo/depend-clause-mutexinoutset.f90

Lines changed: 0 additions & 11 deletions
This file was deleted.

flang/test/Lower/OpenMP/task.f90

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,18 @@ subroutine task_depend_multi_task()
144144
x = x + 12
145145
!CHECK: omp.terminator
146146
!$omp end task
147+
!CHECK: omp.task depend(taskdependmutexinoutset -> %{{.+}} : !fir.ref<i32>)
148+
!$omp task depend(mutexinoutset : x)
149+
!CHECK: arith.subi
150+
x = x - 12
151+
!CHECK: omp.terminator
152+
!$omp end task
153+
!CHECK: omp.task depend(taskdependinoutset -> %{{.+}} : !fir.ref<i32>)
154+
!$omp task depend(inoutset : x)
155+
!CHECK: arith.subi
156+
x = x - 12
157+
!CHECK: omp.terminator
158+
!$omp end task
147159
end subroutine task_depend_multi_task
148160

149161
!===============================================================================

libc/cmake/modules/CheckCompilerFeatures.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ set(
1313
"float16_conversion"
1414
"float128"
1515
"fixed_point"
16+
"cfloat16"
17+
"cfloat128"
1618
)
1719

1820
# Making sure ALL_COMPILER_FEATURES is sorted.
@@ -110,6 +112,10 @@ foreach(feature IN LISTS ALL_COMPILER_FEATURES)
110112
set(LIBC_TYPES_HAS_FLOAT128 TRUE)
111113
elseif(${feature} STREQUAL "fixed_point")
112114
set(LIBC_COMPILER_HAS_FIXED_POINT TRUE)
115+
elseif(${feature} STREQUAL "cfloat16")
116+
set(LIBC_TYPES_HAS_CFLOAT16 TRUE)
117+
elseif(${feature} STREQUAL "cfloat128")
118+
set(LIBC_TYPES_HAS_CFLOAT128 TRUE)
113119
elseif(${feature} STREQUAL "builtin_ceil_floor_rint_trunc")
114120
set(LIBC_COMPILER_HAS_BUILTIN_CEIL_FLOOR_RINT_TRUNC TRUE)
115121
elseif(${feature} STREQUAL "builtin_fmax_fmin")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#include "src/__support/macros/properties/complex_types.h"
2+
3+
#ifndef LIBC_TYPES_HAS_CFLOAT128
4+
#error unsupported
5+
#endif
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#include "src/__support/macros/properties/complex_types.h"
2+
3+
#ifndef LIBC_TYPES_HAS_CFLOAT16
4+
#error unsupported
5+
#endif

libc/config/linux/aarch64/entrypoints.txt

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -619,14 +619,18 @@ set(TARGET_LIBM_ENTRYPOINTS
619619
libc.src.math.ufromfpxl
620620
)
621621

622-
if(LIBC_TYPES_HAS_FLOAT16)
622+
if(LIBC_TYPES_HAS_CFLOAT16)
623623
list(APPEND TARGET_LIBM_ENTRYPOINTS
624624
# complex.h C23 _Complex _Float16 entrypoints
625-
# libc.src.complex.crealf16
626-
# libc.src.complex.cimagf16
627-
# libc.src.complex.conjf16
628-
# libc.src.complex.cprojf16
629-
625+
libc.src.complex.crealf16
626+
libc.src.complex.cimagf16
627+
libc.src.complex.conjf16
628+
libc.src.complex.cprojf16
629+
)
630+
endif()
631+
632+
if(LIBC_TYPES_HAS_FLOAT16)
633+
list(APPEND TARGET_LIBM_ENTRYPOINTS
630634
# math.h C23 _Float16 entrypoints
631635
libc.src.math.canonicalizef16
632636
libc.src.math.ceilf16
@@ -726,14 +730,18 @@ if(LIBC_TYPES_HAS_FLOAT16)
726730
# endif()
727731
endif()
728732

729-
if(LIBC_TYPES_HAS_FLOAT128)
733+
if(LIBC_TYPES_HAS_CFLOAT128)
730734
list(APPEND TARGET_LIBM_ENTRYPOINTS
731735
# complex.h C23 _Complex _Float128 entrypoints
732736
libc.src.complex.crealf128
733737
libc.src.complex.cimagf128
734738
libc.src.complex.conjf128
735739
libc.src.complex.cprojf128
740+
)
741+
endif()
736742

743+
if(LIBC_TYPES_HAS_FLOAT128)
744+
list(APPEND TARGET_LIBM_ENTRYPOINTS
737745
# math.h C23 _Float128 entrypoints
738746
libc.src.math.canonicalizef128
739747
libc.src.math.ceilf128

libc/config/linux/riscv/entrypoints.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,14 +620,18 @@ set(TARGET_LIBM_ENTRYPOINTS
620620
libc.src.math.ufromfpxl
621621
)
622622

623-
if(LIBC_TYPES_HAS_FLOAT128)
623+
if(LIBC_TYPES_HAS_CFLOAT128)
624624
list(APPEND TARGET_LIBM_ENTRYPOINTS
625625
# complex.h C23 _Complex _Float128 entrypoints
626626
libc.src.complex.crealf128
627627
libc.src.complex.cimagf128
628628
libc.src.complex.conjf128
629629
libc.src.complex.cprojf128
630-
630+
)
631+
endif()
632+
633+
if(LIBC_TYPES_HAS_FLOAT128)
634+
list(APPEND TARGET_LIBM_ENTRYPOINTS
631635
# math.h C23 _Float128 entrypoints
632636
libc.src.math.canonicalizef128
633637
libc.src.math.ceilf128

libc/config/linux/x86_64/entrypoints.txt

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -624,14 +624,18 @@ set(TARGET_LIBM_ENTRYPOINTS
624624
libc.src.math.ufromfpxl
625625
)
626626

627-
if(LIBC_TYPES_HAS_FLOAT16)
627+
if(LIBC_TYPES_HAS_CFLOAT16)
628628
list(APPEND TARGET_LIBM_ENTRYPOINTS
629629
# complex.h C23 _Complex _Float16 entrypoints
630630
libc.src.complex.crealf16
631631
libc.src.complex.cimagf16
632632
libc.src.complex.conjf16
633633
libc.src.complex.cprojf16
634+
)
635+
endif()
634636

637+
if(LIBC_TYPES_HAS_FLOAT16)
638+
list(APPEND TARGET_LIBM_ENTRYPOINTS
635639
# math.h C23 _Float16 entrypoints
636640
libc.src.math.canonicalizef16
637641
libc.src.math.ceilf16
@@ -736,14 +740,18 @@ if(LIBC_TYPES_HAS_FLOAT16)
736740
endif()
737741
endif()
738742

739-
if(LIBC_TYPES_HAS_FLOAT128)
743+
if(LIBC_TYPES_HAS_CFLOAT128)
740744
list(APPEND TARGET_LIBM_ENTRYPOINTS
741745
# complex.h C23 _Complex _Float128 entrypoints
742-
# libc.src.complex.crealf128
743-
# libc.src.complex.cimagf128
744-
# libc.src.complex.conjf128
745-
# libc.src.complex.cprojf128
746-
746+
libc.src.complex.crealf128
747+
libc.src.complex.cimagf128
748+
libc.src.complex.conjf128
749+
libc.src.complex.cprojf128
750+
)
751+
endif()
752+
753+
if(LIBC_TYPES_HAS_FLOAT128)
754+
list(APPEND TARGET_LIBM_ENTRYPOINTS
747755
# math.h C23 _Float128 entrypoints
748756
libc.src.math.canonicalizef128
749757
libc.src.math.ceilf128

libc/src/complex/cimagf128.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "src/__support/macros/properties/complex_types.h"
10-
#include "src/__support/macros/properties/types.h"
11-
12-
#if defined(LIBC_TYPES_HAS_CFLOAT128)
13-
149
#ifndef LLVM_LIBC_SRC_COMPLEX_CIMAGF128_H
1510
#define LLVM_LIBC_SRC_COMPLEX_CIMAGF128_H
1611

1712
#include "src/__support/macros/config.h"
13+
#include "src/__support/macros/properties/complex_types.h"
14+
#include "src/__support/macros/properties/types.h"
1815

1916
namespace LIBC_NAMESPACE_DECL {
2017

@@ -23,5 +20,3 @@ float128 cimagf128(cfloat128 x);
2320
} // namespace LIBC_NAMESPACE_DECL
2421

2522
#endif // LLVM_LIBC_SRC_COMPLEX_CIMAGF128_H
26-
27-
#endif // LIBC_TYPES_HAS_CFLOAT128

libc/src/complex/cimagf16.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "src/__support/macros/properties/complex_types.h"
10-
#include "src/__support/macros/properties/types.h"
11-
12-
#if defined(LIBC_TYPES_HAS_CFLOAT16)
13-
149
#ifndef LLVM_LIBC_SRC_COMPLEX_CIMAGF16_H
1510
#define LLVM_LIBC_SRC_COMPLEX_CIMAGF16_H
1611

1712
#include "src/__support/macros/config.h"
13+
#include "src/__support/macros/properties/complex_types.h"
14+
#include "src/__support/macros/properties/types.h"
1815

1916
namespace LIBC_NAMESPACE_DECL {
2017

@@ -23,5 +20,3 @@ float16 cimagf16(cfloat16 x);
2320
} // namespace LIBC_NAMESPACE_DECL
2421

2522
#endif // LLVM_LIBC_SRC_COMPLEX_CIMAGF16_H
26-
27-
#endif // LIBC_TYPES_HAS_CFLOAT16

libc/src/complex/conjf128.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "src/__support/macros/properties/complex_types.h"
10-
11-
#if defined(LIBC_TYPES_HAS_CFLOAT128)
12-
139
#ifndef LLVM_LIBC_SRC_COMPLEX_CONJF128_H
1410
#define LLVM_LIBC_SRC_COMPLEX_CONJF128_H
1511

1612
#include "src/__support/macros/config.h"
13+
#include "src/__support/macros/properties/complex_types.h"
1714

1815
namespace LIBC_NAMESPACE_DECL {
1916

@@ -22,5 +19,3 @@ cfloat128 conjf128(cfloat128 x);
2219
} // namespace LIBC_NAMESPACE_DECL
2320

2421
#endif // LLVM_LIBC_SRC_COMPLEX_CONJF128_H
25-
26-
#endif // LIBC_TYPES_HAS_CFLOAT128

libc/src/complex/conjf16.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "src/__support/macros/properties/complex_types.h"
10-
11-
#if defined(LIBC_TYPES_HAS_CFLOAT16)
12-
139
#ifndef LLVM_LIBC_SRC_COMPLEX_CONJF16_H
1410
#define LLVM_LIBC_SRC_COMPLEX_CONJF16_H
1511

1612
#include "src/__support/macros/config.h"
13+
#include "src/__support/macros/properties/complex_types.h"
1714

1815
namespace LIBC_NAMESPACE_DECL {
1916

@@ -22,5 +19,3 @@ cfloat16 conjf16(cfloat16 x);
2219
} // namespace LIBC_NAMESPACE_DECL
2320

2421
#endif // LLVM_LIBC_SRC_COMPLEX_CONJF16_H
25-
26-
#endif // LIBC_TYPES_HAS_CFLOAT16

libc/src/complex/cprojf128.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "src/__support/macros/properties/complex_types.h"
10-
11-
#if defined(LIBC_TYPES_HAS_CFLOAT128)
12-
139
#ifndef LLVM_LIBC_SRC_COMPLEX_CPROJF128_H
1410
#define LLVM_LIBC_SRC_COMPLEX_CPROJF128_H
1511

1612
#include "src/__support/macros/config.h"
13+
#include "src/__support/macros/properties/complex_types.h"
1714

1815
namespace LIBC_NAMESPACE_DECL {
1916

@@ -22,5 +19,3 @@ cfloat128 cprojf128(cfloat128 x);
2219
} // namespace LIBC_NAMESPACE_DECL
2320

2421
#endif // LLVM_LIBC_SRC_COMPLEX_CPROJF128_H
25-
26-
#endif // LIBC_TYPES_HAS_CFLOAT128

libc/src/complex/cprojf16.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "src/__support/macros/properties/complex_types.h"
10-
11-
#if defined(LIBC_TYPES_HAS_CFLOAT16)
12-
139
#ifndef LLVM_LIBC_SRC_COMPLEX_CPROJF16_H
1410
#define LLVM_LIBC_SRC_COMPLEX_CPROJF16_H
1511

1612
#include "src/__support/macros/config.h"
13+
#include "src/__support/macros/properties/complex_types.h"
1714

1815
namespace LIBC_NAMESPACE_DECL {
1916

@@ -22,5 +19,3 @@ cfloat16 cprojf16(cfloat16 x);
2219
} // namespace LIBC_NAMESPACE_DECL
2320

2421
#endif // LLVM_LIBC_SRC_COMPLEX_CPROJF16_H
25-
26-
#endif // LIBC_TYPES_HAS_CFLOAT16

libc/src/complex/crealf128.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "src/__support/macros/properties/complex_types.h"
10-
#include "src/__support/macros/properties/types.h"
11-
12-
#if defined(LIBC_TYPES_HAS_CFLOAT128)
13-
149
#ifndef LLVM_LIBC_SRC_COMPLEX_CREALF128_H
1510
#define LLVM_LIBC_SRC_COMPLEX_CREALF128_H
1611

1712
#include "src/__support/macros/config.h"
13+
#include "src/__support/macros/properties/complex_types.h"
14+
#include "src/__support/macros/properties/types.h"
1815

1916
namespace LIBC_NAMESPACE_DECL {
2017

@@ -23,5 +20,3 @@ float128 crealf128(cfloat128 x);
2320
} // namespace LIBC_NAMESPACE_DECL
2421

2522
#endif // LLVM_LIBC_SRC_COMPLEX_CREALF128_H
26-
27-
#endif // LIBC_TYPES_HAS_CFLOAT128

libc/src/complex/crealf16.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "src/__support/macros/properties/complex_types.h"
10-
#include "src/__support/macros/properties/types.h"
11-
12-
#if defined(LIBC_TYPES_HAS_CFLOAT16)
13-
149
#ifndef LLVM_LIBC_SRC_COMPLEX_CREALF16_H
1510
#define LLVM_LIBC_SRC_COMPLEX_CREALF16_H
1611

1712
#include "src/__support/macros/config.h"
13+
#include "src/__support/macros/properties/complex_types.h"
14+
#include "src/__support/macros/properties/types.h"
1815

1916
namespace LIBC_NAMESPACE_DECL {
2017

@@ -23,5 +20,3 @@ float16 crealf16(cfloat16 x);
2320
} // namespace LIBC_NAMESPACE_DECL
2421

2522
#endif // LLVM_LIBC_SRC_COMPLEX_CREALF16_H
26-
27-
#endif // LIBC_TYPES_HAS_CFLOAT16

0 commit comments

Comments
 (0)