This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Fix performance issue in LiveDebugVariables
ClosedPublic

Authored by Orlando on Apr 1 2020, 9:09 AM.

Details

Summary

When compiling AMDGPUDisassembler.cpp in a stage 1 trunk build with
CMAKE_BUILD_TYPE=RelWithDebInfo LLVM_USE_SANITIZER=Address LiveDebugVariables
accounts for 21.5% wall clock time. This fix reduces that to 1.2% by switching
out a linked list lookup with a map lookup.

Note that the linked list is still used to group UserValues by vreg. The vreg
lookups don't cause any problems in this pathological case.

N.B. This is the same idea as D68816, which was reverted, except that it is a less intrusive
fix.

Diff Detail

Event Timeline

Orlando created this revision.Apr 1 2020, 9:09 AM
vsk accepted this revision.Apr 1 2020, 10:25 AM

Awesome! Lgtm.

This revision is now accepted and ready to land.Apr 1 2020, 10:25 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 2 2020, 2:09 AM