This is an archive of the discontinued LLVM Phabricator instance.

[polly] [ScopInfo] Don't pre-compute the name of the Scop's region.
ClosedPublic

Authored by efriedma on Mar 27 2018, 12:19 PM.

Details

Summary

This gets very expensive for basic blocks which don't have a name: it calls printAsOperand, which numbers the entire module. We don't normally need the name anyway, though, so don't compute it by default.

Diff Detail

Repository
rL LLVM

Event Timeline

efriedma created this revision.Mar 27 2018, 12:19 PM
Meinersbur accepted this revision.Mar 27 2018, 12:29 PM

LGTM.

Is there a cost in that the name is not cached anymore? Is it used even if -polly-use-llvm-names is not given?

This revision is now accepted and ready to land.Mar 27 2018, 12:29 PM

With the old pass manager, the only place that actually uses the result of getName() is some debug dumps in include/llvm/IR/PassManager.h. With the new pass manager, it looks like ScopPass.h/ScopPass.cpp call getName() unconditionally... but the result is still only used for debug dumps.

This revision was automatically updated to reflect the committed changes.

Very useful!

Best,
Tobias