Skip to content
Branch: master
Commits on Dec 7, 2019
  1. [OpenMP] Require trivially copyable type for mapping

    hahnjo committed Dec 7, 2019
    A trivially copyable type provides a trivial copy constructor and a trivial
    copy assignment operator. This is enough for the runtime to memcpy the data
    to the device. Additionally there must be no virtual functions or virtual
    base classes and the destructor is guaranteed to be trivial, ie performs
    no action.
    The runtime does not require trivial default constructors because on alloc
    the memory is undefined. Thus, weaken the warning to be only issued if the
    mapped type is not trivially copyable.
    Differential Revision:
Commits on Sep 8, 2019
  1. [ASan] Only run dlopen-mixed-c-cxx.c with static runtime

    hahnjo committed Sep 8, 2019
    This is what the original bug ( and the fix
    in have been about.
    With the dynamic runtime the test only passes when the asan library
    is linked against libstdc++: In contrast to libc++abi, it does not
    implement __cxa_rethrow_primary_exception so the regex matches the
    line saying that asan cannot intercept this function. Indeed, there
    is no message that the runtime failed to intercept  __cxa_throw.
    Differential Revision:
    llvm-svn: 371336
Commits on Sep 4, 2019
  1. [OpenMP] Change initialization of __kmp_global

    hahnjo committed Sep 4, 2019
    There's no need to initialize variables with static storage duration
    because they're implicitly initialized to zero. See
    I think that's already relied upon because the supplied 0 only sets
    'kmp_time_global_t g_time;' in 'struct kmp_base_global'. The other fields
    are not set in the code, but implicitly initialized by the compiler.
    Differential Revision:
    llvm-svn: 370943
Commits on Aug 15, 2019
  1. [OpenMP] Enable warning about "implicit fallthrough"

    hahnjo committed Aug 15, 2019
    Fix last warned location in ittnotify_static.cpp using the defined
    macro KMP_FALLTHROUGH().
    Differential Revision:
    llvm-svn: 369003
  2. [OpenMP] Remove 'unnecessary parentheses'

    hahnjo committed Aug 15, 2019
    The variables in kmp_lock.cpp are really arrays of function pointers
    that return void or int, not pointers to functions that return void*
    or int*. The other changes are only cosmetic.
    Differential Revision:
    llvm-svn: 369002
  3. [OMPT] Resolve warnings because of ints in if conditions

    hahnjo committed Aug 15, 2019
    The implementation status can only be one of
    ompt_event_UNIMPLEMENTED = ompt_set_never = 1
    ompt_event_MAY_ALWAYS = ompt_set_always = 5
    In both cases, the condition was already true, so just remove
    the check.
    Differential Revision:
    llvm-svn: 369001
  4. [OpenMP] Turn on -Wall compiler warnings by default

    hahnjo committed Aug 15, 2019
    Instead, maintain a list of disabled options to still build libomp and
    libomptarget without warnings. This includes -Wno-error and -Wno-pedantic
    to silence warnings that LLVM enables when building in-tree.
    I tested the following compilers:
     * Clang 6.0, 7.0, 8.0
     * GCC 4.8.5 (CentOS 7), GCC 6, 7, 8, 9
     * Intel Compiler 16, 17, 18, 19
    RFC thread on openmp-dev mailing list:
    Differential Revision:
    llvm-svn: 368999
Commits on Aug 9, 2019
  1. [libomptarget] Remove duplicate RTLRequiresFlags per device

    hahnjo committed Aug 9, 2019
    We have one global RTLs.RequiresFlags, I don't see a need to make a
    copy per device that the runtime manages. This was problematic anyway
    because the copy happened during the first __tgt_register_lib(). This
    made it impossible to call __tgt_register_requires() from normal user
    funtions for testing.
    Hence, this change also fixes unified_shared_memory/shared_update.c for
    older versions of Clang that don't call __tgt_register_requires() before
    Differential Revision:
    llvm-svn: 368465
Commits on Jul 30, 2019
  1. [OpenMP] Rename last file to cpp and remove LIBOMP_CFLAGS

    hahnjo committed Jul 30, 2019
    All other files are already C++ and the build system has always
    passed '-x c++' for C files, effectively compiling them as C++.
    To stay warning free we need one fix in ittnotify_static.{c,cpp}:
    The variable dll_path can be written to, so it must not be const.
    GCC complained with -Wcast-qual and I think it's right.
    Differential Revision:
    llvm-svn: 367343
Commits on Jul 25, 2019
  1. [OpenMP] Fix build of stubs library, NFC.

    hahnjo committed Jul 25, 2019
    Both Clang and GCC complained that they cannot initialize a return
    object of type 'kmp_proc_bind_t' with an 'int'. While at it, also
    fix a warning about missing parentheses thrown by Clang.
    Differential Revision:
    llvm-svn: 367041
  2. [OpenMP] RISCV64 port

    hahnjo committed Jul 25, 2019
    This is a port of libomp for the RISC-V 64-bit Linux target.
    We have tested this port on a HiFive Unleashed development board
    using a downstream LLVM that has support for the missing bits in
    upstream. As of now, all tests are passing, including OMPT.
    Patch by Ferran Pallarès!
    Differential Revision:
    llvm-svn: 367021
Commits on Jul 23, 2019
  1. [libomptarget] Handle offload policy in push_tripcount

    hahnjo committed Jul 23, 2019
    If the first target region in a program calls the push_tripcount
    function, libomptarget didn't handle the offload policy correctly.
    This could lead to unexpected error messages as seen in
    To solve this, add a check calling IsOffloadDisabled() as all other
    entry points already do. If this method returns false, libomptarget
    is effectively disabled.
    Differential Revision:
    llvm-svn: 366810
Commits on Jul 22, 2019
  1. [OMPT] Cleanup reset of exit_frame pointer

    hahnjo committed Jul 22, 2019
    This is done at call-site and does not need to be handled in
    __kmp_invoke_microtask. It was already absent from the x86
    and x86_64 assembly, this patch removes it from the generic
    implementation in z_Linux_util.cpp and adds documentation for
    AArch64 and PPC64 that it's actually not needed. I can't test
    on these architectures, so I don't want to change the code just
    because it looks right :)
    While at it, rename some variables for consistency and add a
    check in test/ompt/parallel/normal.c that the pointer was reset
    before entering the barrier.
    Differential Revision:
    llvm-svn: 366721
  2. Delete empty file

    hahnjo committed Jul 22, 2019
    This is a left-over from r356288 which was reviewed in D58989.
    llvm-svn: 366716
