[mlir] Fix resource printing in the presence of multiple dialects
[llvm-project.git] / mlir / lib / IR / RegionKindInterface.cpp
blobcbef3025a5dd626041d53d564b85493a4ab49134
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 =
22 dyn_cast_if_present<RegionKindInterface>(region.getParentOp());
23 if (!regionKindOp)
24 return true;
25 return regionKindOp.hasSSADominance(region.getRegionNumber());