[all-commits] [llvm/llvm-project] 3374bc: [CIR] Split side_effect into memory effects, nounw...

Adam Smith via All-commits all-commits at lists.llvm.org
Mon Sep 21 15:29:32 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3374bc31c4e293bb7037abdffacb2308e7ca2ebd
      https://github.com/llvm/llvm-project/commit/3374bc31c4e293bb7037abdffacb2308e7ca2ebd
  Author: Adam Smith <adams at nvidia.com>
  Date:   2026-09-21 (Mon, 21 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/Dialect/IR/CIROps.td
    M clang/include/clang/CIR/Interfaces/CIROpInterfaces.td
    M clang/include/clang/CIR/MissingFeatures.h
    M clang/lib/CIR/CodeGen/CIRGenCall.cpp
    M clang/lib/CIR/CodeGen/CIRGenModule.cpp
    M clang/lib/CIR/CodeGen/CIRGenModule.h
    M clang/lib/CIR/Dialect/IR/CIRAttrs.cpp
    M clang/lib/CIR/Dialect/IR/CIRDialect.cpp
    M clang/lib/CIR/Dialect/Transforms/CIRTransformUtils.cpp
    M clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
    M clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.h
    M clang/test/CIR/CodeGen/call.c
    M clang/test/CIR/CodeGen/side-effect.cpp
    M clang/test/CIR/IR/call.cir
    M clang/test/CIR/IR/enum-attrs.cir
    A clang/test/CIR/IR/invalid-effect-attrs.cir
    A clang/test/CIR/Lowering/memory-effects.cir
    M clang/test/CIR/Transforms/flatten-preserve-attrs.cir
    M clang/test/CIR/Transforms/idiom-recognizer.cpp

  Log Message:
  -----------
  [CIR] Split side_effect into memory effects, nounwind, and willreturn (#223890)

`side_effect` was carrying three facts at once. It described the memory
a callee may touch, and it was also the only thing lowering derived
`nounwind` and `willreturn` from, so any callee with a known memory
effect got both. That is wrong for one that can throw, and `willreturn`
had no other representation in CIR at all.

`const`, `pure` and `noalias` now record the three separately, and the
enum is replaced by a structured `#cir.memory_effects` carrying the same
six ModRef slots as the LLVM dialect. It has no keyword syntax of its
own, so on an operation it sits in the attribute dictionary.

The only change in emitted IR is for `__declspec(noalias)`, which the
old enum could not express, and which now gets
`inaccessibleOrArgMemOnly` and `nounwind` to match classic. Everything
else lowers exactly as it did.

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