Commits on Jul 16, 2019
  1. [OpenMP] Move header inclusion out of 'extern "C"'

    hahnjo committed Jul 16, 2019
    This leads to problems when compiling C++ code with libc++ for Nvidia GPUs
    because Clang now uses wrappers for math functions that might include
    C++ templates not allowed in 'extern "C"'.
    Differentiel Revision:
    llvm-svn: 366229
Commits on Jul 12, 2019
  1. [libomptarget] Fix typos and grammar in error messages, NFC.

    hahnjo committed Jul 12, 2019
    llvm-svn: 365890
Commits on Jul 11, 2019
  1. [libomptarget-nvptx] Remove dead functions

    hahnjo committed Jul 11, 2019
    These entry points are never called by Clang trunk nor clang-ykt. If
    XL doesn't use them either, they can finally go away.
    Differential Revision:
    llvm-svn: 365817
Commits on Mar 15, 2019
  1. [msan] Fix BMI2 detection in msan tests, take 2.

    hahnjo committed Mar 15, 2019
    It's not enough if only one bit is present, we need to check that
    both are set. This finally fixes the test failures for me.
    llvm-svn: 356242
Commits on Mar 13, 2019
  1. [ELF] Fix GCC8 warnings about "fall through", NFCI

    hahnjo committed Mar 13, 2019
    Add break statements in Object/ELF.cpp since the code should consider the
    generic tags for Hexagon, MIPS, and PPC. Add a test (copied from llvm-readobj)
    to show that this works correctly (earlier versions of this patch would have
    The warnings in X86ELFObjectWriter.cpp are actually false-positives since
    the nested switch() handles all possible values and returns in all cases.
    Make this explicit by adding llvm_unreachable's.
    Differential Revision:
    llvm-svn: 356037
  2. [Support] Treat truncation of fullpath as error

    hahnjo committed Mar 13, 2019
    If the concatenation of arguments dir and bin has at least PATH_MAX
    characters the call to snprintf will truncate. The result will usually
    not exist, but if it does it's actually incorrect to return that the
    path exists.
    (Motivated by GCC compiler warning about format truncation.)
    Differential Revision:
    llvm-svn: 356036
Commits on Mar 4, 2019
  1. [AArch64/ARM] Fix two compiler warnings in InstructionSelector, NFCI

    hahnjo committed Mar 4, 2019
    1) GCC complains that KnownValid is set but not used.
    2) In ARMInstructionSelector::selectGlobal() the code is mixing "enumeral
       and non-enumeral type in conditional expression". Solve this by casting
       to unsigned which is the final type anyway.
    Differential Revision:
    llvm-svn: 355304
Commits on Mar 1, 2019
  1. Hide two unused debugging methods, NFCI.

    hahnjo committed Mar 1, 2019
    GCC correctly moans that PlainCFGBuilder::isExternalDef(llvm::Value*) and
    StackSafetyDataFlowAnalysis::verifyFixedPoint() are defined but not used
    in Release builds. Hide them behind 'ifndef NDEBUG'.
    llvm-svn: 355205
