[rtsan] Remove mkfifoat interceptor (#116997)
[llvm-project.git] / mlir / lib / IR / RegionKindInterface.cpp
blob007f4cf92dbc7aee2c869c7ead773e4112a7ffc8
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`.
12 //===----------------------------------------------------------------------===//
14 #include "mlir/IR/RegionKindInterface.h"
16 using namespace mlir;
18 #include "mlir/IR/RegionKindInterface.cpp.inc"
20 bool mlir::mayHaveSSADominance(Region &region) {
21 auto regionKindOp = dyn_cast<RegionKindInterface>(region.getParentOp());
22 if (!regionKindOp)
23 return true;
24 return regionKindOp.hasSSADominance(region.getRegionNumber());
27 bool mlir::mayBeGraphRegion(Region &region) {
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());