This is an archive of the discontinued LLVM Phabricator instance.

msabi: Fix exponential mangling time for certain pathological inputs
ClosedPublic

Authored by thakis on May 31 2019, 1:09 PM.

Details

Summary

Template back references used to be recursively recomputed, add a
memoization cache to cut down on this.

Since there are now two different types of argument maps, rename the
existing TypeBackReferences to FunArgBackReferences, and rename
mangleArgumentType() to mangleFunctionArgumentType().

Fixes PR42091, the input there now takes 50ms instead of 7s to compile.

No intended behavior change.

Diff Detail

Event Timeline

thakis created this revision.May 31 2019, 1:09 PM
thakis retitled this revision from msabi: Fix exponential mangling time in certain pathological inputs to msabi: Fix exponential mangling time for certain pathological inputs.
rnk accepted this revision.May 31 2019, 1:15 PM

lgtm

Thanks for this, I remember a user complained about this a long time ago but we never did anything.

This revision is now accepted and ready to land.May 31 2019, 1:15 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2019, 3:10 AM