summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Analysis/Utils.cpp
diff options
context:
space:
mode:
authorRiver Riddle <riverriddle@google.com>2020-01-11 08:54:04 -0800
committerRiver Riddle <riverriddle@google.com>2020-01-11 08:54:39 -0800
commit2bdf33cc4c733342fc83081bc7410ac5e9a24f55 (patch)
tree3306d769c2bbabda1060928e0cea79d021ea9da2 /mlir/lib/Analysis/Utils.cpp
parent1d641daf260308815d014d1bf1b424a1ed1e7277 (diff)
downloadbcm5719-llvm-2bdf33cc4c733342fc83081bc7410ac5e9a24f55.tar.gz
bcm5719-llvm-2bdf33cc4c733342fc83081bc7410ac5e9a24f55.zip
[mlir] NFC: Remove Value::operator* and Value::operator-> now that Value is properly value-typed.
Summary: These were temporary methods used to simplify the transition. Reviewed By: antiagainst Differential Revision: https://reviews.llvm.org/D72548
Diffstat (limited to 'mlir/lib/Analysis/Utils.cpp')
-rw-r--r--mlir/lib/Analysis/Utils.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/mlir/lib/Analysis/Utils.cpp b/mlir/lib/Analysis/Utils.cpp
index 8ddf2e274eb..4991e51d5f0 100644
--- a/mlir/lib/Analysis/Utils.cpp
+++ b/mlir/lib/Analysis/Utils.cpp
@@ -59,12 +59,12 @@ ComputationSliceState::getAsConstraints(FlatAffineConstraints *cst) {
// Add loop bound constraints for values which are loop IVs and equality
// constraints for symbols which are constants.
for (const auto &value : values) {
- assert(cst->containsId(*value) && "value expected to be present");
+ assert(cst->containsId(value) && "value expected to be present");
if (isValidSymbol(value)) {
// Check if the symbol is a constant.
- if (auto cOp = dyn_cast_or_null<ConstantIndexOp>(value->getDefiningOp()))
- cst->setIdToConstant(*value, cOp.getValue());
+ if (auto cOp = dyn_cast_or_null<ConstantIndexOp>(value.getDefiningOp()))
+ cst->setIdToConstant(value, cOp.getValue());
} else if (auto loop = getForInductionVarOwner(value)) {
if (failed(cst->addAffineForOpDomain(loop)))
return failure();
@@ -88,13 +88,13 @@ void ComputationSliceState::clearBounds() {
}
unsigned MemRefRegion::getRank() const {
- return memref->getType().cast<MemRefType>().getRank();
+ return memref.getType().cast<MemRefType>().getRank();
}
Optional<int64_t> MemRefRegion::getConstantBoundingSizeAndShape(
SmallVectorImpl<int64_t> *shape, std::vector<SmallVector<int64_t, 4>> *lbs,
SmallVectorImpl<int64_t> *lbDivisors) const {
- auto memRefType = memref->getType().cast<MemRefType>();
+ auto memRefType = memref.getType().cast<MemRefType>();
unsigned rank = memRefType.getRank();
if (shape)
shape->reserve(rank);
@@ -228,9 +228,9 @@ LogicalResult MemRefRegion::compute(Operation *op, unsigned loopDepth,
auto symbol = operand;
assert(isValidSymbol(symbol));
// Check if the symbol is a constant.
- if (auto *op = symbol->getDefiningOp()) {
+ if (auto *op = symbol.getDefiningOp()) {
if (auto constOp = dyn_cast<ConstantIndexOp>(op)) {
- cst.setIdToConstant(*symbol, constOp.getValue());
+ cst.setIdToConstant(symbol, constOp.getValue());
}
}
}
@@ -293,7 +293,7 @@ LogicalResult MemRefRegion::compute(Operation *op, unsigned loopDepth,
// to guard against potential over-approximation from projection.
// TODO(andydavis) Support dynamic memref dimensions.
if (addMemRefDimBounds) {
- auto memRefType = memref->getType().cast<MemRefType>();
+ auto memRefType = memref.getType().cast<MemRefType>();
for (unsigned r = 0; r < rank; r++) {
cst.addConstantLowerBound(r, 0);
int64_t dimSize = memRefType.getDimSize(r);
@@ -325,7 +325,7 @@ static unsigned getMemRefEltSizeInBytes(MemRefType memRefType) {
// Returns the size of the region.
Optional<int64_t> MemRefRegion::getRegionSize() {
- auto memRefType = memref->getType().cast<MemRefType>();
+ auto memRefType = memref.getType().cast<MemRefType>();
auto layoutMaps = memRefType.getAffineMaps();
if (layoutMaps.size() > 1 ||
@@ -854,7 +854,7 @@ MemRefAccess::MemRefAccess(Operation *loadOrStoreOpInst) {
}
unsigned MemRefAccess::getRank() const {
- return memref->getType().cast<MemRefType>().getRank();
+ return memref.getType().cast<MemRefType>().getRank();
}
bool MemRefAccess::isStore() const { return isa<AffineStoreOp>(opInst); }
OpenPOWER on IntegriCloud