Skip to content
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.

No transformation / debug output from -affine-vectorize #242

Open
bondhugula opened this issue Nov 17, 2019 · 1 comment
Open

No transformation / debug output from -affine-vectorize #242

bondhugula opened this issue Nov 17, 2019 · 1 comment

Comments

@bondhugula
Copy link
Contributor

I notice that for this simple loop nest, -affine-vectorize does nothing, and emits nothing with its -debug-only= option either. I didn't dig any deeper, but at least the second part is an issue. (It probably only tries innermost loop vectorization, but that should be clarified on the top-level comment on Vectorize.cpp.)

$ cat foo.mlir

func @vec(%arg0: memref<1024x1024xf32>, %arg1: memref<1024x1024xf32>, %arg2: memref<1024x1024xf32>) {
  affine.for %i = 0 to 1024 {
    affine.for %j = 0 to 1024 {
      affine.for %k = 0 to 1024 {
        %5 = affine.load %arg0[%i, %k] : memref<1024x1024xf32>
        %6 = affine.load %arg1[%k, %j] : memref<1024x1024xf32>
        %7 = affine.load %arg2[%i, %j] : memref<1024x1024xf32>
        %8 = mulf %5, %6 : f32
        %9 = addf %7, %8 : f32
        affine.store %9, %arg2[%i, %j] : memref<1024x1024xf32>
      }
    }
  }
  return
}

Same output with

$ mlir-opt -affine-vectorize -debug-only=early-vect /tmp/vec.mlir

On a minor note, s/early-vect/affine-vectorize - early-vect is really not meaningful here.

@bondhugula
Copy link
Contributor Author

The issue here is that that the cl flag(s) involved (clVirtualVectorSize) don't have a default value/initialization, nor are they mandatory; as a result, nothing happens by default silently.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant