[SCEV] Improve zext(A /u B) and zext(A % B)
authorTim Shen <timshen91@gmail.com>
Thu, 21 Jun 2018 01:49:07 +0000 (01:49 +0000)
committerTim Shen <timshen91@gmail.com>
Thu, 21 Jun 2018 01:49:07 +0000 (01:49 +0000)
commit5af61e0a2829122bfba90427648d9a0aa7f00c8d
treedc9efd8177cf760625da1ffffc297e2243a803e5
parent1f3cc8c1d3ea8123f53a99c95d4780fbcadf24cb
[SCEV] Improve zext(A /u B) and zext(A % B)

Summary:
Try to match udiv and urem patterns, and sink zext down to the leaves.

I'm not entirely sure why some unrelated tests change, but the added <nsw>s seem right.

Reviewers: sanjoy

Subscribers: jlebar, hiraditya, bixia, llvm-commits

Differential Revision: https://reviews.llvm.org/D48338

llvm-svn: 335197
llvm/include/llvm/Analysis/ScalarEvolution.h
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Analysis/ScalarEvolution/zext-divrem.ll [new file with mode: 0644]