This is an archive of the discontinued LLVM Phabricator instance.

[NFC][HWASan] Refactor hwasan pass
ClosedPublic

Authored by leonardchan on Jun 24 2022, 12:32 PM.

Details

Summary

This moves some code for getting PC and SP into their own functions. Since SP is also retrieved in the prologue and getting the stack tag, we can cache the SP if we get it once in the prologue. This caching will really only be relevant in D128387 where StackBaseTag may not be set in the prologue if __hwasan_tls is not used.

Diff Detail

Event Timeline

leonardchan created this revision.Jun 24 2022, 12:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2022, 12:32 PM
leonardchan requested review of this revision.Jun 24 2022, 12:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2022, 12:32 PM
vitalybuka accepted this revision.Jun 24 2022, 1:55 PM
vitalybuka added inline comments.
llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
1121–1130

llvm mostly don't use {} for one liners
and we can avoid variables

This revision is now accepted and ready to land.Jun 24 2022, 1:55 PM
This revision was landed with ongoing or failed builds.Jun 28 2022, 12:09 PM
This revision was automatically updated to reflect the committed changes.
leonardchan marked an inline comment as done.