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/GPU/Transforms/KernelOutlining.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/GPU/Transforms/KernelOutlining.cpp')
-rw-r--r-- | mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp b/mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp index 0a6a5915633..8f5f50e4909 100644 --- a/mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp +++ b/mlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp @@ -31,10 +31,10 @@ using namespace mlir; template <typename OpTy> static void createForAllDimensions(OpBuilder &builder, Location loc, - SmallVectorImpl<Value *> &values) { + SmallVectorImpl<ValuePtr> &values) { for (StringRef dim : {"x", "y", "z"}) { - Value *v = builder.create<OpTy>(loc, builder.getIndexType(), - builder.getStringAttr(dim)); + ValuePtr v = builder.create<OpTy>(loc, builder.getIndexType(), + builder.getStringAttr(dim)); values.push_back(v); } } @@ -46,7 +46,7 @@ static void injectGpuIndexOperations(Location loc, Region &body) { OpBuilder builder(loc->getContext()); Block &firstBlock = body.front(); builder.setInsertionPointToStart(&firstBlock); - SmallVector<Value *, 12> indexOps; + SmallVector<ValuePtr, 12> indexOps; createForAllDimensions<gpu::BlockIdOp>(builder, loc, indexOps); createForAllDimensions<gpu::ThreadIdOp>(builder, loc, indexOps); createForAllDimensions<gpu::GridDimOp>(builder, loc, indexOps); @@ -69,7 +69,7 @@ static gpu::LaunchFuncOp inlineBeneficiaryOps(gpu::GPUFuncOp kernelFunc, gpu::LaunchFuncOp launch) { OpBuilder kernelBuilder(kernelFunc.getBody()); auto &firstBlock = kernelFunc.getBody().front(); - SmallVector<Value *, 8> newLaunchArgs; + SmallVector<ValuePtr, 8> newLaunchArgs; BlockAndValueMapping map; for (int i = 0, e = launch.getNumKernelOperands(); i < e; ++i) { map.map(launch.getKernelOperand(i), kernelFunc.getArgument(i)); @@ -82,7 +82,7 @@ static gpu::LaunchFuncOp inlineBeneficiaryOps(gpu::GPUFuncOp kernelFunc, } // Only inline operations that do not create new arguments. if (!llvm::all_of(operandOp->getOperands(), - [map](Value *value) { return map.contains(value); })) { + [map](ValuePtr value) { return map.contains(value); })) { continue; } auto clone = kernelBuilder.clone(*operandOp, map); |