commit | aec685ea77e97bcc6892b12e970857fb1b049528 | [log] [tgz] |
---|---|---|
author | Alexander Richardson <alexrichardson@google.com> | Fri May 16 10:04:00 2025 -0700 |
committer | GitHub <noreply@github.com> | Fri May 16 10:04:00 2025 -0700 |
tree | 36fb9dc1dd61310f92f4010ccd30d03aabd65709 | |
parent | e620f10f57bf698b7446f134528bb2585fdf1f28 [diff] |
[DataLayout] Introduce DataLayout::getAddressSize(AS) This function can be used to retrieve the number of bits that can be used for arithmetic in a given address space (i.e. the range of the address space). For most in-tree targets this should not make any difference but differentiating between the size of a pointer in bits and the address range is extremely important e.g. for CHERI-enabled targets, where pointers carry additional metadata such as bounds and permissions and only a subset of the pointer bits is used as the address. The address size is defined to be the same as the index size. We considered adding a separate property since targets exist where indexing and address range actually use different sizes (AMDGPU fat pointers with 160 representation, 48 bit address and 32 bit index), but for the purposes of LLVM semantics, differentiating them does not add much value and it introduces a lot of complexity in ensure the correct bits are used. See the reasoning by @nikic on https://discourse.llvm.org/t/clarifiying-the-semantics-of-ptrtoint/83987/38https://discourse.llvm.org/t/clarifiying-the-semantics-of-ptrtoint/83987/49 Originally uploaded as https://reviews.llvm.org/D135158 Reviewed By: davidchisnall, krzysz00 Pull Request: https://github.com/llvm/llvm-project/pull/139347
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.