Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disallow prefetch insertion when read barriers are necessary
Disallow prefetch insertion when read barriers are necessary because this optimization may insert loads of array elements past the 0th element for a backwards traversal. That is, if the primary induction variable is traversing the array backwards, on the last iteration of the loop we will be prefetching the (i - 1)th element of the array. Since the prefetch needs to load such an element, we must ensure the read barrier will not trigger on such a value which may "look like" an object. For example today, the (i - 1)th element is really the last word of the array header, which is the `dataAddr` pointer which looks like an object, but it is not. Thus the read barrier may incorrectly trigger on such a value. In theory the same issue can happen on a forward traversal since there may be padding bytes past the end of an array. For this reason we go with the safest route and just disable the entire prefetch insertion optimization if read barriers are necessary. Signed-off-by: Filip Jeremic <fjeremic@ca.ibm.com>
- Loading branch information