This is an archive of the discontinued LLVM Phabricator instance.

[ASAN] Support memory checks on scalable vector typed masked load and store
ClosedPublic

Authored by reames on Mar 2 2023, 3:05 PM.

Details

Summary

This takes the approach of using the loop based formation for scalable vectors only. We could potentially use the loop form for fixed vectors only, but we'd loose the unroll and specialize on constant vector logic which is already present. I don't have a strong opinion on whether the existing logic is worthwhile, I kept it mostly to minimize test churn.

Worth noting is that there is a better lowering available. The plain vector lowering appears to check only the first and last byte. By analogy, we should be able to check only the first active and last active byte in the masked op. This is a more invasive change to asan, and I decided simply supporting scalable vectors at all was a better starting place.

Diff Detail

Event Timeline

reames created this revision.Mar 2 2023, 3:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 2 2023, 3:05 PM
reames requested review of this revision.Mar 2 2023, 3:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 2 2023, 3:05 PM

Changes are look reasonable and good to me, but I am also new for ASan too, I guess we need few more eye to review.

Changes are look reasonable and good to me, but I am also new for ASan too, I guess we need few more eye to review.

Given lack of other activity on the review, I'm going to wait another day or so, and then land.

craig.topper added inline comments.Mar 10 2023, 8:08 AM
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
1515

Can it be a FixedVectorType here?

This revision was not accepted when it landed; it landed in state Needs Review.Mar 10 2023, 4:20 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.