[PATCH] D31488: [SimplifyIndvar] Replace the sdiv used by IV if we can prove both of its operands are non-negative

Hongbin Zheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 30 14:56:44 PDT 2017


etherzhhb added a comment.

In https://reviews.llvm.org/D31488#714492, @sanjoy wrote:

> Comments inline.
>
> You can also do this same rewrite within SCEV.  That is, try to have `getSCEV(sdiv instruction)` return a `SCEVUDivExpr` if legal.


This also sounds reasonable and I can also look at that after this.
Just a quick question: are we suppose to use getSCEVAtScope in getSCEV?

>   However, given that `udiv` is more canonical, this patch is good too if it solves your problem.




Repository:
  rL LLVM

https://reviews.llvm.org/D31488





More information about the llvm-commits mailing list