[ScalarEvolution] createSCEV(): recognize `udiv`/`urem` disguised as an…

Authored by lebedev.ri on Jul 2 2020, 2:44 AM.


[ScalarEvolution] createSCEV(): recognize udiv/urem disguised as an sdiv/srem

While InstCombine trivially converts that srem into a urem,
it might happen later than wanted, in particular i'd like
for that to happen on https://godbolt.org/z/bwuEmJ test case
early in pipeline, before first instcombine run, just before -mem2reg.

SCEV should recognize this case natively.

Reviewers: mkazantsev, efriedma, nikic, reames

Reviewed By: efriedma

Subscribers: clementval, hiraditya, javed.absar, llvm-commits

Tags: #llvm

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