This is an archive of the discontinued LLVM Phabricator instance.

[PGO][CHR] Speed up following long use-def chains.
ClosedPublic

Authored by hjyamauchi on May 22 2019, 9:54 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

hjyamauchi created this revision.May 22 2019, 9:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 22 2019, 9:54 AM

was there a quadratic behavior before ? It seems linear before and after the patch -- but just cut the computation by a factor of 2 . Do you need an option to control the max chain length?

was there a quadratic behavior before ? It seems linear before and after the patch -- but just cut the computation by a factor of 2 . Do you need an option to control the max chain length?

I think at least something more than linear. The downstream nodes got visited many, many times (eg. in the test, imagine how many paths there are from %v301 to %v298, to %v296, then all the way down to %v0.)

We could use a max length option in the future but for now it seems fine.

davidxl accepted this revision.May 22 2019, 11:31 AM

Indeed. The original one is O(N^2). LGTM.

This revision is now accepted and ready to land.May 22 2019, 11:31 AM
This revision was automatically updated to reflect the committed changes.