This is an archive of the discontinued LLVM Phabricator instance.

[LoopReroll] Alter the data structures used during reroll validation.
ClosedPublic

Authored by jmolloy on Jan 29 2015, 11:36 AM.

Details

Reviewers
hfinkel
Summary

The validation algorithm used an incremental approach, building each
iteration's data structures temporarily, validating them, then
adding them to a global set.

This does not scale well to having multiple sets of Root nodes, as the
set of instructions used in each iteration is the union over all
the root nodes. Therefore, refactor the logic to create a single, simple
container to which later logic then refers. This makes it simpler
control-flow wise to make the creation of the container more complex with
the addition of multiple root sets.

Diff Detail

Event Timeline

jmolloy updated this revision to Diff 18970.Jan 29 2015, 11:36 AM
jmolloy retitled this revision from to [LoopReroll] Alter the data structures used during reroll validation..
jmolloy updated this object.
jmolloy edited the test plan for this revision. (Show Details)
jmolloy added a reviewer: hfinkel.
jmolloy set the repository for this revision to rL LLVM.
jmolloy added a subscriber: Unknown Object (MLST).
hfinkel accepted this revision.Jan 29 2015, 12:43 PM
hfinkel edited edge metadata.

LGTM, with some minor issues below.

lib/Transforms/Scalar/LoopRerollPass.cpp
739

I believe you need { } around the bodies of all range-based for loops in order to make some version of MSVC (2012?) happy.

(this applies to all of them)

783

Let's use a typedef for MapVector<Instruction*, SmallBitVector>

1040

:( -- Now I don't recall exactly (I should have added a comment). Was it for unconditional branches?

This revision is now accepted and ready to land.Jan 29 2015, 12:43 PM
jmolloy closed this revision.Jan 29 2015, 1:54 PM

Thanks Hal - committed with your changes in r227499.

Cheers,

James

lib/Transforms/Scalar/LoopRerollPass.cpp
739

Oh man, that's horrible! :(