This is an archive of the discontinued LLVM Phabricator instance.

Add a section about simplifying .mir tests
ClosedPublic

Authored by MatzeB on Apr 13 2017, 3:29 PM.

Details

Summary

I wrote down some tips and tricks to simplify .mir tests.

Any typos or further suggestions?

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB created this revision.Apr 13 2017, 3:29 PM
MatzeB updated this revision to Diff 95229.Apr 13 2017, 3:36 PM

Add a sentence about dropping branch probability information.

ab accepted this revision.Apr 13 2017, 4:24 PM

Makes sense to me. I wish we didn't need this, but progress is made one step at a time

docs/MIRLangRef.rst
117 ↗(On Diff #95229)

Whoa, I didn't know this worked! This section is already helping =]

This revision is now accepted and ready to land.Apr 13 2017, 4:24 PM
In D32058#726790, @ab wrote:

Makes sense to me. I wish we didn't need this, but progress is made one step at a time

Me too! I'd rather have an llc -run-pass=strip-ir than writing explanations on how to do it. But for now this is better than nothing and something you can point to in reviews.

This revision was automatically updated to reflect the committed changes.
qcolombet added inline comments.May 1 2017, 10:15 AM
llvm/trunk/docs/MIRLangRef.rst
120

Isn't that true only if you have one function. I think I saw it failed when having more than one. (We should fix that of course, if that's still the case!)

MatzeB added inline comments.May 1 2017, 10:18 AM
llvm/trunk/docs/MIRLangRef.rst
120

It definitely works with multiple functions. I think the logic just doesn't kick in if no IR block exists in the file.

qcolombet added inline comments.May 1 2017, 10:40 AM
llvm/trunk/docs/MIRLangRef.rst
120

Oh, that could be it. So we at least need to put an empty IR section, right?

MatzeB added inline comments.May 1 2017, 11:25 AM
llvm/trunk/docs/MIRLangRef.rst
120

So we at least need to put an empty IR section, right?

No, that's the point in todays strange behavior: As soon as you have an (even empty) IR section you need to create the dummy functions manually.