diff options
author | Tim Shen <timshen91@gmail.com> | 2018-07-02 20:01:54 +0000 |
---|---|---|
committer | Tim Shen <timshen91@gmail.com> | 2018-07-02 20:01:54 +0000 |
commit | c7cef4bcc4400673ffb86be04c006790577f7f56 (patch) | |
tree | 022bdc0f4bbbd8ba8c449d7e09b10ce282886a0c /llvm/test/Analysis/LoopAccessAnalysis/wrapping-pointer-versioning.ll | |
parent | 4bc7f3d4d635c05a874c180c03e7a0c130f07cd2 (diff) | |
download | bcm5719-llvm-c7cef4bcc4400673ffb86be04c006790577f7f56.tar.gz bcm5719-llvm-c7cef4bcc4400673ffb86be04c006790577f7f56.zip |
[SCEV] Strengthen StrengthenNoWrapFlags (reapply r334428).
Summary:
Comment on Transforms/LoopVersioning/incorrect-phi.ll: With the change
SCEV is able to prove that the loop doesn't wrap-self (due to zext i16
to i64), disabling the entire loop versioning pass. Removed the zext and
just use i64.
Reviewers: sanjoy
Subscribers: jlebar, hiraditya, javed.absar, bixia, llvm-commits
Differential Revision: https://reviews.llvm.org/D48409
llvm-svn: 336140
Diffstat (limited to 'llvm/test/Analysis/LoopAccessAnalysis/wrapping-pointer-versioning.ll')
-rw-r--r-- | llvm/test/Analysis/LoopAccessAnalysis/wrapping-pointer-versioning.ll | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/test/Analysis/LoopAccessAnalysis/wrapping-pointer-versioning.ll b/llvm/test/Analysis/LoopAccessAnalysis/wrapping-pointer-versioning.ll index d448a270d96..a7e5bce7445 100644 --- a/llvm/test/Analysis/LoopAccessAnalysis/wrapping-pointer-versioning.ll +++ b/llvm/test/Analysis/LoopAccessAnalysis/wrapping-pointer-versioning.ll @@ -33,7 +33,7 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" ; i64 {0,+,2}<%for.body> ; LAA: [PSE] %arrayidxA = getelementptr i16, i16* %a, i64 %mul_ext: -; LAA-NEXT: ((2 * (zext i32 {0,+,2}<%for.body> to i64)) + %a) +; LAA-NEXT: ((2 * (zext i32 {0,+,2}<%for.body> to i64))<nuw><nsw> + %a) ; LAA-NEXT: --> {%a,+,4}<%for.body> @@ -130,7 +130,7 @@ for.end: ; preds = %for.body ; i64 {zext i32 (2 * (trunc i64 %N to i32)) to i64,+,-2}<%for.body> ; LAA: [PSE] %arrayidxA = getelementptr i16, i16* %a, i64 %mul_ext: -; LAA-NEXT: ((2 * (zext i32 {(2 * (trunc i64 %N to i32)),+,-2}<%for.body> to i64)) + %a) +; LAA-NEXT: ((2 * (zext i32 {(2 * (trunc i64 %N to i32)),+,-2}<%for.body> to i64))<nuw><nsw> + %a) ; LAA-NEXT: --> {((4 * (zext i31 (trunc i64 %N to i31) to i64)) + %a),+,-4}<%for.body> ; LV-LABEL: f2 @@ -210,7 +210,7 @@ for.end: ; preds = %for.body ; i64 {0,+,2}<%for.body> ; LAA: [PSE] %arrayidxA = getelementptr i16, i16* %a, i64 %mul_ext: -; LAA-NEXT: ((2 * (sext i32 {0,+,2}<%for.body> to i64)) + %a) +; LAA-NEXT: ((2 * (sext i32 {0,+,2}<%for.body> to i64))<nsw> + %a) ; LAA-NEXT: --> {%a,+,4}<%for.body> ; LV-LABEL: f3 @@ -278,7 +278,7 @@ for.end: ; preds = %for.body ; LAA: Memory dependences are safe{{$}} ; LAA: SCEV assumptions: ; LAA-NEXT: {(2 * (trunc i64 %N to i32)),+,-2}<%for.body> Added Flags: <nssw> -; LAA-NEXT: {((2 * (sext i32 (2 * (trunc i64 %N to i32)) to i64)) + %a),+,-4}<%for.body> Added Flags: <nusw> +; LAA-NEXT: {((2 * (sext i32 (2 * (trunc i64 %N to i32)) to i64))<nsw> + %a),+,-4}<%for.body> Added Flags: <nusw> ; The expression for %mul_ext as analyzed by SCEV is ; i64 (sext i32 {(2 * (trunc i64 %N to i32)),+,-2}<%for.body> to i64) @@ -286,8 +286,8 @@ for.end: ; preds = %for.body ; i64 {sext i32 (2 * (trunc i64 %N to i32)) to i64,+,-2}<%for.body> ; LAA: [PSE] %arrayidxA = getelementptr i16, i16* %a, i64 %mul_ext: -; LAA-NEXT: ((2 * (sext i32 {(2 * (trunc i64 %N to i32)),+,-2}<%for.body> to i64)) + %a) -; LAA-NEXT: --> {((2 * (sext i32 (2 * (trunc i64 %N to i32)) to i64)) + %a),+,-4}<%for.body> +; LAA-NEXT: ((2 * (sext i32 {(2 * (trunc i64 %N to i32)),+,-2}<%for.body> to i64))<nsw> + %a) +; LAA-NEXT: --> {((2 * (sext i32 (2 * (trunc i64 %N to i32)) to i64))<nsw> + %a),+,-4}<%for.body> ; LV-LABEL: f4 ; LV-LABEL: for.body.lver.check @@ -362,11 +362,11 @@ for.end: ; preds = %for.body ; LAA: Memory dependences are safe{{$}} ; LAA: SCEV assumptions: ; LAA-NEXT: {(2 * (trunc i64 %N to i32)),+,-2}<%for.body> Added Flags: <nssw> -; LAA-NEXT: {((2 * (sext i32 (2 * (trunc i64 %N to i32)) to i64)) + %a),+,-4}<%for.body> Added Flags: <nusw> +; LAA-NEXT: {((2 * (sext i32 (2 * (trunc i64 %N to i32)) to i64))<nsw> + %a),+,-4}<%for.body> Added Flags: <nusw> ; LAA: [PSE] %arrayidxA = getelementptr inbounds i16, i16* %a, i32 %mul: ; LAA-NEXT: ((2 * (sext i32 {(2 * (trunc i64 %N to i32)),+,-2}<%for.body> to i64))<nsw> + %a)<nsw> -; LAA-NEXT: --> {((2 * (sext i32 (2 * (trunc i64 %N to i32)) to i64)) + %a),+,-4}<%for.body> +; LAA-NEXT: --> {((2 * (sext i32 (2 * (trunc i64 %N to i32)) to i64))<nsw> + %a),+,-4}<%for.body> ; LV-LABEL: f5 ; LV-LABEL: for.body.lver.check |