Compare commits

...
7 Commits
Author SHA1 Message Date
Hans Wennborg d5aa29cb3b Merging r325218:
------------------------------------------------------------------------
r325218 | hahnfeld | 2018-02-15 09:10:22 +0100 (Thu, 15 Feb 2018) | 10 lines

[CMake] Add -fno-experimental-isel for testing

GlobalISel doesn't yet implement blockaddress and falls back to
SelectionDAG. This results in additional branch instruction to
the next basic block which breaks the OMPT tests.
Disable GlobalISel for now when compiling the tests because fixing
them is not easily possible. See http://llvm.org/PR36313 for full
discussion history.

Differential Revision: https://reviews.llvm.org/D43195
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/openmp/branches/release_60@325230 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-15 11:00:24 +00:00
Dimitry Andric 3d85b5b4aa Merging r322869:
------------------------------------------------------------------------
r322869 | dim | 2018-01-18 19:24:22 +0100 (Thu, 18 Jan 2018) | 3 lines

Sprinkle a few <cstdlib> includes, for libomptarget sources using
malloc, free, alloca and getenv.  NFCI.

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/openmp/branches/release_60@323037 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-20 12:17:51 +00:00
Hans Wennborg f1a69ba0a0 Merging r322830:
------------------------------------------------------------------------
r322830 | hahnfeld | 2018-01-18 02:58:43 -0800 (Thu, 18 Jan 2018) | 1 line

Add missing headers for Debug builds
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/openmp/branches/release_60@322837 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-18 11:19:22 +00:00
Hans Wennborg 92d4fe5037 Merging r322160:
------------------------------------------------------------------------
r322160 | hahnfeld | 2018-01-10 00:10:23 -0800 (Wed, 10 Jan 2018) | 5 lines

[OMPT] Fix cast and printf of wait_id in lock test

This didn't work on 32 bit platforms.

Differential Revision: https://reviews.llvm.org/D41853
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/openmp/branches/release_60@322640 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-17 12:52:58 +00:00
Hans Wennborg 2d88abcec6 Merging r322068:
------------------------------------------------------------------------
r322068 | pawosm01 | 2018-01-09 02:54:06 -0800 (Tue, 09 Jan 2018) | 3 lines

Fix type mismatch in omp_control_tool() implementation that makes it run incorrectly on 32-bit machines.

Differential Revision: https://reviews.llvm.org/D41854
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/openmp/branches/release_60@322639 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-17 12:51:30 +00:00
Hans Wennborg b1dec7c481 Merging r321964:
------------------------------------------------------------------------
r321964 | hahnfeld | 2018-01-07 08:54:36 -0800 (Sun, 07 Jan 2018) | 7 lines

Correct types of pointers to doacross_num_done

This field is defined as kmp_int32, so we should use neither
pointers to kmp_int64 nor 64 bit atomic instructions.
(Found while testing on a Raspberry Pi, 32 bit ARM)

