================
@@ -4383,6 +4391,18 @@ cir::EhTypeIdOp::verifySymbolUses(SymbolTableCollection 
&symbolTable) {
   return success();
 }
 
+//===----------------------------------------------------------------------===//
+// LifetimeStartOp & LifetimeEndOp
+//===----------------------------------------------------------------------===//
+
+LogicalResult cir::LifetimeStartOp::verify() {
+  return verifyProducedBy<cir::AllocaOp>(*this, getPtr(), "ptr");
+}
+
+LogicalResult cir::LifetimeEndOp::verify() {
+  return verifyProducedBy<cir::AllocaOp>(*this, getPtr(), "ptr");
----------------
E00N777 wrote:

I'm intentionally keeping these a 1:1 mirror of llvm.lifetime.start/end,
which aren't SSA-linked, following andy's suggestion to start simple. I did 
prototype
the token form (end taking start's result), but the token has no LLVM type and 
would
need a 1:N lowering pattern or a pre-lowering erase pass like the EH tokens — 
too heavy
for this PR. For now the late pass that emits these markers (only on allocas) 
owns the
start/end pairing; enforcing it in the verifier would need dominance analysis. 
Happy to
revisit a stronger guarantee in a follow-up if you think it's worthwhile.

https://github.com/llvm/llvm-project/pull/199599
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to