This is an archive of the discontinued LLVM Phabricator instance.

[polly] [ScopInfo] Fix crash with sum of invariant load and AddRec.
ClosedPublic

Authored by efriedma on Jun 15 2017, 4:12 PM.

Details

Summary

r303971 added an assertion that SCEV addition involving an AddRec
and a SCEVUnknown must involve a dominance relation: either the
SCEVUnknown value dominates the AddRec's loop, or the AddRec's
loop header dominates the SCEVUnknown. This is generally fine
for most usage of SCEV because it isn't possible to write an
expression in IR which would violate it, but it's a bit inconvenient
here for polly.

To solve the issue, just avoid creating a SCEV expression which
triggers the asssertion.

I'm not really happy with this solution, but I don't have any better
ideas.

Fixes https://bugs.llvm.org//show_bug.cgi?id=33464.

Diff Detail

Repository
rL LLVM

Event Timeline

efriedma created this revision.Jun 15 2017, 4:12 PM
grosser accepted this revision.Jun 20 2017, 12:20 AM

Yes, this is not an amazing solution, but should work.

This revision is now accepted and ready to land.Jun 20 2017, 12:20 AM
This revision was automatically updated to reflect the committed changes.