[PATCH] D73741: [SCEV] SCEVExpander::isHighCostExpansionHelper(): cost-model polynomial recurrence

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 31 07:12:46 PST 2020


lebedev.ri added a comment.

Hmm, though this is still a bit too pessimistic (high) cost if we the same operand (coeffient) more than once, consider:

  C0 + C1*x + C1*x*x

currently will be counted as `2x add + 3x mul`, but `C1*x` part can be reused,
so this is actually just `2x add + 2x mul`:

  C0 + C1*x*(1 + x)

I'm struggling to find a counter-example where such grouping would result in **too** optimistic (low) cost though.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73741/new/

https://reviews.llvm.org/D73741





More information about the llvm-commits mailing list