[all-commits] [llvm/llvm-project] 64a586: [CIR] Read a non-byval parameter back out of its s...

Adam Smith via All-commits all-commits at lists.llvm.org
Sun Sep 20 23:21:25 PDT 2026


  Branch: refs/heads/users/adams381/cir-callconv-nonbyval-param-noload
  Home:   https://github.com/llvm/llvm-project
  Commit: 64a586fc805a208ef8cc381bfdffd5e08ef59129
      https://github.com/llvm/llvm-project/commit/64a586fc805a208ef8cc381bfdffd5e08ef59129
  Author: Adam Smith <adams at nvidia.com>
  Date:   2026-09-20 (Sun, 20 Sep 2026)

  Changed paths:
    M clang/lib/CIR/Dialect/Transforms/CallConvLoweringPass.cpp
    M clang/lib/CIR/Dialect/Transforms/TargetLowering/CIRABIRewriteContext.cpp
    M clang/lib/CIR/Dialect/Transforms/TargetLowering/CIRABIRewriteContext.h
    A clang/test/CIR/CodeGen/call-conv-lowering-x86_64-non-byval-thunk-mixed.cpp
    A clang/test/CIR/CodeGen/call-conv-lowering-x86_64-non-byval-thunk-sret.cpp
    A clang/test/CIR/CodeGen/call-conv-lowering-x86_64-non-byval-thunk.cpp
    M clang/test/CIR/Transforms/abi-lowering/indirect-non-byval-forward-param.cir
    M clang/test/CIR/Transforms/abi-lowering/indirect-non-byval-nyi.cir

  Log Message:
  -----------
  [CIR] Read a non-byval parameter back out of its spill slot

CallConvLowering recognizes a forwarded non-byval indirect argument by the slot
its operand was loaded from.  At -O1 and above cir-simplify folds that load
away when the slot is a constant alloca, which is what CIRGen emits for a
const-qualified by-value parameter.  The walk that gives each such parameter's
slot the alignment the ABI promises now also reads the record back out of the
slot at the spill and points the parameter's call-argument uses at that load,
so an Expand, byval or coerced argument reads it too.

Assisted-by: Cursor / claude-opus-5



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