This is an archive of the discontinued LLVM Phabricator instance.

[ASan] Use stack safety analysis to optimize allocas instrumentation.
ClosedPublic

Authored by kstoimenov on Jul 25 2022, 10:49 AM.

Details

Summary

Added alloca optimization which was missed during the implemenation of D112098.

Diff Detail

Event Timeline

kstoimenov created this revision.Jul 25 2022, 10:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 25 2022, 10:49 AM
kstoimenov requested review of this revision.Jul 25 2022, 10:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 25 2022, 10:49 AM
kstoimenov edited the summary of this revision. (Show Details)Jul 25 2022, 10:50 AM
kstoimenov added a reviewer: vitalybuka.
vitalybuka added inline comments.Jul 26 2022, 5:12 PM
llvm/test/Instrumentation/AddressSanitizer/asan-stack-safety.ll
30

Isn't this pass without the patch?

64–66

probably we don't need these

please rebase, i've improved the test

llvm/test/Instrumentation/AddressSanitizer/asan-stack-safety.ll
7

I believe all of existing tests are affected by the patch, but the signal is
missing @__asan_stack_malloc

Then with this patch we don't have a case:
alloca is not save, but one of accesses is removed

vitalybuka added inline comments.Jul 26 2022, 5:23 PM
llvm/test/Instrumentation/AddressSanitizer/asan-stack-safety.ll
7

I believe all of existing tests are affected by the patch, but the signal is
missing @__asan_stack_malloc

Then with this patch we don't have a case:
alloca is not save, but one of accesses is removed

To clarify, we need new test which contains in one function:
1 unsafe alloca
1 safe load or store (maybe constant offset)
1 unsafe load or store (maybe int function parameter offset)

After rebase.

vitalybuka accepted this revision.Jul 26 2022, 6:48 PM
This revision is now accepted and ready to land.Jul 26 2022, 6:48 PM
This revision was landed with ongoing or failed builds.Jul 26 2022, 6:48 PM
This revision was automatically updated to reflect the committed changes.