llvm-project
094c10f9 - [CIR] Lower byval/byref args in CallConvLowering (#201717)

Commit
87 days ago
[CIR] Lower byval/byref args in CallConvLowering (#201717) [CIR] Lower byval/byref args in CallConvLowering ArgKind::Indirect arguments were hitting an errorNYI in CIRABIRewriteContext. Add the lowering: in the callee the block argument type changes to !cir.ptr<T>, a load is inserted at entry so the body sees the original value type, and llvm.byval or llvm.byref is attached based on ownership. At call sites, both byval and byref are lowered by allocating a stack slot, copying the value in, and passing the pointer. For byval, llvm.noalias and llvm.noundef are also added -- llvm.noalias because the call-site rewrite always produces a fresh alloca+store (equivalent to -fpass-by-value-is-noalias), and llvm.noundef because the copy is always fully defined. byref carries only llvm.byref and llvm.align since it does not assert exclusive ownership.
Author
Parents
Loading