mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 00:32:55 +00:00
[asan] change the default mapping offset on x86_64 to 0x7fff8000. This gives roughly 5% speedup. Since this is an ABI change, bump the asan ABI version by renaming __asan_init to __asan_init_v1. llvm part, compiler-rt part will follow
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174957 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f54676234a
commit
0bc55d517e
@ -68,7 +68,7 @@ static const char *kAsanRegisterGlobalsName = "__asan_register_globals";
|
||||
static const char *kAsanUnregisterGlobalsName = "__asan_unregister_globals";
|
||||
static const char *kAsanPoisonGlobalsName = "__asan_before_dynamic_init";
|
||||
static const char *kAsanUnpoisonGlobalsName = "__asan_after_dynamic_init";
|
||||
static const char *kAsanInitName = "__asan_init";
|
||||
static const char *kAsanInitName = "__asan_init_v1";
|
||||
static const char *kAsanHandleNoReturnName = "__asan_handle_no_return";
|
||||
static const char *kAsanMappingOffsetName = "__asan_mapping_offset";
|
||||
static const char *kAsanMappingScaleName = "__asan_mapping_scale";
|
||||
@ -136,7 +136,7 @@ static cl::opt<int> ClMappingOffsetLog("asan-mapping-offset-log",
|
||||
cl::desc("offset of asan shadow mapping"), cl::Hidden, cl::init(-1));
|
||||
static cl::opt<bool> ClShort64BitOffset("asan-short-64bit-mapping-offset",
|
||||
cl::desc("Use short immediate constant as the mapping offset for 64bit"),
|
||||
cl::Hidden, cl::init(false));
|
||||
cl::Hidden, cl::init(true));
|
||||
|
||||
// Optimization flags. Not user visible, used mostly for testing
|
||||
// and benchmarking the tool.
|
||||
@ -203,6 +203,7 @@ static ShadowMapping getShadowMapping(const Module &M, int LongSize,
|
||||
llvm::Triple TargetTriple(M.getTargetTriple());
|
||||
bool IsAndroid = TargetTriple.getEnvironment() == llvm::Triple::Android;
|
||||
bool IsPPC64 = TargetTriple.getArch() == llvm::Triple::ppc64;
|
||||
bool IsX86_64 = TargetTriple.getArch() == llvm::Triple::x86_64;
|
||||
|
||||
ShadowMapping Mapping;
|
||||
|
||||
@ -214,7 +215,8 @@ static ShadowMapping getShadowMapping(const Module &M, int LongSize,
|
||||
Mapping.Offset = (IsAndroid || ZeroBaseShadow) ? 0 :
|
||||
(LongSize == 32 ? kDefaultShadowOffset32 :
|
||||
IsPPC64 ? kPPC64_ShadowOffset64 : kDefaultShadowOffset64);
|
||||
if (!ZeroBaseShadow && ClShort64BitOffset && LongSize == 64) {
|
||||
if (!ZeroBaseShadow && ClShort64BitOffset && IsX86_64) {
|
||||
assert(LongSize == 64);
|
||||
Mapping.Offset = kDefaultShort64bitShadowOffset;
|
||||
} if (!ZeroBaseShadow && ClMappingOffsetLog >= 0) {
|
||||
// Zero offset log is the special case.
|
||||
|
Loading…
x
Reference in New Issue
Block a user