[all-commits] [llvm/llvm-project] b46d55: [DataLayout] Add byte specification

Sergei Barannikov via All-commits all-commits at lists.llvm.org
Tue Feb 4 06:00:02 PST 2025


  Branch: refs/heads/users/s-barannikov/byte/1-datalayout
  Home:   https://github.com/llvm/llvm-project
  Commit: b46d554321c0fdc3933d5293709cd82f7bdb1029
      https://github.com/llvm/llvm-project/commit/b46d554321c0fdc3933d5293709cd82f7bdb1029
  Author: Sergei Barannikov <barannikov88 at gmail.com>
  Date:   2025-02-04 (Tue, 04 Feb 2025)

  Changed paths:
    M llvm/include/llvm/IR/DataLayout.h
    M llvm/lib/IR/DataLayout.cpp

  Log Message:
  -----------
  [DataLayout] Add byte specification

This patch adds byte specification to data layout string.
The specification is `b:<size>`, where `<size>` is the size of a byte
in bits (later referred to as "byte width").

Limitations:
* The only values allowed for byte width are 8, 16, and 32.
16-bit bytes are popular, and my downstream target has 32-bit bytes.
These are the widths I'm going to add tests for in follow-up patches,
so this restriction only exists because other widths are untested.
* It is assumed that bytes are the same in all address spaces.
Supporting different byte widths in different address spaces would
require adding an address space argument to all DataLayout methods
that query ABI / preferred alignments because they return *byte*
alignments, and those will be different for different address spaces.
This is too much effort, but it can be done in the future if the need
arises, the specification reserves address space number before ':'.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list