commit | ce80c80dca45c7b4636a3e143973e2c6cbdb2884 | [log] [tgz] |
---|---|---|
author | Fangrui Song <i@maskray.me> | Fri Jun 28 15:30:19 2024 -0700 |
committer | GitHub <noreply@github.com> | Fri Jun 28 15:30:19 2024 -0700 |
tree | d859b6011f9108dd18b19c5a3d5ceffafd5ce33c | |
parent | 982c54719289c1d85d03be3ad9e95bbfd2862aee [diff] |
[Hashing] Use a non-deterministic seed if LLVM_ENABLE_ABI_BREAKING_CHECKS Hashing.h provides hash_value/hash_combine/hash_combine_range, which are primarily used by `DenseMap<StringRef, X>` Users shouldn't rely on specific hash values due to size_t differences on 32-bit/64-bit platforms and potential algorithm changes. `set_fixed_execution_hash_seed` is provided but it has never been used. In LLVM_ENABLE_ABI_BREAKING_CHECKS builds, take the the address of a static storage duration variable as the seed like absl/hash/internal/hash.h `kSeed`. (See https://reviews.llvm.org/D93931 for workaround for older Clang. Mach-O x86-64 forces PIC, so absl's `__apple_build_version__` check is unnecessary.) LLVM_ENABLE_ABI_BREAKING_CHECKS defaults to `WITH_ASSERTS` and is enabled in an assertion build. In a non-assertion build, `get_execution_seed` returns the fixed value regardless of `NDEBUG`. Removing a variable load yields noticeable size/performance improvement. A few users relying on the iteration order of `DenseMap<StringRef, X>` have been fixed (e.g., f8f4235612b9 c025bd1fdbbd 89e8e63f47ff 86eb6bf6715c eb8d03656549 0ea6b8e476c2 58d7a6e0e636 8ea31db27211 592abf29f9f7 664497557ae7). From my experience fixing [`StringMap`](https://discourse.llvm.org/t/reverse-iteration-bots/72224) iteration order issues, the scale of issues is similar. Pull Request: https://github.com/llvm/llvm-project/pull/96282
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.
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.
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.