Page MenuHomePhabricator

[Attributor][NFC] Encode IRPositions in the bits of a single pointer

Authored by jdoerfert on Apr 23 2020, 8:59 AM.



This reduces memory consumption for IRPositions by eliminating the
vtable pointer and the KindOrArgNo interger. Since each abstract
attribute has an associated IRPosition, the 12-16 bytes we save add up

No functional change is intended.

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


calls to allocation functions: 469545 (260135/s)
temporary memory allocations: 77137 (42735/s)
peak heap memory consumption: 30.50MB
peak RSS (including heaptrack overhead): 119.50MB
total memory leaked: 269.07KB


calls to allocation functions: 468999 (274108/s)
temporary memory allocations: 77002 (45004/s)
peak heap memory consumption: 28.83MB
peak RSS (including heaptrack overhead): 118.05MB
total memory leaked: 269.07KB


calls to allocation functions: -546 (5808/s)
temporary memory allocations: -135 (1436/s)
peak heap memory consumption: -1.67MB
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

CTMark 15 runs

Metric: compile_time

Program lhs rhs diff
test-suite...:: CTMark/sqlite3/sqlite3.test 25.07 24.09 -3.9%
test-suite...Mark/mafft/pairlocalalign.test 14.58 14.14 -3.0%
test-suite...-typeset/consumer-typeset.test 21.78 21.58 -0.9%
test-suite :: CTMark/SPASS/SPASS.test 21.95 22.03 0.4%
test-suite :: CTMark/lencod/lencod.test 25.43 25.50 0.3%
test-suite...ark/tramp3d-v4/tramp3d-v4.test 23.88 23.83 -0.2%
test-suite...TMark/7zip/7zip-benchmark.test 60.24 60.11 -0.2%
test-suite :: CTMark/kimwitu++/kc.test 15.69 15.69 -0.0%
test-suite...:: CTMark/ClamAV/clamscan.test 25.43 25.42 -0.0%
test-suite :: CTMark/Bullet/bullet.test 37.63 37.62 -0.0%
Geomean difference -0.8%

Diff Detail

Event Timeline

jdoerfert created this revision.Apr 23 2020, 8:59 AM
Herald added a reviewer: uenoku. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
lebedev.ri accepted this revision.Apr 23 2020, 9:56 AM

Seems reasonable to me, thanks for looking into it.

This revision is now accepted and ready to land.Apr 23 2020, 9:56 AM
jdoerfert retitled this revision from [Attributor][NFC] Encode IRPositions for the bits of a single pointer to [Attributor][NFC] Encode IRPositions in the bits of a single pointer.Apr 23 2020, 10:17 AM
This revision was automatically updated to reflect the committed changes.