summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
diff options
context:
space:
mode:
authorRiver Riddle <riverriddle@google.com>2019-12-23 14:45:01 -0800
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-12-23 16:36:53 -0800
commite62a69561fb9d7b1013d2853da68d79a7907fead (patch)
tree0dd059094cbfb8d904513abcdc1fbe8cfa89bb09 /mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
parent5d5bd2e1da29d976cb125dbb3cd097a5e42b2be4 (diff)
downloadbcm5719-llvm-e62a69561fb9d7b1013d2853da68d79a7907fead.tar.gz
bcm5719-llvm-e62a69561fb9d7b1013d2853da68d79a7907fead.zip
NFC: Replace ValuePtr with Value and remove it now that Value is value-typed.
ValuePtr was a temporary typedef during the transition to a value-typed Value. PiperOrigin-RevId: 286945714
Diffstat (limited to 'mlir/lib/Dialect/GPU/IR/GPUDialect.cpp')
-rw-r--r--mlir/lib/Dialect/GPU/IR/GPUDialect.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp b/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
index 422597fe90d..bda8032fc21 100644
--- a/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
+++ b/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
@@ -204,15 +204,14 @@ static ParseResult parseShuffleOp(OpAsmParser &parser, OperationState &state) {
static SmallVector<Type, 4> getValueTypes(ValueRange values) {
SmallVector<Type, 4> types;
types.reserve(values.size());
- for (ValuePtr v : values)
+ for (Value v : values)
types.push_back(v->getType());
return types;
}
-void LaunchOp::build(Builder *builder, OperationState &result,
- ValuePtr gridSizeX, ValuePtr gridSizeY, ValuePtr gridSizeZ,
- ValuePtr blockSizeX, ValuePtr blockSizeY,
- ValuePtr blockSizeZ, ValueRange operands) {
+void LaunchOp::build(Builder *builder, OperationState &result, Value gridSizeX,
+ Value gridSizeY, Value gridSizeZ, Value blockSizeX,
+ Value blockSizeY, Value blockSizeZ, ValueRange operands) {
// Add grid and block sizes as op operands, followed by the data operands.
result.addOperands(
{gridSizeX, gridSizeY, gridSizeZ, blockSizeX, blockSizeY, blockSizeZ});
@@ -519,10 +518,9 @@ void LaunchOp::getCanonicalizationPatterns(OwningRewritePatternList &results,
//===----------------------------------------------------------------------===//
void LaunchFuncOp::build(Builder *builder, OperationState &result,
- GPUFuncOp kernelFunc, ValuePtr gridSizeX,
- ValuePtr gridSizeY, ValuePtr gridSizeZ,
- ValuePtr blockSizeX, ValuePtr blockSizeY,
- ValuePtr blockSizeZ, ValueRange kernelOperands) {
+ GPUFuncOp kernelFunc, Value gridSizeX, Value gridSizeY,
+ Value gridSizeZ, Value blockSizeX, Value blockSizeY,
+ Value blockSizeZ, ValueRange kernelOperands) {
// Add grid and block sizes as op operands, followed by the data operands.
result.addOperands(
{gridSizeX, gridSizeY, gridSizeZ, blockSizeX, blockSizeY, blockSizeZ});
@@ -555,7 +553,7 @@ StringRef LaunchFuncOp::getKernelModuleName() {
.getRootReference();
}
-ValuePtr LaunchFuncOp::getKernelOperand(unsigned i) {
+Value LaunchFuncOp::getKernelOperand(unsigned i) {
return getOperation()->getOperand(i + kNumConfigOperands);
}
@@ -718,14 +716,13 @@ static ParseResult parseGPUFuncOp(OpAsmParser &parser, OperationState &result) {
}
static void printAttributions(OpAsmPrinter &p, StringRef keyword,
- ArrayRef<BlockArgumentPtr> values) {
+ ArrayRef<BlockArgument> values) {
if (values.empty())
return;
p << ' ' << keyword << '(';
- interleaveComma(values, p, [&p](BlockArgumentPtr v) {
- p << *v << " : " << v->getType();
- });
+ interleaveComma(values, p,
+ [&p](BlockArgument v) { p << *v << " : " << v->getType(); });
p << ')';
}
@@ -772,9 +769,9 @@ LogicalResult GPUFuncOp::verifyType() {
}
static LogicalResult verifyAttributions(Operation *op,
- ArrayRef<BlockArgumentPtr> attributions,
+ ArrayRef<BlockArgument> attributions,
unsigned memorySpace) {
- for (ValuePtr v : attributions) {
+ for (Value v : attributions) {
auto type = v->getType().dyn_cast<MemRefType>();
if (!type)
return op->emitOpError() << "expected memref type in attribution";
OpenPOWER on IntegriCloud