diff options
author | River Riddle <riverriddle@google.com> | 2019-12-22 21:59:55 -0800 |
---|---|---|
committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-12-22 22:00:23 -0800 |
commit | 35807bc4c5c9d8abc31ba0b2f955a82abf276e12 (patch) | |
tree | d083d37d993a774239081509a50e3e6c65366421 /mlir/lib/Dialect/Linalg/Utils/Utils.cpp | |
parent | 22954a0e408afde1d8686dffb3a3dcab107a2cd3 (diff) | |
download | bcm5719-llvm-35807bc4c5c9d8abc31ba0b2f955a82abf276e12.tar.gz bcm5719-llvm-35807bc4c5c9d8abc31ba0b2f955a82abf276e12.zip |
NFC: Introduce new ValuePtr/ValueRef typedefs to simplify the transition to Value being value-typed.
This is an initial step to refactoring the representation of OpResult as proposed in: https://groups.google.com/a/tensorflow.org/g/mlir/c/XXzzKhqqF_0/m/v6bKb08WCgAJ
This change will make it much simpler to incrementally transition all of the existing code to use value-typed semantics.
PiperOrigin-RevId: 286844725
Diffstat (limited to 'mlir/lib/Dialect/Linalg/Utils/Utils.cpp')
-rw-r--r-- | mlir/lib/Dialect/Linalg/Utils/Utils.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/mlir/lib/Dialect/Linalg/Utils/Utils.cpp b/mlir/lib/Dialect/Linalg/Utils/Utils.cpp index eb501f9b5b5..125937807f4 100644 --- a/mlir/lib/Dialect/Linalg/Utils/Utils.cpp +++ b/mlir/lib/Dialect/Linalg/Utils/Utils.cpp @@ -92,7 +92,7 @@ mlir::edsc::LoopNestRangeBuilder::LoopNestRangeBuilder( } mlir::edsc::LoopNestRangeBuilder::LoopNestRangeBuilder( - ArrayRef<ValueHandle *> ivs, ArrayRef<Value *> ranges) + ArrayRef<ValueHandle *> ivs, ArrayRef<ValuePtr> ranges) : LoopNestRangeBuilder( ivs, SmallVector<ValueHandle, 4>(ranges.begin(), ranges.end())) {} @@ -106,26 +106,26 @@ ValueHandle LoopNestRangeBuilder::LoopNestRangeBuilder::operator()( return ValueHandle::null(); } -static Value *emitOrFoldComposedAffineApply(OpBuilder &b, Location loc, - AffineMap map, - ArrayRef<Value *> operandsRef, - OperationFolder *folder) { - SmallVector<Value *, 4> operands(operandsRef.begin(), operandsRef.end()); +static ValuePtr emitOrFoldComposedAffineApply(OpBuilder &b, Location loc, + AffineMap map, + ArrayRef<ValuePtr> operandsRef, + OperationFolder *folder) { + SmallVector<ValuePtr, 4> operands(operandsRef.begin(), operandsRef.end()); fullyComposeAffineMapAndOperands(&map, &operands); canonicalizeMapAndOperands(&map, &operands); return folder ? folder->create<AffineApplyOp>(b, loc, map, operands) : b.create<AffineApplyOp>(loc, map, operands); } -SmallVector<Value *, 4> +SmallVector<ValuePtr, 4> mlir::linalg::applyMapToValues(OpBuilder &b, Location loc, AffineMap map, - ArrayRef<Value *> values, + ArrayRef<ValuePtr> values, OperationFolder *folder) { - SmallVector<Value *, 4> res; + SmallVector<ValuePtr, 4> res; res.reserve(map.getNumResults()); unsigned numDims = map.getNumDims(); // For each `expr` in `map`, applies the `expr` to the values extracted from - // ranges. If the resulting application can be folded into a Value*, the + // ranges. If the resulting application can be folded into a Value, the // folding occurs eagerly. Otherwise, an affine.apply operation is emitted. for (auto expr : map.getResults()) { AffineMap map = AffineMap::get(numDims, 0, expr); @@ -137,12 +137,12 @@ mlir::linalg::applyMapToValues(OpBuilder &b, Location loc, AffineMap map, /// Returns all the operands of `linalgOp` that are not views. /// Asserts that these operands are value types to allow transformations like /// tiling to just use the values when cloning `linalgOp`. -SmallVector<Value *, 4> +SmallVector<ValuePtr, 4> mlir::linalg::getAssumedNonViewOperands(LinalgOp linalgOp) { auto *op = linalgOp.getOperation(); unsigned numViews = linalgOp.getNumInputsAndOutputs(); unsigned nOperands = op->getNumOperands() - numViews; - SmallVector<Value *, 4> res; + SmallVector<ValuePtr, 4> res; res.reserve(nOperands); for (unsigned i = 0; i < nOperands; ++i) { res.push_back(op->getOperand(numViews + i)); |