[all-commits] [llvm/llvm-project] 2acca5: [AllocToken] Merge !alloc_token metadata across op...

Marco Elver via All-commits all-commits at lists.llvm.org
Fri Jul 31 09:13:06 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2acca5348218ca0a664342c688acad5127ab8c9a
      https://github.com/llvm/llvm-project/commit/2acca5348218ca0a664342c688acad5127ab8c9a
  Author: Marco Elver <elver at google.com>
  Date:   2026-07-31 (Fri, 31 Jul 2026)

  Changed paths:
    M llvm/include/llvm/IR/Metadata.h
    M llvm/lib/IR/Metadata.cpp
    M llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
    M llvm/lib/Transforms/Utils/Local.cpp
    M llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
    A llvm/test/Transforms/DeadStoreElimination/alloc-token-dse.ll
    A llvm/test/Transforms/InstCombine/alloc-token-realloc.ll
    M llvm/test/Transforms/SimplifyCFG/merge-calls-alloc-token.ll

  Log Message:
  -----------
  [AllocToken] Merge !alloc_token metadata across optimization passes (#211516)

Previously, optimization transforms like DeadStoreElimination (folding
malloc to calloc), SimplifyLibCalls (folding realloc(null, n) to
malloc), and combineMetadata (merging equivalent allocations in
GVN/SimplifyCFG) dropped !alloc_token metadata or stripped it when type
names differed. This caused allocation sites of pointer-containing types
to lose their metadata.

Fix it by implementing MDNode::getMergedAllocTokenMetadata() to merge
!alloc_token metadata by ORing the pointer-containing boolean flag and
concatenating type names with a pipe separator, updating combineMetadata
to use it, and preserving !alloc_token metadata when folding allocation
libcalls in DSE and SimplifyLibCalls.

Assisted-by: Antigravity: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