Index: include/llvm/Support/ArrayRecycler.h =================================================================== --- include/llvm/Support/ArrayRecycler.h +++ include/llvm/Support/ArrayRecycler.h @@ -48,6 +48,8 @@ FreeList *Entry = Bucket[Idx]; if (!Entry) return nullptr; + __asan_unpoison_memory_region(Entry, + sizeof(T) * Capacity::get(Idx).getSize()); Bucket[Idx] = Entry->Next; return reinterpret_cast(Entry); } @@ -60,6 +62,8 @@ Bucket.resize(size_t(Idx) + 1); Entry->Next = Bucket[Idx]; Bucket[Idx] = Entry; + __asan_poison_memory_region(Entry, + sizeof(T) * Capacity::get(Idx).getSize()); } public: Index: include/llvm/Support/Recycler.h =================================================================== --- include/llvm/Support/Recycler.h +++ include/llvm/Support/Recycler.h @@ -43,6 +43,9 @@ FreeNode *pop_val() { auto *Val = FreeList; + // Always unpoison the full Size, because the combiner relies on being able + // to morph SDNodes into MachineSDNodes. + __asan_unpoison_memory_region(FreeList, Size); FreeList = FreeList->Next; return Val; } @@ -50,6 +53,7 @@ void push(FreeNode *N) { N->Next = FreeList; FreeList = N; + __asan_poison_memory_region(FreeList, Size); } public: