[Mlir-commits] [mlir] 595f3e9 - [mlir][IR][NFC] `PostDominanceInfo`: Mark all functions as `const` (#115597)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sun Nov 10 18:43:07 PST 2024
Author: Matthias Springer
Date: 2024-11-11T11:43:04+09:00
New Revision: 595f3e925adaffcb10d40e2e704c67556e9afb18
URL: https://github.com/llvm/llvm-project/commit/595f3e925adaffcb10d40e2e704c67556e9afb18
DIFF: https://github.com/llvm/llvm-project/commit/595f3e925adaffcb10d40e2e704c67556e9afb18.diff
LOG: [mlir][IR][NFC] `PostDominanceInfo`: Mark all functions as `const` (#115597)
Same as `DominanceInfo`, all functions should be `const`.
Added:
Modified:
mlir/include/mlir/IR/Dominance.h
mlir/lib/IR/Dominance.cpp
Removed:
################################################################################
diff --git a/mlir/include/mlir/IR/Dominance.h b/mlir/include/mlir/IR/Dominance.h
index 95c99bd59f7b2f..66b9456533ae04 100644
--- a/mlir/include/mlir/IR/Dominance.h
+++ b/mlir/include/mlir/IR/Dominance.h
@@ -202,20 +202,20 @@ class PostDominanceInfo : public detail::DominanceInfoBase</*IsPostDom=*/true> {
using super::super;
/// Return true if operation A properly postdominates operation B.
- bool properlyPostDominates(Operation *a, Operation *b);
+ bool properlyPostDominates(Operation *a, Operation *b) const;
/// Return true if operation A postdominates operation B.
- bool postDominates(Operation *a, Operation *b) {
+ bool postDominates(Operation *a, Operation *b) const {
return a == b || properlyPostDominates(a, b);
}
/// Return true if the specified block A properly postdominates block B.
- bool properlyPostDominates(Block *a, Block *b) {
+ bool properlyPostDominates(Block *a, Block *b) const {
return super::properlyDominates(a, b);
}
/// Return true if the specified block A postdominates block B.
- bool postDominates(Block *a, Block *b) {
+ bool postDominates(Block *a, Block *b) const {
return a == b || properlyPostDominates(a, b);
}
};
diff --git a/mlir/lib/IR/Dominance.cpp b/mlir/lib/IR/Dominance.cpp
index 31f7e7dbc925ce..62477a823acaaf 100644
--- a/mlir/lib/IR/Dominance.cpp
+++ b/mlir/lib/IR/Dominance.cpp
@@ -327,7 +327,8 @@ bool DominanceInfo::properlyDominates(Value a, Operation *b) const {
//===----------------------------------------------------------------------===//
/// Returns true if statement 'a' properly postdominates statement b.
-bool PostDominanceInfo::properlyPostDominates(Operation *a, Operation *b) {
+bool PostDominanceInfo::properlyPostDominates(Operation *a,
+ Operation *b) const {
auto *aBlock = a->getBlock(), *bBlock = b->getBlock();
assert(aBlock && bBlock && "operations must be in a block");
More information about the Mlir-commits
mailing list