llvm-project
da37c76a - [mlir][vector] Add a check to ensure input vector rank equals target shape rank (#127706)

Commit
293 days ago
[mlir][vector] Add a check to ensure input vector rank equals target shape rank (#127706) Fixes issue #126197 The crash is caused because, during IR transformation, the vector-unrolling pass (using ExtractStridedSliceOp) attempts to slice an input vector of higher rank using a target vector of lower rank, which is not supported. Specific example : ``` module { func.func @func1() { %cst_25 = arith.constant dense<3.718400e+04> : vector<4x2x2xf16> %cst_26 = arith.constant dense<1.000000e+00> : vector<24x2x2xf32> %47 = vector.fma %cst_26, %cst_26, %cst_26 : vector<24x2x2xf32> %818 = scf.execute_region -> vector<24x2x2xf32> { scf.yield %47 : vector<24x2x2xf32> } %823 = vector.extract_strided_slice %cst_25 {offsets = [2], sizes = [1], strides = [1]} : vector<4x2x2xf16> to vector<1x2x2xf16> return } } ``` --------- Co-authored-by: Kai Sasaki <lewuathe@gmail.com>
Author
Parents
Loading