This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Linalg] Fix crash when converting rank-reduced tensor.insert_slice
Needs ReviewPublic

Authored by c-rhodes on Jan 25 2023, 8:35 AM.

Details

Summary

In conversion of tensor.insert_slice op with leading dimensions of size
1 to rank-reduced version, an out-of-bounds call to ArrayRef::slice
causes a crash. It looks like the reassociation is incorrectly computed
for tensors with leading dimensions of size 1.

I'm sure there's a better way to fix this, input would be welcome.

See https://github.com/llvm/llvm-project/issues/60291 for more info.

Diff Detail

Event Timeline

c-rhodes created this revision.Jan 25 2023, 8:35 AM
c-rhodes requested review of this revision.Jan 25 2023, 8:36 AM
mravishankar added inline comments.Jan 26 2023, 9:30 AM
mlir/include/mlir/Dialect/Linalg/Utils/Utils.h
139

Could you document what the insert argument is doing. I am not following whats happening here.

I think the core logic being fixed here is not something I worked on, so I dont have full context. Adding folks who worked on this as reviewers...

pifon2a resigned from this revision.Jan 26 2023, 9:47 AM

I think the core logic being fixed here is not something I worked on, so I dont have full context. Adding folks who worked on this as reviewers...

I did not work on this.