Not all operands have a defining operator. without this lowering the following will crash:
func @fill_func(%arg0 : memref<2x2xf32>, %arg1: f32) { linalg.fill(%arg0, %arg1) : memref<2x2xf32>, f32 return }
Differential D73244
[mlir] Fix vectorize transform crashing on none-op operand asaadaldien on Jan 22 2020, 4:59 PM. Authored by
Details
Not all operands have a defining operator. without this lowering the following will crash: func @fill_func(%arg0 : memref<2x2xf32>, %arg1: f32) { linalg.fill(%arg0, %arg1) : memref<2x2xf32>, f32 return }
Diff Detail
Event Timeline
Comment Actions Unit tests: pass. 62114 tests passed, 0 failed and 808 were skipped. clang-tidy: fail. clang-tidy found 0 errors and 1 warnings. clang-format: pass. Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml Comment Actions Unit tests: pass. 62114 tests passed, 0 failed and 808 were skipped. clang-tidy: fail. clang-tidy found 0 errors and 1 warnings. clang-format: pass. Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml Comment Actions Note that for the purpose of vectorizing linalg.fill I was thinking about creating a pattern similar to this: https://github.com/llvm/llvm-project/blob/master/mlir/lib/Dialect/Linalg/Transforms/LinalgTransforms.cpp#L192 In essence this is about creating a vectorization pattern for linalg.fill, not about converting to affine and using vectorization on that. Comment Actions @rriddle This already landed (not sure why not showing that here!) the example in the summary I will added it as a test in a follow up diff. |
You can just change the dyn_cast to dyn_cast_or_null instead.