[all-commits] [llvm/llvm-project] 0382ba: [CIR] NFC: Address sret review feedback in CallCon...

adams381 via All-commits all-commits at lists.llvm.org
Wed Jun 10 14:18:13 PDT 2026


  Branch: refs/heads/users/adams381/cir-callconv-lowering-indirect-sret
  Home:   https://github.com/llvm/llvm-project
  Commit: 0382bad8548e107e8c9dfaa2c509b0adf4592509
      https://github.com/llvm/llvm-project/commit/0382bad8548e107e8c9dfaa2c509b0adf4592509
  Author: Adam Smith <adams at nvidia.com>
  Date:   2026-06-10 (Wed, 10 Jun 2026)

  Changed paths:
    M clang/lib/CIR/Dialect/Transforms/TargetLowering/CIRABIRewriteContext.cpp
    M clang/test/CIR/Transforms/abi-lowering/indirect-return-sret.cir

  Log Message:
  -----------
  [CIR] NFC: Address sret review feedback in CallConvLowering

Apply andykaylor's second-round feedback on the sret lowering.
All source changes are behavior-preserving:

- Use llvm::append_range when copying arg_attrs into the sret
  call's and the definition's attribute lists.
- Replace the manual pad loop in applySretSlotAttrs with an
  assert plus resize to the rewritten operand count.
- Rename the Ignore-drop loop's index variables so the outer
  one (argInfoIdx) indexes fc.argInfos and the inner one
  (blockIdx) is the real block-argument index, matching the
  convention insertArgCoercion already uses.
- Clarify the "hidden pointer" comments: the sret pointer is
  synthesized by the ABI and is not part of the source-level
  signature.
- Note why the llvm.sret attribute must carry the return type
  explicitly, since LLVM pointers are opaque once lowered.

Extend the sret test: bind the a/b destination allocas in the
multi-use caller so the loaded value's stores are unambiguous,
anchor the argument-attribute dictionary braces, and add a
multi-return function whose value is constructed in place via a
call into __retval, so both returns route through the sret
pointer with no store to the sret 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