This commit splits the generic part of `LoopInfo` into separate files. These new `GenericLoopInfo` files are located in `llvm/Support` to be inline with `GenericDomTree`. Furthermore, this change ensures that MLIR's Bazel build does not have to link against `LLVMAnalysis` just to use these template headers. Depends on D148219 Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D148235
31 lines
1017 B
C++
31 lines
1017 B
C++
//===- CFGLoopInfo.cpp - LoopInfo analysis for region bodies --------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "mlir/Analysis/CFGLoopInfo.h"
|
|
#include "llvm/Support/GenericLoopInfoImpl.h"
|
|
|
|
// Explicitly instantiate the LoopBase and LoopInfoBase classes defined in
|
|
// LoopInfoImpl.h for CFGLoops
|
|
template class llvm::LoopBase<mlir::Block, mlir::CFGLoop>;
|
|
template class llvm::LoopInfoBase<mlir::Block, mlir::CFGLoop>;
|
|
|
|
using namespace mlir;
|
|
|
|
CFGLoop::CFGLoop(mlir::Block *block)
|
|
: llvm::LoopBase<mlir::Block, CFGLoop>(block) {}
|
|
|
|
CFGLoopInfo::CFGLoopInfo(
|
|
const llvm::DominatorTreeBase<mlir::Block, false> &domTree) {
|
|
analyze(domTree);
|
|
}
|
|
|
|
raw_ostream &mlir::operator<<(raw_ostream &os, mlir::Block &block) {
|
|
block.print(os);
|
|
return os;
|
|
}
|