MLIR 22.0.0git
RegionKindInterface.cpp
Go to the documentation of this file.
1//===- RegionKindInterface.cpp - Region Kind Interfaces ---------*- C++ -*-===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8//
9// This file contains the definitions of the region kind interfaces defined in
10// `RegionKindInterface.td`.
11//
12//===----------------------------------------------------------------------===//
13
15
16using namespace mlir;
17
18#include "mlir/IR/RegionKindInterface.cpp.inc"
19
21 auto regionKindOp = dyn_cast<RegionKindInterface>(region.getParentOp());
22 if (!regionKindOp)
23 return true;
24 return regionKindOp.hasSSADominance(region.getRegionNumber());
25}
26
28 if (!region.getParentOp()->isRegistered())
29 return true;
30 auto regionKindOp = dyn_cast<RegionKindInterface>(region.getParentOp());
31 if (!regionKindOp)
32 return false;
33 return !regionKindOp.hasSSADominance(region.getRegionNumber());
34}
bool isRegistered()
Returns true if this operation has a registered operation description, otherwise false.
Definition Operation.h:129
This class contains a list of basic blocks and a link to the parent operation it is attached to.
Definition Region.h:26
unsigned getRegionNumber()
Return the number of this region in the parent operation.
Definition Region.cpp:62
Operation * getParentOp()
Return the parent operation this region is attached to.
Definition Region.h:200
Include the generated interface declarations.
bool mayBeGraphRegion(Region &region)
Return "true" if the given region may be a graph region without SSA dominance.
bool mayHaveSSADominance(Region &region)
Return "true" if the given region may have SSA dominance.