llvm with tablegen backend for capstone disassembler
Go to file
Joseph Huber 37c1a5e3f5
[Libomptarget] Fix GPU Dtors referencing possibly deallocated image (#77828)
Summary:
The constructors and destructors look up a symbol in the ELF quickly to
determine if they need to be run on the GPU. This allows us to avoid the
very slow actions required to do the slower lookup using the vendor API.

One problem occurs with how we handle the lifetime of these images.
Right now there is no invariant to specify the lifetime of the
underlying binary image that is loaded. In the typical case, this comes
from the binary itself in the `.llvm.offloading` section, meaning that
the lifetime of the binary should match the executable itself. This
would work fine, if it weren't for the fact that the plugin is loaded
via `dlopen` and can have a teardown order out of sync with the main
executable.

This was likely what was occuring when this failed on some systems but
not others. A potential solution would be to simply copy images into
memory so the runtime does not rely on external references. Another
would be to manually zero these out after initialization as to prevent
this mistake from happening accidentally. The former has the benefit of
making some checks easier, and allowing for constant initialization be
done on the ELF itself (normally we can't do this because writing to a
constant section, e.g. .llvm.offloading is a segfault.). The downside
would be the extra time required to copy the image in bulk (Although we
are likely doing this in the vendor runtimes as well).

This patch went with a quick solution to simply set a boolean value at
initialization time if we need to call destructors.

Fixes: https://github.com/llvm/llvm-project/issues/77798
2024-01-11 15:00:53 -06:00
.ci [ci] Set timeout for individual tests and report slowest tests (#76300) 2024-01-10 10:39:33 -08:00
.github [runtimes] Use LLVM libunwind from libc++abi by default (#77687) 2024-01-11 10:13:21 -05:00
bolt [BOLT] Encode BAT using ULEB128 (#76899) 2024-01-11 12:16:30 -08:00
clang [Format] Fix a warning 2024-01-11 12:09:01 -08:00
clang-tools-extra [clangd] Handle lambda scopes inside Node::getDeclContext() (#76329) 2024-01-11 16:59:18 +08:00
cmake [CMake] Switch the CMP0091 policy (MSVC_RUNTIME_LIBRARY) to the new behaviour 2023-07-17 09:59:05 +03:00
compiler-rt Revert "[asan] Enable StackSafetyAnalysis by default" 2024-01-11 15:24:44 -05:00
cross-project-tests [Dexter] Set ShouldBuild=false for Visual Studio solutions (#75045) 2023-12-11 15:19:40 +00:00
flang [flang] Fix a warning 2024-01-11 12:14:42 -08:00
libc [libc][NFC] Use 16-byte indices for _mmXXX_shuffle_epi8 (#77781) 2024-01-11 16:25:55 +01:00
libclc libclc: generic: add half implementation for erf/erfc (#66901) 2024-01-09 16:47:53 +00:00
libcxx [ASan][libc++] Initialize __r_ variable with lambda (#77394) 2024-01-11 21:40:00 +01:00
libcxxabi [runtimes] Use LLVM libunwind from libc++abi by default (#77687) 2024-01-11 10:13:21 -05:00
libunwind [libunwind] Convert a few options from CACHE PATH to CACHE STRING (#77534) 2024-01-10 11:25:17 +02:00
lld [lld][ELF] Allow Arm PC-relative relocations in PIC links (#77304) 2024-01-11 16:49:14 +00:00
lldb [lldb] Fix MaxSummaryLength target property type (#72233) 2024-01-11 17:57:30 +00:00
llvm Revert "[asan] Enable StackSafetyAnalysis by default" 2024-01-11 15:24:44 -05:00
llvm-libgcc [llvm-libgcc][CMake] Refactor llvm-libgcc (#65455) 2023-09-18 22:56:03 -07:00
mlir [Dialect] Fix a warning 2024-01-11 12:18:09 -08:00
openmp [Libomptarget] Fix GPU Dtors referencing possibly deallocated image (#77828) 2024-01-11 15:00:53 -06:00
polly [polly][ScheduleOptimizer] Reland Fix long compile time(hang) reported in polly (#77280) 2024-01-08 09:48:02 -08:00
pstl Clear release notes for 18.x 2023-07-25 13:58:49 +02:00
runtimes [CMake] Always define runtimes-test-depends (#73629) 2023-11-28 15:30:52 -08:00
third-party [System][z/OS] Fix per-thread timing error on z/OS (#76947) 2024-01-05 07:57:07 -05:00
utils [libc] Add memcmp / bcmp fuzzers (#77741) 2024-01-11 11:06:46 +01:00
.arcconfig
.arclint
.clang-format
.clang-tidy Add -misc-use-anonymous-namespace to .clang-tidy 2023-05-06 02:33:20 +03:00
.git-blame-ignore-revs [libc++] Add libc++ clang-formatting commit to git-blame-ignore-revs file 2023-12-18 14:04:41 -05:00
.gitattributes [libc++] Format the code base (#74334) 2023-12-18 14:01:33 -05:00
.gitignore Revert accidental .gitignore change from 9b7763821a 2023-09-07 22:42:05 -07:00
.mailmap .mailmap: add second entry for self 2023-12-19 11:13:19 +00:00
CODE_OF_CONDUCT.md [llvm] Add CODE_OF_CONDUCT.md (#65816) 2023-09-09 10:55:31 -07:00
CONTRIBUTING.md Update CONTRIBUTING.md to remove the not about not accepting PR 2023-09-10 15:21:06 -07:00
LICENSE.TXT [docs] Add LICENSE.txt to the root of the mono-repo 2022-08-24 09:35:00 +02:00
README.md [libc++][CI] Moves CI badge to main README. (#77247) 2024-01-09 19:12:42 +01:00
SECURITY.md

The LLVM Compiler Infrastructure

OpenSSF Scorecard libc++

Welcome to the LLVM project!

This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.

The LLVM project has multiple components. The core of the project is itself called "LLVM". This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.

C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.

Other components include: the libc++ C++ standard library, the LLD linker, and more.

Getting the Source Code and Building LLVM

Consult the Getting Started with LLVM page for information on building and running LLVM.

For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.

Getting in touch

Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.

The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.