This is an archive of the discontinued LLVM Phabricator instance.

[ASAN] Initial support memory checks on scalable vector typed allocas
ClosedPublic

Authored by reames on Mar 3 2023, 11:07 AM.

Details

Summary

This patch adjusts the memory instrumentation to account for scalable vector types in allocas. Note that we don't allow scalable vector globals, so we don't need to update that codepath.

A couple points.

First, this simply disables the optimization for scalable allocas. We can revisit this in the future, but it requires a bit of plumbing to get scalable object sizes through the visitor to be useful.

Second, I am simply disabling stack poisoning for scalable vector allocas. This is mostly for staging the change as I can't write a working test for memory instrumentation without doing so. I don't think it's unreasonable to do on it's own basis as without the bailout, we crash the compiler.

Diff Detail

Event Timeline

reames created this revision.Mar 3 2023, 11:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 3 2023, 11:07 AM
reames requested review of this revision.Mar 3 2023, 11:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 3 2023, 11:07 AM

LGTM, I think don't crash the compiler is higher priority.

llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
3500

I guess we can at least assume Offset is safe when Offset >= 0 && Offset < VF, but anyway we have leave a TODO here.

This revision was not accepted when it landed; it landed in state Needs Review.Mar 15 2023, 7:59 AM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.