[llvm-dev] [SCEV] getMulExpr could be extremely slow when creating SCEVs for a long chain of add/mul instructions
Sanjoy Das via llvm-dev
llvm-dev at lists.llvm.org
Wed Aug 3 12:24:11 PDT 2016
Hi Kevin,
Kevin Choi via llvm-dev wrote:
> Correct me if I'm wrong, is the code trying to expand geometric series
> into polynomial expression? (that doesn't sound like a very good thing
> to do, it would spend so much time computing coefficients)
>
> Wouldn't this be better to transform as below:
> mult *= n++ // 30 times
>
> ; into
> mult = mult (n)...(n+29)
> = mult 1...(n+29)/((1)...(n-1))
> = mult * geo_sum(n+29) / geo_sum(n-1) ; is this more expensive
> than leaving as geo series?
Not sure what you mean by geo_sum -- is geo_sum(n) == 1 * 2 * ... * n?
If so, SCEV does not have a node for that.
-- Sanjoy
More information about the llvm-dev
mailing list