This is an archive of the discontinued LLVM Phabricator instance.

[DependenceAnalysis] Allow subscripts of different types
ClosedPublic

Authored by jingyue on Nov 15 2014, 6:19 PM.

Details

Summary

Several places in DependenceAnalysis assumes both SCEVs in a subscript pair
share the same integer type. For instance, isKnownPredicate calls
SE->getMinusSCEV(X, Y) which asserts X and Y share the same type. However,
DependenceAnalysis fails to ensure this assumption when producing a subscript
pair, causing tests such as NonCanonicalizedSubscript to crash. With this
patch, DependenceAnalysis runs unifySubscriptType before producing any
subscript pair, ensuring the assumption.

Diff Detail

Event Timeline

jingyue updated this revision to Diff 16273.Nov 15 2014, 6:19 PM
jingyue retitled this revision from to [DependenceAnalysis] Allow subscripts of different types.
jingyue updated this object.
jingyue edited the test plan for this revision. (Show Details)
jingyue added a subscriber: Unknown Object (MLST).
jingyue added subscribers: meheff, eliben.
jingyue updated this revision to Diff 16274.Nov 15 2014, 9:24 PM

fixed a minor typo

sebpop edited edge metadata.Nov 16 2014, 7:17 AM

Please add -da-delinearize to the testcase.
Otherwise the patch LGTM.

test/Analysis/DependenceAnalysis/NonCanonicalizedSubscript.ll
2

You also need to add -da-delinearize to exercise the code that you add in this patch: Delinearize is set to false by default.

jingyue updated this revision to Diff 16277.Nov 16 2014, 8:46 AM
jingyue edited edge metadata.

Thanks for the review, Sebastian! Updated the test.

jingyue accepted this revision.Nov 16 2014, 8:52 AM
jingyue added a reviewer: jingyue.

Got LGTM from sebpop.

This revision is now accepted and ready to land.Nov 16 2014, 8:52 AM
jingyue closed this revision.Nov 16 2014, 8:52 AM