[all-commits] [llvm/llvm-project] 49266f: [mlir][LLVM] Add the `byte` type to the LLVM dialect

Markus Böck via All-commits all-commits at lists.llvm.org
Sun Jun 14 14:16:35 PDT 2026


  Branch: refs/heads/users/zero9178/mlir-llvm-byte-type
  Home:   https://github.com/llvm/llvm-project
  Commit: 49266fa73063f084f5aa67cea4bb7dc9fde20419
      https://github.com/llvm/llvm-project/commit/49266fa73063f084f5aa67cea4bb7dc9fde20419
  Author: Markus Böck <markus.boeck02 at gmail.com>
  Date:   2026-06-14 (Sun, 14 Jun 2026)

  Changed paths:
    M mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.td
    M mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMTypeSyntax.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp
    M mlir/lib/Target/LLVMIR/TypeFromLLVM.cpp
    M mlir/lib/Target/LLVMIR/TypeToLLVM.cpp
    M mlir/test/Dialect/LLVMIR/layout.mlir
    M mlir/test/Dialect/LLVMIR/roundtrip.mlir
    M mlir/test/Dialect/LLVMIR/types.mlir
    M mlir/test/Target/LLVMIR/Import/basic.ll
    M mlir/test/Target/LLVMIR/llvmir.mlir

  Log Message:
  -----------
  [mlir][LLVM] Add the `byte` type to the LLVM dialect

This PR ports the newly added `byte` type from LLVM IR to mlir's LLVM dialect.
The simplest motivation for the byte type is being able to implement `memcpy` in LLVM IR. This was previously not possible: Due to rules around conversions between integers and pointers (which e.g. implicitly happen during loads), partial-poisons and pointer provenance were not preserved.
No alterantive types to integers existed that one could use to have poison and provenance preserving SSA-values. The byte type solves exactly this issue.
Frontends are encouraged to use it when needed for better optimization capabilities.

Currently, the only operation that has changed semantics around `byte` is `bitcast`. Is now allows casting between `byte` and `ptr` (unlike integers and pointers).

Corresponding LLVM commit: https://github.com/llvm/llvm-project/commit/80f2ef70f592

Assisted by Claude & Gemini



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