summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Transforms/Utils/RegionUtils.cpp
diff options
context:
space:
mode:
authorRiver Riddle <riverriddle@google.com>2019-08-09 20:07:25 -0700
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-08-09 20:07:52 -0700
commit1e42954032cd4288963b652e1eeeb26915cf8eac (patch)
tree654703084ad169c57e34b5e4a9ffc54ccfac4302 /mlir/lib/Transforms/Utils/RegionUtils.cpp
parentac68637ba94d05f413b1b963950c300fb2f81a99 (diff)
downloadbcm5719-llvm-1e42954032cd4288963b652e1eeeb26915cf8eac.tar.gz
bcm5719-llvm-1e42954032cd4288963b652e1eeeb26915cf8eac.zip
NFC: Standardize the terminology used for parent ops/regions/etc.
There are currently several different terms used to refer to a parent IR unit in 'get' methods: getParent/getEnclosing/getContaining. This cl standardizes all of these methods to use 'getParent*'. PiperOrigin-RevId: 262680287
Diffstat (limited to 'mlir/lib/Transforms/Utils/RegionUtils.cpp')
-rw-r--r--mlir/lib/Transforms/Utils/RegionUtils.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/mlir/lib/Transforms/Utils/RegionUtils.cpp b/mlir/lib/Transforms/Utils/RegionUtils.cpp
index e9cb11a8ece..a2b4fe3c83f 100644
--- a/mlir/lib/Transforms/Utils/RegionUtils.cpp
+++ b/mlir/lib/Transforms/Utils/RegionUtils.cpp
@@ -27,7 +27,7 @@ using namespace mlir;
void mlir::replaceAllUsesInRegionWith(Value *orig, Value *replacement,
Region &region) {
for (IROperand &use : llvm::make_early_inc_range(orig->getUses())) {
- if (region.isAncestor(use.getOwner()->getContainingRegion()))
+ if (region.isAncestor(use.getOwner()->getParentRegion()))
use.set(replacement);
}
}
@@ -40,8 +40,8 @@ void mlir::getUsedValuesDefinedAbove(Region &region, Region &limit,
// Collect proper ancestors of `limit` upfront to avoid traversing the region
// tree for every value.
llvm::SmallPtrSet<Region *, 4> properAncestors;
- for (auto *reg = limit.getContainingRegion(); reg != nullptr;
- reg = reg->getContainingRegion()) {
+ for (auto *reg = limit.getParentRegion(); reg != nullptr;
+ reg = reg->getParentRegion()) {
properAncestors.insert(reg);
}
@@ -49,7 +49,7 @@ void mlir::getUsedValuesDefinedAbove(Region &region, Region &limit,
for (Value *operand : op->getOperands())
// Collect values that are used by an operation and defined in a proper
// ancestor of region.
- if (properAncestors.count(operand->getContainingRegion()))
+ if (properAncestors.count(operand->getParentRegion()))
values.insert(operand);
});
}
OpenPOWER on IntegriCloud