[SCEV] Preserve NSW information for sext(subtract).
authorAmara Emerson <amara.emerson@arm.com>
Fri, 4 Aug 2017 20:19:46 +0000 (20:19 +0000)
committerAmara Emerson <amara.emerson@arm.com>
Fri, 4 Aug 2017 20:19:46 +0000 (20:19 +0000)
commit56dca4e3cae307cb7154c83f43282cad54be88a8
treed192d4e67866c03627b7eedf82b0691a8875cad1
parentfcf8e5e34572c16848378232f1b414a4686a4916
[SCEV] Preserve NSW information for sext(subtract).

Pushes the sext onto the operands of a Sub if NSW is present.
Also adds support for propagating the nowrap flags of the
llvm.ssub.with.overflow intrinsic during analysis.

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

llvm-svn: 310117
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Analysis/ScalarEvolution/flags-from-poison.ll
llvm/test/Transforms/LoopStrengthReduce/sext-ind-var.ll