[PATCH] D60243: [LSan][AArch64] Speed-up leak-sanitizer on AArch64 for 47-bit VMA

Sebastian Pop via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 8 13:58:57 PDT 2019


sebpop added a comment.

> Also, this is changing only the standalone lsan, not lsan used as part of asan. Right? 
>  standalone lsan is not widely used, AFAICT.

Correct, asan is still very slow with this patch on.
I was trying to reach a patch that is in good shape to be accepted for lsan
before moving on to apply the same solution to asan.

> Can we have few #ifdefs but also not too much duplication?

Avoiding code dup was the intent of the first version of the patch,
and I agree with you that the `ifdefs` with else clauses are ugly...
Do you have a suggestion?

I also tried to create a pointer that we would switch over between the two allocators 32/64.
The problem is to name a type that could point to both allocators:

  using Allocator = CombinedAllocator<                                                                                                                                                          
    PrimeAlloc, AllocatorCache, SecondAlloc, LocalAddressSpaceView>;                                                                                                                            
  
  using Allocator64 = CombinedAllocator<                                                                                                                                                        
    PrimeAlloc64, AllocatorCache64, SecondAlloc, LocalAddressSpaceView>;                                                                                                                        
  
  Allocator a32;
  Allocator64 a64;
  Allocator32or64 *a;
  
  if (47_bit_VMA)
    a = &a64;
  else
    a = &a32;

In that case the rest of the code remains the same, only replacing `a.op()` with `a->op()`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60243/new/

https://reviews.llvm.org/D60243





More information about the llvm-commits mailing list