This is an archive of the discontinued LLVM Phabricator instance.

[LoopUnroll] Convert some existing tests to unit-tests.
ClosedPublic

Authored by mzolotukhin on Mar 4 2016, 6:56 PM.

Details

Summary

As we now have unit-tests for UnrollAnalyzer, we can convert some existing tests to this format. It should make the tests more robust.

Diff Detail

Repository
rL LLVM

Event Timeline

mzolotukhin updated this revision to Diff 49868.Mar 4 2016, 6:56 PM
mzolotukhin retitled this revision from to [LoopUnroll] Convert some existing tests to unit-tests..
mzolotukhin updated this object.
mzolotukhin added reviewers: chandlerc, sanjoy.
mzolotukhin added a subscriber: llvm-commits.
sanjoy accepted this revision.Mar 11 2016, 5:11 PM
sanjoy edited edge metadata.

Hi Michael,

I'm not familiar with the details of UnrolledInstAnalyzer, but this LGTM overall with the nits fixed.

test/Transforms/LoopUnroll/full-unroll-heuristics-cmp.ll
7 ↗(On Diff #49868)

Should these comments be preserved in some form in the new tests? Or do you think that now that we're doing whitebox testing, these comments are obvious?

unittests/Analysis/UnrollAnalyzer.cpp
256 ↗(On Diff #49868)

I think here you need a cast<> not a dyn_cast<>, since you're not actually checking if dyn_cast<> returned a null. Same comment on other dyn_cast<> s in the patch.

This revision is now accepted and ready to land.Mar 11 2016, 5:11 PM
This revision was automatically updated to reflect the committed changes.

Thanks, Sanjoy!

As for the comments - I do think they are no longer need in the new version of the tests. Previously we had to observe side effect of the functions that we can now test directly, and the comments just tried to shed some light on this side effect.

Michael