This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Cost Add and Mul Expr consistently
AbandonedPublic

Authored by samparker on Aug 17 2020, 6:28 AM.

Details

Summary

In ScalarEvolutionExpander::isHighCostExpansion, the cost of an AddRecExpr is dependent upon the number of terms, which reflects the number of operations required. So this should also be done for normal Add and Mul Exprs too.

Diff Detail

Event Timeline

samparker created this revision.Aug 17 2020, 6:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 17 2020, 6:28 AM
samparker requested review of this revision.Aug 17 2020, 6:28 AM
samparker retitled this revision from [SCEV] Cost Add and Mul Expr differently to [SCEV] Cost Add and Mul Expr consistently.Aug 17 2020, 6:38 AM

I don't understand what is going on here.

samparker added a comment.EditedAug 17 2020, 7:09 AM

In D76434 you highlighted by SCEVNAry expressions can have more than two operands, which would expand to a chain of operations, and the existing costs for AddRecExprs tries to account for that. But this was missing for normal Add and Mul expressions. Have I misunderstood you?

samparker abandoned this revision.Aug 17 2020, 7:36 AM

My mistake!