This is an archive of the discontinued LLVM Phabricator instance.

[CGP] Replace MaxMemoryUsesToScan cut-off with Use::moveToFrontOfUseList()
Needs ReviewPublic

Authored by rtereshin on Feb 11 2019, 9:48 PM.

Details

Reviewers
bkramer
chandlerc
Summary

This is another take on PR33900: the patch replaces the cut-off based
fix introduced in r308891 with Use::moveToFrontOfUseList() calls
that keep memory uses resulting in early exits from FindAllMemoryUses
in the beginning of the use list, reducing the overall number of iterations
over the users.

The performance impact is measured on the Function.cpp from
PR33900 compiled with -O3:

Fix# of iterationsCodeGenPrepare, sWall Time, s
No (r308891 reverted)367,047,16013.2825.17
Before this patch1,521,6190.0811.96
After this patch76,7330.0511.71

where number of iterations is the number of iterations over the
users in the FindAllMemoryUses function only.

Diff Detail

Repository
rL LLVM