[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:25 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()))
+    return;
+  effects.emplace_back(mlir::MemoryEffects::Read::get());
----------------
xlauko wrote:

Read+Write with no value only covers the default resource, so this is weaker than the "unknown" you get today with no interface, not equivalent to it.

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


More information about the cfe-commits mailing list