[all-commits] [llvm/llvm-project] 0338ff: [CIR] Implement flattening for cleanup scopes with...

Andy Kaylor via All-commits all-commits at lists.llvm.org
Thu Feb 12 13:52:04 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0338ffcb0934210f05bf337c33e6d5ba2607dfa8
      https://github.com/llvm/llvm-project/commit/0338ffcb0934210f05bf337c33e6d5ba2607dfa8
  Author: Andy Kaylor <akaylor at nvidia.com>
  Date:   2026-02-12 (Thu, 12 Feb 2026)

  Changed paths:
    M clang/include/clang/CIR/Dialect/IR/CIROps.td
    M clang/lib/CIR/Dialect/Transforms/FlattenCFG.cpp
    M clang/test/CIR/Transforms/flatten-cleanup-scope-multi-exit.cir
    M clang/test/CIR/Transforms/flatten-cleanup-scope-nyi.cir
    M clang/test/CIR/Transforms/flatten-cleanup-scope-simple.cir

  Log Message:
  -----------
  [CIR] Implement flattening for cleanup scopes with multiple exits (#180627)

This implements CFG flattening for cir.cleanup.scope operations where
the scope body has multiple exits that must all branch through the
cleanup region.

This uses the same strategy that Clang uses when generating LLVM IR for
equivalent cases -- a cleanup destination slot is allocated on the
stack, and a value is stored to this slot before each branch to the
cleanup, indicating where control must go after the cleanup is executed.

Substantial amounts of this PR were created using agentic AI tools, but
I have carefully reviewed the code, comments, and tests and made changes
as needed.



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