[all-commits] [llvm/llvm-project] 3511bd: [mlir][llvm] Fix metadata and alignment on masked ...

Tobias Gysi via All-commits all-commits at lists.llvm.org
Mon Sep 7 22:51:22 PDT 2026


  Branch: refs/heads/users/gysit/masked-intrinsic-metadata
  Home:   https://github.com/llvm/llvm-project
  Commit: 3511bda58d8740516169b6befd04141abb34830d
      https://github.com/llvm/llvm-project/commit/3511bda58d8740516169b6befd04141abb34830d
  Author: Tobias Gysi <tobias.gysi at nextsilicon.com>
  Date:   2026-09-08 (Tue, 08 Sep 2026)

  Changed paths:
    M clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
    M mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
    M mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMInterfaces.cpp
    M mlir/test/Conversion/VectorToLLVM/use-vector-alignment.mlir
    M mlir/test/Conversion/VectorToLLVM/vector-to-llvm-interface.mlir
    M mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
    M mlir/test/Conversion/VectorToLLVM/vector-xfer-to-llvm.mlir
    M mlir/test/Dialect/LLVMIR/opaque-ptr.mlir
    M mlir/test/Dialect/LLVMIR/roundtrip.mlir
    M mlir/test/Target/LLVMIR/Import/intrinsic.ll
    A mlir/test/Target/LLVMIR/Import/masked-intrinsic-metadata.ll
    M mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir
    M mlir/test/Target/LLVMIR/llvmir-invalid.mlir
    A mlir/test/Target/LLVMIR/masked-intrinsic-metadata.mlir
    M mlir/test/Target/LLVMIR/opaque-ptr.mlir

  Log Message:
  -----------
  [mlir][llvm] Fix metadata and alignment on masked memory intrinsics

llvm.intr.masked.load, masked.store, masked.gather and masked.scatter
implemented neither AccessGroupOpInterface nor AliasAnalysisOpInterface,
so they could not carry access_groups, alias_scopes, noalias_scopes or
tbaa. Importing LLVM IR that attached such metadata to one of them
silently dropped it, while llvm.memcpy in the same module preserved it.

Also widen alignment from I32Attr to I64Attr, matching the rest of the
LLVM dialect and LLVM proper, and make it optional. LangRef gives the
default alignment of these four intrinsics as the ABI alignment of the
type, exactly as for llvm.load and llvm.store, so an absent align
parameter attribute now imports as an absent alignment attribute instead
of being materialised as align 1, and an absent alignment attribute
exports without an align parameter attribute. This changes the textual
IR, as alignment = 4 : i32 becomes alignment = 4 : i64. Downstream
updates should rewrite only lines that mention a masked intrinsic rather
than blanket-substituting i32 with i64; other i32 spellings must stay,
including llvm.intr.matrix.*'s rows and columns attributes and i32
vector and element types on the intrinsics themselves.

Co-Authored-By: Claude Opus 5 (1M context) <noreply at anthropic.com>



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