[Attributor] Use the BumpPtrAllocator in InformationCache as well
authorJohannes Doerfert <johannes@jdoerfert.de>
Thu, 16 Apr 2020 22:54:40 +0000 (17:54 -0500)
committerJohannes Doerfert <johannes@jdoerfert.de>
Tue, 21 Apr 2020 02:12:41 +0000 (21:12 -0500)
commit87aa3629856adfd8529a57889c240567b7f5bf13
tree6c0e26ad3be5d51e54947d1bf187d35ca375da49
parent06a8d1aaa696157aa0e3e52429eaea5c66807ccb
[Attributor] Use the BumpPtrAllocator in InformationCache as well

We now also use the BumpPtrAllocator from the Attributor in the
InformationCache. The lifetime of objects in either is pretty much the
same and it should result in consistently good performance regardless of
the allocator.

Doing so requires to call more constructors manually but so far that
does not seem to be problematic or messy.

---

Single run of the Attributor module and then CGSCC pass (oldPM)
for SPASS/clause.c (~10k LLVM-IR loc):

Before:
```
calls to allocation functions: 615359 (368257/s)
temporary memory allocations: 83315 (49859/s)
peak heap memory consumption: 75.64MB
peak RSS (including heaptrack overhead): 163.43MB
total memory leaked: 269.04KB
```

After:
```
calls to allocation functions: 613042 (359555/s)
temporary memory allocations: 83322 (48869/s)
peak heap memory consumption: 75.64MB
peak RSS (including heaptrack overhead): 162.92MB
total memory leaked: 269.04KB
```

Difference:
```
calls to allocation functions: -2317 (-68147/s)
temporary memory allocations: 7 (205/s)
peak heap memory consumption: 2.23KB
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

---
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/lib/Transforms/IPO/Attributor.cpp