[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
diff --git a/llvm/test/Transforms/LoopStrengthReduce/sext-ind-var.ll b/llvm/test/Transforms/LoopStrengthReduce/sext-ind-var.ll
index 3cf8f53..21e72b2 100644
--- a/llvm/test/Transforms/LoopStrengthReduce/sext-ind-var.ll
+++ b/llvm/test/Transforms/LoopStrengthReduce/sext-ind-var.ll
@@ -47,8 +47,7 @@
 ;
 define float @testsub(float* %input, i32 %offset, i32 %numIterations) {
 ; CHECK-LABEL: @testsub
-; CHECK: sub i32 0, %offset
-; CHECK: sext i32
+; CHECK: sext i32 %offset to i64
 ; CHECK: loop:
 ; CHECK-DAG: phi float*
 ; CHECK-DAG: phi i32