[Openmp-commits] [openmp] Add openmp support to System z (PR #66081)
Neale Ferguson via Openmp-commits
openmp-commits at lists.llvm.org
Tue Oct 31 09:01:30 PDT 2023
nealef wrote:
I'm still a little confused as to what should go in. Were any of the above in a separate PR? Here's what I have to commit at the moment. It doesn't have the frame pointer suggestions because I couldn't work out if they were going in separately.
```
diff --git a/llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp b/llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp
index 7a3a2a7e9013..6abb203f0c36 100644
--- a/llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp
@@ -226,6 +226,8 @@ void SystemZPassConfig::addIRPasses() {
addPass(createLoopDataPrefetchPass());
}
+ addPass(createAtomicExpandPass());
+
TargetPassConfig::addIRPasses();
}
diff --git a/openmp/runtime/src/kmp.h b/openmp/runtime/src/kmp.h
index 339e4ca4be6b..4397565e8f47 100644
--- a/openmp/runtime/src/kmp.h
+++ b/openmp/runtime/src/kmp.h
@@ -2456,12 +2456,21 @@ typedef struct kmp_depend_info {
union {
kmp_uint8 flag; // flag as an unsigned char
struct { // flag as a set of 8 bits
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+ unsigned all : 1;
+ unsigned unused : 3;
+ unsigned set : 1;
+ unsigned mtx : 1;
+ unsigned out : 1;
+ unsigned in : 1;
+#else
unsigned in : 1;
unsigned out : 1;
unsigned mtx : 1;
unsigned set : 1;
unsigned unused : 3;
unsigned all : 1;
+#endif
} flags;
};
} kmp_depend_info_t;
diff --git a/openmp/runtime/src/z_Linux_asm.S b/openmp/runtime/src/z_Linux_asm.S
index 3533ef2d14ec..a72705528d41 100644
--- a/openmp/runtime/src/z_Linux_asm.S
+++ b/openmp/runtime/src/z_Linux_asm.S
@@ -2310,9 +2310,18 @@ __kmp_invoke_microtask:
.cfi_startproc
stmg %r6,%r14,48(%r15)
+ .cfi_offset %r6, -112
+ .cfi_offset %r7, -104
+ .cfi_offset %r8, -96
+ .cfi_offset %r9, -88
+ .cfi_offset %r10, -80
+ .cfi_offset %r11, -72
+ .cfi_offset %r12, -64
+ .cfi_offset %r13, -56
+ .cfi_offset %r14, -48
+ .cfi_offset %r15, -40
lgr %r11,%r15
- .cfi_def_cfa %r15, 0
- .cfi_offset %r15, 0
+ .cfi_def_cfa %r11, 160
// Compute the dynamic stack size:
//
@@ -2342,7 +2351,7 @@ __kmp_invoke_microtask:
#if OMPT_SUPPORT
// Save frame pointer into exit_frame
lg %r8,160(%r11)
- stg %r15,0(%r8)
+ stg %r11,0(%r8)
#endif
// Prepare arguments for the pkfn function (first 5 using r2-r6 registers)
diff --git a/openmp/runtime/test/ompt/callback.h b/openmp/runtime/test/ompt/callback.h
index 8e9bab363b16..efbd4c716e0e 100644
--- a/openmp/runtime/test/ompt/callback.h
+++ b/openmp/runtime/test/ompt/callback.h
@@ -232,10 +232,18 @@ ompt_label_##id:
// On s390x the NOP instruction is 2 bytes long. For non-void runtime
// functions Clang inserts a STY instruction (but only if compiling under
// -fno-PIC which will be the default with Clang 8.0, another 6 bytes).
+//
+// Another possibility is:
+//
+// brasl %r14,__kmpc_end_master at plt
+// a7 f4 00 02 j 0f
+// 47 00 00 00 0: nop
+// a7 f4 00 02 j addr
+// addr:
#define print_possible_return_addresses(addr) \
- printf("%" PRIu64 ": current_address=%p or %p\n", \
+ printf("%" PRIu64 ": current_address=%p or %p or %p\n", \
ompt_get_thread_data()->value, ((char *)addr) - 2, \
- ((char *)addr) - 8)
+ ((char *)addr) - 8, ((char *)addr) - 12)
#else
#error Unsupported target architecture, cannot determine address offset!
#endif
```
What's missing or what should be excluded?
https://github.com/llvm/llvm-project/pull/66081
More information about the Openmp-commits
mailing list