[all-commits] [llvm/llvm-project] f23949: [CIR] Widen const/pure side effects for ABI argume...

Adam Smith via All-commits all-commits at lists.llvm.org
Mon Sep 14 19:33:13 PDT 2026


  Branch: refs/heads/users/adams381/cir-callconv-argmem-memory-effects
  Home:   https://github.com/llvm/llvm-project
  Commit: f23949a7914850fbca8b8eb067a090469e486d6d
      https://github.com/llvm/llvm-project/commit/f23949a7914850fbca8b8eb067a090469e486d6d
  Author: Adam Smith <adams at nvidia.com>
  Date:   2026-09-14 (Mon, 14 Sep 2026)

  Changed paths:
    M clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
    M clang/include/clang/CIR/Dialect/IR/CIRDialect.td
    M clang/include/clang/CIR/Interfaces/CIROpInterfaces.td
    M clang/lib/CIR/Dialect/Transforms/CallConvLoweringPass.cpp
    M clang/lib/CIR/Dialect/Transforms/TargetLowering/CIRABIRewriteContext.cpp
    M clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
    M clang/test/CIR/CodeGen/arg-attrs.cpp
    M clang/test/CIR/CodeGen/array-ctor.cpp
    M clang/test/CIR/CodeGen/bind-temporary-lvalue.cpp
    M clang/test/CIR/CodeGen/bitint.c
    M clang/test/CIR/CodeGen/call-conv-lowering-x86_64-bitint.c
    M clang/test/CIR/CodeGen/call-conv-lowering-x86_64-empty.cpp
    M clang/test/CIR/CodeGen/call-conv-lowering-x86_64-indirect.c
    M clang/test/CIR/CodeGen/call-conv-lowering-x86_64-non-byval.cpp
    M clang/test/CIR/CodeGen/call-conv-lowering-x86_64-packed.c
    M clang/test/CIR/CodeGen/call-conv-lowering-x86_64-padded.c
    M clang/test/CIR/CodeGen/call-conv-lowering-x86_64-union-bitfield.c
    M clang/test/CIR/CodeGen/call-conv-lowering-x86_64-union-bitfield.cpp
    M clang/test/CIR/CodeGen/call-conv-lowering-x86_64-variadic.c
    M clang/test/CIR/CodeGen/call-conv-lowering-x86_64-vptr.cpp
    M clang/test/CIR/CodeGen/call-conv-lowering-x86_64-zero-width-bitfield.c
    M clang/test/CIR/CodeGen/call.c
    M clang/test/CIR/CodeGen/cleanup-conditional-with-wrapper-eh.cpp
    M clang/test/CIR/CodeGen/cleanup-conditional-with-wrapper.cpp
    M clang/test/CIR/CodeGen/paren-list-agg-init.cpp
    M clang/test/CIR/CodeGen/partial-array-cleanup.cpp
    M clang/test/CIR/CodeGen/side-effect.cpp
    M clang/test/CIR/CodeGenOpenACC/declare-copy.cpp
    M clang/test/CIR/CodeGenOpenACC/declare-copyin.cpp
    M clang/test/CIR/CodeGenOpenACC/declare-copyout.cpp
    M clang/test/CIR/CodeGenOpenACC/declare-create.cpp
    M clang/test/CIR/CodeGenOpenACC/declare-deviceresident.cpp
    M clang/test/CIR/CodeGenOpenACC/declare-present.cpp
    M clang/test/CIR/Transforms/abi-lowering/byval-sret-arg-attr-lowering.cir
    M clang/test/CIR/Transforms/abi-lowering/indirect-byval.cir
    M clang/test/CIR/Transforms/abi-lowering/indirect-call.cir
    M clang/test/CIR/Transforms/abi-lowering/indirect-non-byval-forward-param.cir
    M clang/test/CIR/Transforms/abi-lowering/side-effect-argmem.cir
    M clang/test/CIR/Transforms/abi-lowering/x86_64-bitfield.cir
    M clang/test/CIR/Transforms/abi-lowering/x86_64-bitint.cir
    M clang/test/CIR/Transforms/abi-lowering/x86_64-empty-class.cir
    M clang/test/CIR/Transforms/abi-lowering/x86_64-record-packed.cir
    M clang/test/CIR/Transforms/abi-lowering/x86_64-struct-indirect.cir
    M clang/test/CIR/Transforms/abi-lowering/x86_64-struct-padded.cir
    M clang/test/CIR/Transforms/abi-lowering/x86_64-union.cir
    M clang/test/CIR/Transforms/abi-lowering/x86_64-variadic-call.cir
    M clang/test/CIR/Transforms/abi-lowering/x86_64-vptr.cir

  Log Message:
  -----------
  [CIR] Widen const/pure side effects for ABI argument memory

A const or pure callee that the ABI rewrites to take an sret slot or a
byval pointer reaches argument memory whatever the source declared, and
a variadic callee does too since its declared parameters do not cover
every argument.  CallConvLowering was leaving side_effect untouched, so
LowerToLLVM emitted memory(none) or memory(read) for functions that do
touch that memory.

This adds const_argmem and pure_argmem to CIR_SideEffect.
CallConvLowering widens into them once it knows the signature.

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