[LoadStoreConversion] Handle negative indices in boundary checks #3429
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #3240
The issue appeared after disabling
RewriteTensorPointerPassin this PR (#2584). The disabled pass was responsible for the creation of boundary-check-masks and checked that the offset index is greater that zero avoiding out-of-bound loads/stores in case of a negative pointer offsets (exactly the case we see in the problematic test). TheLoadStoreConversionthat was supposed to "replace" the disabled pass in terms of boundary checks, doesn't have "index >= 0" check, causing invalid reads/writes in case of negative indices.We don't see any issues in PVC's CI since the driver doesn't seem to report segfaults to sycl, causing them to be ignored. But on our testing BMG machine, the driver blocks all following commands to the GPU after a segfault, causing the test to fail.
The test (
language/test_block_pointer.py::test_block_copy) passes on the test BMG machine after this fix.