[PATCH] D107850: [asan] [Patch 1/3] Implemented custom calling convention similar to the one used by HWASan for X86.
Vitaly Buka via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 17 16:33:08 PDT 2021
vitalybuka added inline comments.
================
Comment at: llvm/lib/Target/X86/X86MCInstLower.cpp:1369
+ .addReg(X86::R8)
+ .addImm(MappingScale),
+ STI);
----------------
vitalybuka wrote:
> I assumed the goal to move this shadow math into runtime code
> so we have less instructions in the instrumented code.
>
> Also MappingScale and OrShadowOffset are constants.
> It's a little bit not nice that ShadowBase can be dynamic, so each __asan_check_ will have to load it,
> but let's for now care about fixed shadow which is constant.
>
My mistake, runtime has nothing to do with that, we have implementation of callbacks here in object file.
Still those parameters are not needed to be exposed to IR layers. They must be the same for AddressSanitizer.cpp and here. So please just expose some functions e.g. in llvm/Transforms/Instrumentation/AddressSanitizerCommon.h and use them here and there to calculate these values.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107850/new/
https://reviews.llvm.org/D107850
More information about the cfe-commits
mailing list