llvm-project
934638cc - [MLIR][TOSA] Guard scatter lowering against unranked operand (#178188)

Commit
1 day ago
[MLIR][TOSA] Guard scatter lowering against unranked operand (#178188) ### What the problem --tosa-to-scf crashes when lowering tosa.scatter if operands are unranked, because the lowering assumes RankedTensorType and later builds tensor.extract_slice, which asserts on unranked tensors. ### Why it Happened The current pattern does not check operand ranks before lowering, even though the implementation hardcodes 3D (N,W,C) semantics and cannot handle unranked or differently-ranked tensors. ### Whats The Fix Add rank/type guards in ScatterOpConverter and fail the rewrite unless operands are ranked with expected ranks (values/input: rank-3, indices: rank-2), allowing legalization to fail gracefully instead of crashing. Fixes #177966
Author
Parents
Loading