Differential Revision: https://reviews.llvm.org/D41656
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/openmp/branches/release_60@322560 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-16 15:18:22 +00:00
Hans Wennborg b3d58d09c4 Creating release_60 branch off revision 321711
git-svn-id: https://llvm.org/svn/llvm-project/openmp/branches/release_60@321723 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-03 14:54:54 +00:00
9 changed files with 33 additions and 7 deletions
+21 -1
View File
@@ -1,11 +1,14 @@
cmake_minimum_required(VERSION 2.8)
project(DetectTestCompiler C CXX)
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
function(write_compiler_information lang)
set(information "${CMAKE_${lang}_COMPILER}")
set(information "${information}\\;${CMAKE_${lang}_COMPILER_ID}")
set(information "${information}\\;${CMAKE_${lang}_COMPILER_VERSION}")
set(information "${information}\\;${OpenMP_${lang}_FLAGS}")
set(information "${information}\\;${${lang}_FLAGS}")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${lang}CompilerInformation.txt ${information})
endfunction(write_compiler_information)
@@ -15,5 +18,22 @@ if (NOT OpenMP_Found)
set(OpenMP_CXX_FLAGS "-fopenmp")
endif()
set(C_FLAGS ${flags} ${OpenMP_C_FLAGS})
set(CXX_FLAGS ${flags} ${OpenMP_CXX_FLAGS})
# TODO: Implement blockaddress in GlobalISel and remove this flag!
if (CMAKE_C_COMPILER_ID STREQUAL "Clang")
check_c_compiler_flag("-fno-experimental-isel" C_HAS_EXPERIMENTAL_ISEL_FLAG)
check_cxx_compiler_flag("-fno-experimental-isel" CXX_HAS_EXPERIMENTAL_ISEL_FLAG)
macro(add_experimental_isel_flag lang)
if (${lang}_HAS_EXPERIMENTAL_ISEL_FLAG)
set(${lang}_FLAGS "-fno-experimental-isel ${${lang}_FLAGS}")
endif()
endmacro(add_experimental_isel_flag)
add_experimental_isel_flag(C)
add_experimental_isel_flag(CXX)
endif()
write_compiler_information(C)
write_compiler_information(CXX)
+2 -1
View File
@@ -117,7 +117,8 @@ else()
# Cannot use CLANG_VERSION because we are not guaranteed that this is already set.
set(OPENMP_TEST_COMPILER_VERSION "${LLVM_VERSION}")
set(OPENMP_TEST_COMPILER_VERSION_MAJOR "${LLVM_MAJOR_VERSION}")
set(OPENMP_TEST_COMPILER_OPENMP_FLAGS "-fopenmp")
# TODO: Implement blockaddress in GlobalISel and remove this flag!
set(OPENMP_TEST_COMPILER_OPENMP_FLAGS "-fopenmp -fno-experimental-isel")
endif()
# Function to set compiler features for use in lit.
+1
View File
@@ -19,6 +19,7 @@
#include <climits>
#include <cstring>
#include <cstdlib>
EXTERN int omp_get_num_devices(void) {
RTLsMtx.lock();
+1
View File
@@ -19,6 +19,7 @@
#include "rtl.h"
#include <cassert>
#include <cstdlib>
////////////////////////////////////////////////////////////////////////////////
/// adds a target shared library to the target execution image
+2
View File
@@ -16,9 +16,11 @@
#include "rtl.h"
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <dlfcn.h>
#include <mutex>
#include <string>
// List of all plugins that can support offloading.
static const char *RTLNames[] = {
+1
View File
@@ -17,6 +17,7 @@
#include <list>
#include <map>
#include <mutex>
#include <string>
#include <vector>
// Forward declarations.
+3 -3
View File
@@ -4032,7 +4032,7 @@ void __kmpc_doacross_post(ident_t *loc, int gtid, long long *vec) {
}
void __kmpc_doacross_fini(ident_t *loc, int gtid) {
kmp_int64 num_done;
kmp_int32 num_done;
kmp_info_t *th = __kmp_threads[gtid];
kmp_team_t *team = th->th.th_team;
kmp_disp_t *pr_buf = th->th.th_dispatch;
@@ -4042,7 +4042,7 @@ void __kmpc_doacross_fini(ident_t *loc, int gtid) {
KA_TRACE(20, ("__kmpc_doacross_fini() exit: serialized team %p\n", team));
return; // nothing to do
}
num_done = KMP_TEST_THEN_INC64((kmp_int64 *)pr_buf->th_doacross_info[1]) + 1;
num_done = KMP_TEST_THEN_INC32((kmp_int32 *)pr_buf->th_doacross_info[1]) + 1;
if (num_done == th->th.th_team_nproc) {
// we are the last thread, need to free shared resources
int idx = pr_buf->th_doacross_buf_idx - 1;
@@ -4050,7 +4050,7 @@ void __kmpc_doacross_fini(ident_t *loc, int gtid) {
&team->t.t_disp_buffer[idx % __kmp_dispatch_num_buffers];
KMP_DEBUG_ASSERT(pr_buf->th_doacross_info[1] ==
(kmp_int64)&sh_buf->doacross_num_done);
KMP_DEBUG_ASSERT(num_done == (kmp_int64)sh_buf->doacross_num_done);
KMP_DEBUG_ASSERT(num_done == sh_buf->doacross_num_done);
KMP_DEBUG_ASSERT(idx == sh_buf->doacross_buf_idx);
__kmp_thread_free(th, CCAST(kmp_uint32 *, sh_buf->doacross_flags));
sh_buf->doacross_flags = NULL;
+1 -1
View File
@@ -345,7 +345,7 @@ int FTN_STDCALL KMP_EXPAND_NAME(FTN_GET_MAX_THREADS)(void) {
}
#if OMP_50_ENABLED
int FTN_STDCALL FTN_CONTROL_TOOL(uint64_t command, uint64_t modifier,
int FTN_STDCALL FTN_CONTROL_TOOL(int command, int modifier,
void *arg) {
#if defined(KMP_STUB) || !OMPT_SUPPORT
return -2;
+1 -1
View File
@@ -10,7 +10,7 @@ int main()
print_ids(0);
omp_lock_t lock;
printf("%" PRIu64 ": &lock: %lli\n", ompt_get_thread_data()->value, (long long) &lock);
printf("%" PRIu64 ": &lock: %" PRIu64 "\n", ompt_get_thread_data()->value, (uint64_t) &lock);
omp_init_lock(&lock);
print_current_address(1);
omp_set_lock(&lock);