1 //===- RegionKindInterface.cpp - Region Kind Interfaces ---------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file contains the definitions of the region kind interfaces defined in
10 // `RegionKindInterface.td`.
12 //===----------------------------------------------------------------------===//
14 #include "mlir/IR/RegionKindInterface.h"
18 #include "mlir/IR/RegionKindInterface.cpp.inc"
20 bool mlir::mayHaveSSADominance(Region
®ion
) {
21 auto regionKindOp
= dyn_cast
<RegionKindInterface
>(region
.getParentOp());
24 return regionKindOp
.hasSSADominance(region
.getRegionNumber());
27 bool mlir::mayBeGraphRegion(Region
®ion
) {
28 if (!region
.getParentOp()->isRegistered())
30 auto regionKindOp
= dyn_cast
<RegionKindInterface
>(region
.getParentOp());
33 return !regionKindOp
.hasSSADominance(region
.getRegionNumber());