HomePhabricator

[mlir] Async reference counting for block successors with divergent reference…

Authored by ezhulenev on May 25 2021, 11:02 AM.

Description

[mlir] Async reference counting for block successors with divergent reference counted liveness

Support reference counted values implicitly passed (live) only to some of the successors.

Example: if branched to ^bb2 token will leak, unless drop_ref operation is properly created

^entry:
  %token = async.runtime.create : !async.token
   cond_br %cond, ^bb1, ^bb2
^bb1:
  async.runtime.await %token
  async.runtime.drop_ref %token
  br ^bb2
^bb2:
  return

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D103102