This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Linalg tiling: generate code avoding out-of-bounds accesses
ClosedPublic

Authored by ftynse on Jan 29 2020, 2:35 AM.

Details

Summary

After the subview operation was migrated from Linalg to Standard, it changed
semantics and does not guarantee the absence of out-of-bounds accesses through
the created view anymore. Compute the size of the subview to make sure it
always fits within the view (subviews in last iterations of the loops may be
smaller than those in other iterations).

Diff Detail

Event Timeline

ftynse created this revision.Jan 29 2020, 2:35 AM

Unit tests: fail. 62283 tests passed, 1 failed and 831 were skipped.

failed: libc++.std/thread/thread_mutex/thread_mutex_requirements/thread_timedmutex_requirements/thread_timedmutex_recursive/try_lock_until.pass.cpp

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

nicolasvasilache accepted this revision.Jan 31 2020, 6:17 AM

Very cool, thanks Alex-FR!

This revision is now accepted and ready to land.Jan 31 2020, 6:17 AM
nicolasvasilache marked an inline comment as done.Jan 31 2020, 6:19 AM
nicolasvasilache added inline comments.
mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
300

At some point in the future I think I'll start to move some of that boilerplate to StructuredIndexed (e.g. https://github.com/llvm/llvm-project/blob/master/mlir/test/EDSC/builder-api-test.cpp#L909)

This revision was automatically updated to reflect the committed changes.