summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Transforms/MemRefDataFlowOpt.cpp
diff options
context:
space:
mode:
authorUday Bondhugula <bondhugula@google.com>2019-03-01 13:27:06 -0800
committerjpienaar <jpienaar@google.com>2019-03-29 16:53:03 -0700
commit8254aabd4a1788b48907b3052c47f787beb5028c (patch)
treee56114d2f817dd289f7969c9f19e6b46e9994f42 /mlir/lib/Transforms/MemRefDataFlowOpt.cpp
parentd038e3473522418cf11adf796af4596028a9fe67 (diff)
downloadbcm5719-llvm-8254aabd4a1788b48907b3052c47f787beb5028c.tar.gz
bcm5719-llvm-8254aabd4a1788b48907b3052c47f787beb5028c.zip
A simple pass to detect and mark all parallel loops
- detect all parallel loops based on dep information and mark them with a "parallel" attribute - add mlir::isLoopParallel(OpPointer<AffineForOp> ...), and refactor an existing method to use that (reuse some code from @andydavis (cl/236007073) for this) - a simple/meaningful way to test memref dep test as well Ex: $ mlir-opt -detect-parallel test/Transforms/parallelism-detection.mlir #map1 = ()[s0] -> (s0) func @foo(%arg0: index) { %0 = alloc() : memref<1024x1024xvector<64xf32>> %1 = alloc() : memref<1024x1024xvector<64xf32>> %2 = alloc() : memref<1024x1024xvector<64xf32>> for %i0 = 0 to %arg0 { for %i1 = 0 to %arg0 { for %i2 = 0 to %arg0 { %3 = load %0[%i0, %i2] : memref<1024x1024xvector<64xf32>> %4 = load %1[%i2, %i1] : memref<1024x1024xvector<64xf32>> %5 = load %2[%i0, %i1] : memref<1024x1024xvector<64xf32>> %6 = mulf %3, %4 : vector<64xf32> %7 = addf %5, %6 : vector<64xf32> store %7, %2[%i0, %i1] : memref<1024x1024xvector<64xf32>> } {parallel: false} } {parallel: true} } {parallel: true} return } PiperOrigin-RevId: 236367368
Diffstat (limited to 'mlir/lib/Transforms/MemRefDataFlowOpt.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud