[compiler-rt] 87850e9 - [Sanitizer] Clean up SANITIZER_CAN_USE_ALLOCATOR64 logic

Blue Gaston via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 13 09:58:04 PST 2023


Author: Blue Gaston
Date: 2023-01-13T09:57:34-08:00
New Revision: 87850e9bb1554bb2754674563b96f9a84d97a003

URL: https://github.com/llvm/llvm-project/commit/87850e9bb1554bb2754674563b96f9a84d97a003
DIFF: https://github.com/llvm/llvm-project/commit/87850e9bb1554bb2754674563b96f9a84d97a003.diff

LOG: [Sanitizer] Clean up SANITIZER_CAN_USE_ALLOCATOR64 logic

Update: A change to this code recently broke our bots after this change enabled the 64 bit allocator for defined(aarch64): https://reviews.llvm.org/D137136

We added logic initially to get our test passing, but want to further clean up this code to enable MacOS to use allocator64 and increase readability and clarity of the logic.

rdar://103647896

Differential Revision: https://reviews.llvm.org/D141171

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_platform.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
index 98dbfe1b8541..764996e57355 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
@@ -279,16 +279,14 @@
 #endif
 
 // By default we allow to use SizeClassAllocator64 on 64-bit platform.
-// But in some cases (e.g. AArch64's 39-bit address space) SizeClassAllocator64
-// does not work well and we need to fallback to SizeClassAllocator32.
+// But in some cases SizeClassAllocator64 does not work well and we need to
+// fallback to SizeClassAllocator32.
 // For such platforms build this code with -DSANITIZER_CAN_USE_ALLOCATOR64=0 or
 // change the definition of SANITIZER_CAN_USE_ALLOCATOR64 here.
 #ifndef SANITIZER_CAN_USE_ALLOCATOR64
-#  if (SANITIZER_ANDROID && defined(__aarch64__)) || SANITIZER_FUCHSIA
-#    define SANITIZER_CAN_USE_ALLOCATOR64 1
-#  elif defined(__mips64) || defined(__arm__) || defined(__i386__) || \
-      SANITIZER_RISCV64 || defined(__hexagon__) || \
-      (SANITIZER_APPLE && defined(__aarch64__))
+#  if SANITIZER_RISCV64 || SANITIZER_IOS
+#    define SANITIZER_CAN_USE_ALLOCATOR64 0
+#  elif defined(__mips64) || defined(__hexagon__)
 #    define SANITIZER_CAN_USE_ALLOCATOR64 0
 #  else
 #    define SANITIZER_CAN_USE_ALLOCATOR64 (SANITIZER_WORDSIZE == 64)


        


More information about the llvm-commits mailing list