[asan] Implemented intrinsic for the custom calling convention similar used by HWASan...
authorKirill Stoimenov <kstoimenov@google.com>
Tue, 24 Aug 2021 20:23:47 +0000 (20:23 +0000)
committerKirill Stoimenov <kstoimenov@google.com>
Wed, 25 Aug 2021 15:31:46 +0000 (15:31 +0000)
commit832aae738becbc0ec955144aeca6f4e2ac16e297
tree99d19d70cfea4a814fad0d4ac834cf66f545297c
parented0f4415f002c34ef85e1e4ac2f676cf5314afbe
[asan] Implemented intrinsic for the custom calling convention similar used by HWASan for X86.

The implementation uses the int_asan_check_memaccess intrinsic to instrument the code. The intrinsic is replaced by a call to a function which performs the access check. The generated function names encode the input register name as a number using Reg - X86::NoRegister formula.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D107850
llvm/include/llvm/IR/Intrinsics.td
llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h
llvm/lib/Target/X86/X86AsmPrinter.cpp
llvm/lib/Target/X86/X86AsmPrinter.h
llvm/lib/Target/X86/X86InstrCompiler.td
llvm/lib/Target/X86/X86MCInstLower.cpp
llvm/lib/Target/X86/X86RegisterInfo.td
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
llvm/test/CodeGen/X86/asan-check-memaccess-add.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/asan-check-memaccess-or.ll [new file with mode: 0644]