Skip to content

Commit dc26b73

Browse files
author
Lakshmi Surekha Kovvuri
committed
Merge branch 'gh-101657' of github.com:DhruvSrivastavaX/lldb-for-aix into gh-101657
2 parents 0943a37 + cbc5033 commit dc26b73

File tree

71 files changed

+527
-320
lines changed

Some content is hidden

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

71 files changed

+527
-320
lines changed

clang/include/clang/Basic/arm_sve.td

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,9 @@ def SVRSQRTS : SInst<"svrsqrts[_{d}]", "ddd", "hfd", MergeNone, "aarch64_sve_frs
880880
////////////////////////////////////////////////////////////////////////////////
881881
// Floating-point reductions
882882

883-
def SVFADDA : SInst<"svadda[_{d}]", "sPsd", "hfd", MergeNone, "aarch64_sve_fadda", [VerifyRuntimeMode]>;
883+
let SVETargetGuard = "sve", SMETargetGuard = InvalidMode in {
884+
def SVFADDA : SInst<"svadda[_{d}]", "sPsd", "hfd", MergeNone, "aarch64_sve_fadda">;
885+
}
884886
def SVFADDV : SInst<"svaddv[_{d}]", "sPd", "hfd", MergeNone, "aarch64_sve_faddv", [VerifyRuntimeMode]>;
885887
def SVFMAXV : SInst<"svmaxv[_{d}]", "sPd", "hfd", MergeNone, "aarch64_sve_fmaxv", [VerifyRuntimeMode]>;
886888
def SVFMAXNMV : SInst<"svmaxnmv[_{d}]", "sPd", "hfd", MergeNone, "aarch64_sve_fmaxnmv", [VerifyRuntimeMode]>;

