[clang] [CIR] Wire unreachable, return, and switch to MemoryEffectsOpInterface (PR #242180)

Henrich Lauko via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 18 03:52:26 PST 2026


================
@@ -1885,6 +1885,29 @@ mlir::LogicalResult cir::ReturnOp::verify() {
   return success();
 }
 
+static void getFunctionExitEffects(
+    mlir::Operation *op,
+    llvm::SmallVectorImpl<mlir::MemoryEffects::EffectInstance> &effects) {
+  if (isa_and_nonnull<cir::FuncOp>(op->getParentOp()))
----------------
xlauko wrote:

Which in-tree transform benefits from the function-level case being pure? A terminator directly in `cir.func` is never a DCE candidate. If the only user is Enzyme, it's hard to justify upstream.

https://github.com/llvm/llvm-project/pull/242180


More information about the cfe-commits mailing list