[PATCH] Initial instrumentation based PGO implementation

Justin Bogner mail at justinbogner.com
Thu Dec 19 00:37:10 PST 2013


Eric Christopher <echristo at gmail.com> writes:
> I don't think we should have any executable tests in the front end at all. I
> think the easiest way here would be to check in an input file alongside the
> test file similar to how the Object tests work (an Inputs directory).
>
> Thoughts?

I'm a bit leery of input files, especially since the file format for the
PGO stuff is explicitly in flux here. That said, writing tests the way
you suggest has a number of advantages and tests that only sometimes run
are clearly inferior.

So I went ahead and ripped out the profile-generate part, added an input
file for the profile-use part, and even added a test that we ignore
bogus data, which was impossible with the previous approach.

Doing so pointed out the problem with this change. The tests I had were
testing two things: generating profile data, and using it. Using an
input file was only the latter. That's lame, so I've added a second run
line that spits out IR and checks that we're incrementing the
appropriate counters for the various constructs.

In short, this makes the tests *way* better. They're twice as
complicated, but they're testing twice as much stuff. Check it out.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-CodeGen-Initial-instrumentation-based-PGO-implementa.patch
Type: text/x-patch
Size: 103713 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131219/3d109187/attachment.bin>


More information about the cfe-commits mailing list