Commits on Feb 21, 2019
  1. [OpenMP] Fix check-openmp after r354553

    hahnjo committed Feb 21, 2019
    Calling add_openmp_testsuite will add the tests to check-openmp unless
    EXCLUDE_FROM_ALL is set. This is problematic because the tests for OMPT
    will be included twice which doesn't work if the same test is executed
    concurrently by multiple threads.
    (On PPC some failures are unrelated to r354553, the bot has been red before
    and this commit is not expected to fix that. For a proper patch please see
    llvm-svn: 354572
Commits on Feb 17, 2019
  1. [compiler-rt] Fix broken sanitizer bots (hopefully)

    hahnjo committed Feb 17, 2019
    According to the logs and local debugging there were two issues:
    1) tsan tests listed libc++.a before the source file. That's usually
       ok for shared libraries, but the linker will not add symbols from
       a static library unless needed at that time. As a result the tests
       that rely upon symbols from the library (and not only include the
       headers) had undefined references.
       To solve this I'm adding a new substitution %link_libcxx_tsan which
       expands to libc++.a if available.
    2) The target Fuzzer-x86_64-Test linked in SANITIZER_TEST_CXX_LIBRARIES
       which defaults to -lstdc++. This resulted in error messages like
         hidden symbol '_ZdlPv' is not defined locally
         hidden symbol '_Znwm' is not defined locally
       when using GNU gold (ld.bfd and lld are fine). Removing the linkage
       is fine because we build a custom libc++ for that purpose.
    llvm-svn: 354231
  2. [compiler-rt] Build custom libcxx with libcxxabi

    hahnjo committed Feb 17, 2019
    This changes add_custom_libcxx to also build libcxxabi and merges
    the two into a static and hermetic library.
    There are multiple advantages:
    1) The resulting libFuzzer doesn't expose C++ internals and looks
       like a plain C library.
    2) We don't have to manually link in libstdc++ to provide cxxabi.
    3) The sanitizer tests cannot interfere with an installed version
       of in LD_LIBRARY_PATH.
    Differential Revision:
    llvm-svn: 354212
Commits on Feb 16, 2019
  1. [compiler-rt] Cleanup usage of C++ ABI library

    hahnjo committed Feb 16, 2019
    Add missed value "libcxxabi" and introduce SANITIZER_TEST_CXX for linking
    unit tests. This needs to be a full C++ library and cannot be libcxxabi.
    Recommit r354132 which I reverted in r354153 because it broke a sanitizer
    bot. This was because of the "fixes" for pthread linking, so I've removed
    these changes.
    Differential Revision:
    llvm-svn: 354198
Commits on Feb 15, 2019
  1. Revert "[compiler-rt] Cleanup usage of C++ ABI library"

    hahnjo committed Feb 15, 2019
    This reverts r354132 because it breaks sanitizer-x86_64-linux:
    llvm-svn: 354153
  2. [compiler-rt] Let CMake search for thread support

    hahnjo committed Feb 15, 2019
    This is an educated guess to fix sanitizer-x86_64-linux after r354132.
    llvm-svn: 354143
  3. [compiler-rt] Cleanup usage of C++ ABI library

    hahnjo committed Feb 15, 2019
    Add missed value "libcxxabi" and introduce SANITIZER_TEST_CXX for linking
    unit tests. This needs to be a full C++ library and cannot be libcxxabi.
    Differential Revision:
    llvm-svn: 354132
Commits on Feb 11, 2019
  1. [OMPT] Remove test output from source tree

    hahnjo committed Feb 11, 2019
    %s refers to the test file in the source tree. This was accidentally added in
    r351197 / 2b46d30 ("[OMPT] Second chunk of final OMPT 5.0 interface updates").
    Differential Revision:
    llvm-svn: 353715
Commits on Oct 2, 2018
  1. [OpenMP][NVPTX] Simplify codegen for orphaned parallel, NFCI.

    hahnjo committed Oct 2, 2018
    Worker threads fork off to the compiler generated worker function
    directly after entering the kernel function. Hence, there is no
    need to check whether the current thread is the master if we are
    outside of a parallel region (neither SPMD nor parallel_level > 0).
    Differential Revision:
    llvm-svn: 343618
  2. [OpenMP] Simplify code for reductions on distribute directives, NFC.

    hahnjo committed Oct 2, 2018
    Only need to care about the 'distribute simd' case, all other composite
    directives are handled elsewhere. This was already reflected in the
    outer 'if' condition, so all other inner conditions could never be true.
    Differential Revision:
    llvm-svn: 343617
Commits on Oct 1, 2018
  1. [libomptarget-nvptx] Enable asserts in bclib

    hahnjo committed Oct 1, 2018
    If the user requested LIBOMPTARGET_NVPTX_DEBUG, include asserts in
    the bitcode library. Everything else will have very unpleasent
    effects because asserts will appear when falling back to the static
    library libomptarget-nvptx.a.
    Differential Revision:
    llvm-svn: 343477
  2. [libomptarget-nvptx] reduction: Determine if runtime uninitialized

    hahnjo committed Oct 1, 2018
    Pass in the correct value of isRuntimeUninitialized() which solves
    parallel reductions as reported on the mailing list.
    For reference: r333285 did the same for loop scheduling.
    Differential Revision:
    llvm-svn: 343476
Commits on Sep 30, 2018
  1. [libomptarget-nvptx] Align data sharing stack

    hahnjo committed Sep 30, 2018
    NVPTX requires addresses of pointer locations to be 8-byte aligned
    or there will be an exception during runtime.
    This could happen without this patch as shown in the added test:
    getId() requires 4 byte of stack and putValueInParallel() uses 16
    bytes to store the addresses of the captured variables.
    Differential Revision:
    llvm-svn: 343402
You can’t perform that action at this time.