[all-commits] [llvm/llvm-project] f92034: [CIR] Load flattened struct args from coerce slot
adams381 via All-commits
all-commits at lists.llvm.org
Fri Jun 12 08:20:45 PDT 2026
Branch: refs/heads/users/adams381/cir-callconv-lowering-flatten
Home: https://github.com/llvm/llvm-project
Commit: f92034faad39a8d530970ae8f4aa08ae0aa200b0
https://github.com/llvm/llvm-project/commit/f92034faad39a8d530970ae8f4aa08ae0aa200b0
Author: Adam Smith <adams at nvidia.com>
Date: 2026-06-12 (Fri, 12 Jun 2026)
Changed paths:
M clang/lib/CIR/Dialect/Transforms/TargetLowering/CIRABIRewriteContext.cpp
M clang/test/CIR/Transforms/abi-lowering/direct-flatten.cir
Log Message:
-----------
[CIR] Load flattened struct args from coerce slot
At the call site, a struct argument that flattens into scalar wire
arguments was coerced to the ABI struct as a whole value and then
decomposed with cir.extract_member. When the coercion goes through
memory, read each field from the coerced slot with cir.get_member +
cir.load instead, so the lowering takes pointers to the members it
wants rather than loading the entire structure and extracting from the
value. The shared memory half of the coercion is factored into
emitCoercionToMemory, which returns the destination-typed pointer to
the coerce slot; emitCoercion now builds on it and loads the whole
value, so its existing callers are unchanged. The no-coercion call
site (the operand already has the coerced type) keeps cir.extract_member
because that value has no backing slot to take member pointers from.
The remaining changes are mechanical: llvm::append_range and
SmallVector::append for the per-field loops, spelling out cir::RecordType
instead of auto at the getFlattenedCoercedType call sites, an enumerate
loop over the coerced members, and renaming the builder parameter from
rewriter to builder in insertArgCoercion and the emitCoercion overloads.
direct-flatten.cir's caller check groups are updated to the get_member +
load shape, including the packed dim3 case that reads both fields from
the coerced slot.
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