This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Fix PR22856.
ClosedPublic

Authored by sanjoy on Mar 12 2015, 9:14 PM.

Details

Summary

ScalarEvolutionExpander assumes that the header block of a loop is a
legal place to have a use for a phi node. This is true only for phis
that are either in the header or dominate the header block, but it is
not true for phi nodes that are strictly internal to the loop body.

This change teaches ScalarEvolutionExpander to place uses of PHI nodes
in the basic block the PHI nodes belong to. This is always legal, and
hoistIVInc ensures that the said position dominates IsomorphicInc.

Diff Detail

Repository
rL LLVM

Event Timeline

sanjoy updated this revision to Diff 21896.Mar 12 2015, 9:14 PM
sanjoy retitled this revision from to [SCEV] Fix PR22856..
sanjoy updated this object.
sanjoy edited the test plan for this revision. (Show Details)
sanjoy added a reviewer: atrick.
sanjoy added a subscriber: Unknown Object (MLST).
sanjoy updated this revision to Diff 21897.Mar 12 2015, 10:34 PM

Do away with the lambda: it is unnecessary.

atrick accepted this revision.Mar 13 2015, 9:08 AM
atrick edited edge metadata.

LGTM

This revision is now accepted and ready to land.Mar 13 2015, 9:08 AM
This revision was automatically updated to reflect the committed changes.