This is an archive of the discontinued LLVM Phabricator instance.

[NewPM] implement SCC printing for -print-before-all/-print-after-all
ClosedPublic

Authored by fedor.sergeev on Oct 15 2018, 12:14 AM.

Details

Summary

Removing deficiency of initial implementation of -print-before-all/-after-all - it was effectively skipping IR printing for all the SCC passes.
Now LazyCallGraph:SCC gets its IR printed.

Diff Detail

Event Timeline

fedor.sergeev created this revision.Oct 15 2018, 12:14 AM
skatkov added inline comments.Oct 15 2018, 12:21 AM
lib/Passes/StandardInstrumentations.cpp
40

what about CallGraphSCC?
I seen an implementation for LazyCakkGraph but do not see for CallGraphSCC?

61

indent

76

break;

What was the deficiency of the initial implementation this is fixing?

clang-formatted

fedor.sergeev edited the summary of this revision. (Show Details)Oct 15 2018, 12:36 AM
fedor.sergeev marked 2 inline comments as done.Oct 15 2018, 12:38 AM
fedor.sergeev added inline comments.
lib/Passes/StandardInstrumentations.cpp
40

CallGraphSCC is a legacy thing for legacy CallGraphSCCPass.
Attempt to call unwrapAndPrint with anything other than new-pm IRUnits will lead to llvm-unreachable at the end of this function.

skatkov added inline comments.Oct 15 2018, 12:40 AM
lib/Passes/StandardInstrumentations.cpp
75

Still believe you could do break in case you found a module.

fedor.sergeev marked an inline comment as done.

addressing the remaining comment

fedor.sergeev marked 2 inline comments as done.Oct 15 2018, 12:43 AM
skatkov accepted this revision.Oct 15 2018, 12:53 AM
This revision is now accepted and ready to land.Oct 15 2018, 12:53 AM

So is this just a bugfix? Or does it add functionality?

It is a bugfix that adds missing functionality of actually printing an SCC. :)
When doing initial implementation I got a wrong assumption that SCC does not need to be printed since it will be printed on Function level.
For actual SCC passes this assumption is clearly wrong. And it gets fixed now.

This revision was automatically updated to reflect the committed changes.