[all-commits] [llvm/llvm-project] bb6f7f: [mlir][LLVM] Use element allocation sizes when com...
Risan Gnanasegaram via All-commits
all-commits at lists.llvm.org
Tue Sep 8 07:17:58 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: bb6f7fcb46cdbe258b0cba12506fe1f344cd2d45
https://github.com/llvm/llvm-project/commit/bb6f7fcb46cdbe258b0cba12506fe1f344cd2d45
Author: Risan Gnanasegaram <risan888 at hotmail.com>
Date: 2026-09-08 (Tue, 08 Sep 2026)
Changed paths:
M mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp
M mlir/test/Dialect/LLVMIR/layout.mlir
Log Message:
-----------
[mlir][LLVM] Use element allocation sizes when computing struct size (#221742)
`LLVMStructType::getTypeSizeInBits` currently advances by each element's
store size. With the data layout from #221665, this reports 11 bytes for
`!llvm.struct<packed (f80, i8)>`, while LLVM uses the 16-byte allocation
size of `f80` and reports a 17-byte struct.
Round each element's size up to its ABI alignment before adding it to
the
struct size, matching LLVM's `getTypeAllocSize` behavior. Packed structs
continue to suppress alignment gaps before elements, while each element
still consumes its allocation size.
Add regression coverage for packed, unpacked, nested, and array layouts.
Fixes #221665.
Testing: 99 relevant MLIR tests passed; 3 x86-only tests were
unsupported
on the ARM host.
Assisted by: OpenAI Codex
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