[llvm-dev] sdiv in array subscript

Hongbin Zheng via llvm-dev llvm-dev at lists.llvm.org
Wed Mar 29 10:35:33 PDT 2017


Hi llvm-dev,

Looks like currently ScalarEvolution will give up if there is a sdiv in
array subscript, e.g.

int i;

A[i * 64 / 2]

in this case ScalarEvolution will just return an unknown for (i * 64 / 2).

For this case, InstCombine will do the jobs, but in general, is there a
pass to deal with the sdiv here? like replace sdiv by udiv based on the
range of "i"?

Thanks
Hongbin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170329/1796952a/attachment.html>


More information about the llvm-dev mailing list