diff options
| author | River Riddle <riverriddle@google.com> | 2019-11-13 10:27:21 -0800 |
|---|---|---|
| committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-11-13 10:27:53 -0800 |
| commit | d985c7488393a181f30b0faeb3083ec0c27983eb (patch) | |
| tree | 6d772ec663a965645858879b92f15dfc0260c96f /mlir/lib/Conversion/GPUToSPIRV | |
| parent | f45852be6c152efc377419e3c8bead5d80544223 (diff) | |
| download | bcm5719-llvm-d985c7488393a181f30b0faeb3083ec0c27983eb.tar.gz bcm5719-llvm-d985c7488393a181f30b0faeb3083ec0c27983eb.zip | |
NFC: Refactor block signature conversion to not erase the original arguments.
This refactors the implementation of block signature(type) conversion to not insert fake cast operations to perform the type conversion, but to instead create a new block containing the proper signature. This has the benefit of enabling the use of pre-computed analyses that rely on mapping values. It also leads to a much cleaner implementation overall. The major user facing change is that applySignatureConversion will now replace the entry block of the region, meaning that blocks generally shouldn't be cached over calls to applySignatureConversion.
PiperOrigin-RevId: 280226936
Diffstat (limited to 'mlir/lib/Conversion/GPUToSPIRV')
| -rw-r--r-- | mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp index bf35c2105f8..9a4d9bb158c 100644 --- a/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp +++ b/mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp @@ -98,8 +98,8 @@ ForOpConversion::matchAndRewrite(Operation *op, ArrayRef<Value *> operands, TypeConverter::SignatureConversion signatureConverter( body->getNumArguments()); signatureConverter.remapInput(0, newIndVar); - rewriter.applySignatureConversion(&forOp.getOperation()->getRegion(0), - signatureConverter); + body = rewriter.applySignatureConversion(&forOp.getLoopBody(), + signatureConverter); // Delete the loop terminator. rewriter.eraseOp(body->getTerminator()); |