clang/lib/CodeGen/CGStmtOpenMP.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5556,12 +5556,14 @@ void CodeGenFunction::EmitOMPDepobjDirective(const OMPDepobjDirective &S) {
55565556
const auto *DO = S.getSingleClause<OMPDepobjClause>();
55575557
LValue DOLVal = EmitLValue(DO->getDepobj());
55585558
if (const auto *DC = S.getSingleClause<OMPDependClause>()) {
5559-
OMPTaskDataTy::DependData Dependencies(DC->getDependencyKind(),
5560-
DC->getModifier());
5561-
Dependencies.DepExprs.append(DC->varlist_begin(), DC->varlist_end());
5562-
Address DepAddr = CGM.getOpenMPRuntime().emitDepobjDependClause(
5563-
*this, Dependencies, DC->getBeginLoc());
5564-
EmitStoreOfScalar(DepAddr.emitRawPointer(*this), DOLVal);
5559+
// Build list and emit dependences
5560+
OMPTaskDataTy Data;
5561+
buildDependences(S, Data);
5562+
for (auto &Dep : Data.Dependences) {
5563+
Address DepAddr = CGM.getOpenMPRuntime().emitDepobjDependClause(
5564+
*this, Dep, DC->getBeginLoc());
5565+
EmitStoreOfScalar(DepAddr.emitRawPointer(*this), DOLVal);
5566+
}
55655567
return;
55665568
}
55675569
if (const auto *DC = S.getSingleClause<OMPDestroyClause>()) {

clang/lib/Headers/openmp_wrappers/complex_cmath.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,13 @@ template <class _Tp> __DEVICE__ _Tp norm(const std::complex<_Tp> &__c) {
6464
}
6565

6666
// conj
67-
68-
template <class _Tp> std::complex<_Tp> conj(const std::complex<_Tp> &__c) {
67+
#ifdef _GLIBCXX20_CONSTEXPR
68+
#define CXX20_CONSTEXPR_DEVICE __DEVICE__
69+
#else
70+
#define CXX20_CONSTEXPR_DEVICE
71+
#endif
72+
template <class _Tp>
73+
CXX20_CONSTEXPR_DEVICE std::complex<_Tp> conj(const std::complex<_Tp> &__c) {
6974
return std::complex<_Tp>(__c.real(), -__c.imag());
7075
}
7176

clang/test/OpenMP/depobj_codegen.cpp

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@
1717
typedef void *omp_depend_t;
1818

1919
void foo() {}
20+
void tmainc(){
21+
omp_depend_t obj;
22+
#pragma omp depobj(obj) depend(inout: omp_all_memory)
23+
{
24+
volatile omp_depend_t temp = obj;
25+
char* char_ptr = reinterpret_cast<char*>(temp);
26+
char_ptr[0] = 1;
27+
}
28+
}
2029

2130
template <class T>
2231
T tmain(T argc) {
@@ -35,10 +44,25 @@ int main(int argc, char **argv) {
3544
#pragma omp depobj(b) destroy
3645
#pragma omp depobj(b) update(mutexinoutset)
3746
#pragma omp depobj(a) depend(iterator(char *p = argv[argc]:argv[0]:-1), out: p[0])
38-
(void)tmain(a), tmain(b);
47+
(void)tmain(a), tmain(b);
48+
tmainc();
3949
return 0;
4050
}
41-
51+
// CHECK-LABEL: tmainc
52+
// CHECK: [[D_ADDR:%obj]] = alloca ptr,
53+
// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(
54+
// CHECK: [[DEP_ADDR_ADDR2:%.+]] = call ptr @__kmpc_alloc(i32 [[GTID]], i64 48, ptr null)
55+
// CHECK: [[SZ_DEOOBJ:%.+]] = getelementptr inbounds nuw %struct.kmp_depend_info, ptr [[DEP_ADDR_ADDR2]], i{{.+}} 0, i{{.+}} 0
56+
// CHECK: store i64 1, ptr [[SZ_DEOOBJ]], align 8
57+
// CHECK: [[DEPOBJ_BASE_ADDR:%.+]] = getelementptr %struct.kmp_depend_info, ptr [[DEP_ADDR_ADDR2]], i{{.+}} 1
58+
// CHECK: [[ADDR_ONE:%.+]] = getelementptr inbounds nuw %struct.kmp_depend_info, ptr [[DEPOBJ_BASE_ADDR]], i{{.+}} 0, i{{.+}} 0
59+
// CHECK: store i64 0, ptr [[ADDR_ONE]], align 8
60+
// CHECK: [[SZ_ADDR:%.+]] = getelementptr inbounds nuw %struct.kmp_depend_info, ptr [[DEPOBJ_BASE_ADDR]], i{{.+}} 0, i{{.+}} 1
61+
// CHECK: store i64 0, ptr [[SZ_ADDR]], align 8
62+
// CHECK: [[SZ_ADDR_NEW:%.+]] = getelementptr inbounds nuw %struct.kmp_depend_info, ptr [[DEPOBJ_BASE_ADDR]], i{{.+}} 0, i{{.+}} 2
63+
// CHECK: store {{i[0-9]+}} {{-?[0-9]+}}, ptr [[SZ_ADDR_NEW]], align 8
64+
// CHECK: [[DEP_NEW:%.+]] = getelementptr %struct.kmp_depend_info, ptr [[DEP_ADDR_ADDR2]], i{{.+}} 1
65+
// CHECK: store ptr [[DEP_NEW]], ptr [[D_ADDR]], align 8
4266
// CHECK-LABEL: @main
4367
// CHECK: [[B_ADDR:%b]] = alloca ptr,
4468
// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(
@@ -69,6 +93,8 @@ int main(int argc, char **argv) {
6993
// CHECK: [[NUMDEPS_ADDR:%.+]] = getelementptr inbounds nuw %struct.kmp_depend_info, ptr [[NUMDEPS_BASE]], i{{.+}} 0, i{{.+}} 0
7094
// CHECK: [[NUMDEPS:%.+]] = load i64, ptr [[NUMDEPS_ADDR]], align 8
7195
// CHECK: [[END:%.+]] = getelementptr %struct.kmp_depend_info, ptr [[B_BASE]], i64 [[NUMDEPS]]
96+
97+
7298
// CHECK: br label %[[BODY:.+]]
7399
// CHECK: [[BODY]]:
74100
// CHECK: [[EL:%.+]] = phi ptr [ [[B_BASE]], %{{.+}} ], [ [[EL_NEXT:%.+]], %[[BODY]] ]
@@ -228,6 +254,8 @@ int main(int argc, char **argv) {
228254
// CHECK: [[EL_NEXT]] = getelementptr %struct.kmp_depend_info, ptr [[EL]], i{{.+}} 1
229255
// CHECK: [[IS_DONE:%.+]] = icmp eq ptr [[EL_NEXT]], [[END]]
230256
// CHECK: br i1 [[IS_DONE]], label %[[DONE:.+]], label %[[BODY]]
257+
231258
// CHECK: [[DONE]]:
232259

260+
233261
#endif

clang/test/Sema/aarch64-incompat-sm-builtin-calls.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ void incompat_sme_smc(svbool_t pg, void const *ptr) __arm_streaming_compatible _
2828
return __builtin_sme_svld1_hor_za128(0, 0, pg, ptr);
2929
}
3030

31+
float incomp_sve_sm_fadda_sm(void) __arm_streaming {
32+
// expected-error@+1 {{builtin can only be called from a non-streaming function}}
33+
return svadda(svptrue_b32(), 0, svdup_f32(1));
34+
}
35+
36+
float incomp_sve_sm_fadda_smc(void) __arm_streaming_compatible {
37+
// expected-error@+1 {{builtin can only be called from a non-streaming function}}
38+
return svadda(svptrue_b32(), 0, svdup_f32(1));
39+
}
40+
3141
svuint32_t incompat_sve_sm(svbool_t pg, svuint32_t a, int16_t b) __arm_streaming {
3242
// expected-error@+1 {{builtin can only be called from a non-streaming function}}
3343
return __builtin_sve_svld1_gather_u32base_index_u32(pg, a, b);

clang/test/SemaCXX/class-layout.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ namespace PR37275 {
639639
#pragma pack(pop)
640640
}
641641

642-
#endif // !defined(__MVS__) && !defined(__AIX__)
642+
#endif // !defined(__MVS__) && !defined(_AIX)
643643

644644
namespace non_pod {
645645
struct t1 {

lldb/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ endif()
3838
include(LLDBConfig)
3939
include(AddLLDB)
4040

41-
if (UNIX AND ${CMAKE_SYSTEM_NAME} MATCHES "AIX")
42-
add_definitions("-D__AIX__")
43-
endif()
44-
4541
# Define the LLDB_CONFIGURATION_xxx matching the build type.
4642
if(uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
4743
add_definitions(-DLLDB_CONFIGURATION_DEBUG)

lldb/include/lldb/Host/HostGetOpt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#ifndef LLDB_HOST_HOSTGETOPT_H
1010
#define LLDB_HOST_HOSTGETOPT_H
1111

12-
#if !defined(_MSC_VER) && !defined(__NetBSD__) && !defined(__AIX__)
12+
#if !defined(_MSC_VER) && !defined(__NetBSD__) && !defined(_AIX)
1313

1414
#include <getopt.h>
1515
#include <unistd.h>

lldb/include/lldb/Host/HostInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
#elif defined(__APPLE__)
5656
#include "lldb/Host/macosx/HostInfoMacOSX.h"
5757
#define HOST_INFO_TYPE HostInfoMacOSX
58-
#elif defined(__AIX__)
58+
#elif defined(_AIX)
5959
#include "lldb/Host/aix/HostInfoAIX.h"
6060
#define HOST_INFO_TYPE HostInfoAIX
6161
#else

lldb/include/lldb/Host/XML.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include "lldb/Host/Config.h"
1313

14-
#if defined(__AIX__)
14+
#if defined(_AIX)
1515
//FIXME for AIX
1616
#undef LLDB_ENABLE_LIBXML2
1717
#endif

0 commit comments

Comments
 (0)