This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Fix threshold limit check
Needs RevisionPublic

Authored by javed.absar on Jan 30 2018, 6:38 AM.

Details

Summary

I think the correct AddOpsInlineThreshold size to check is after the Add has been merged with Ops.

Diff Detail

Event Timeline

javed.absar created this revision.Jan 30 2018, 6:38 AM
sanjoy edited reviewers, added: mkazantsev; removed: sanjoy.Jan 30 2018, 10:17 AM
sanjoy added a subscriber: sanjoy.
mkazantsev added inline comments.Feb 2 2018, 12:15 AM
lib/Analysis/ScalarEvolution.cpp
2437

Given that get Add->getNumOperands() is always non-negative, checking both this and Ops.size() > AddOpsInlineThreshold makes no sense.

What was the motivation of that?

any test and/or example of the case?

mkazantsev requested changes to this revision.Feb 6 2018, 10:51 PM

Test needed, condition should be simplified.

This revision now requires changes to proceed.Feb 6 2018, 10:51 PM