summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilviu Baranga <silviu.baranga@arm.com>2016-02-08 11:15:29 +0000
committerSilviu Baranga <silviu.baranga@arm.com>2016-02-08 11:15:29 +0000
commit70a98bb9e85fbc2d654c4c9cc360d277b8891db6 (patch)
treef93b0d24632ad4ccc406e3407c7c9a411b9116e8
parenta35fadc7c49fa6949342739f2e75c833a5966fdd (diff)
downloadbcm5719-llvm-70a98bb9e85fbc2d654c4c9cc360d277b8891db6.tar.gz
bcm5719-llvm-70a98bb9e85fbc2d654c4c9cc360d277b8891db6.zip
[LoopVersioning] Don't assert when there are no memchecks
We shouldn't assert when there are no memchecks, since we can have SCEV checks. There is already an assert covering the case where there are no SCEV checks or memchecks. This also changes the LAA pointer wrapping versioning test to use the loop versioning pass (this was how I managed to trigger the assert in the loop versioning pass). llvm-svn: 260086
-rw-r--r--llvm/lib/Transforms/Utils/LoopVersioning.cpp1
-rw-r--r--llvm/test/Analysis/LoopAccessAnalysis/wrapping-pointer-versioning.ll20
2 files changed, 10 insertions, 11 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopVersioning.cpp b/llvm/lib/Transforms/Utils/LoopVersioning.cpp
index 1aeffb79b19..9303dee99db 100644
--- a/llvm/lib/Transforms/Utils/LoopVersioning.cpp
+++ b/llvm/lib/Transforms/Utils/LoopVersioning.cpp
@@ -56,7 +56,6 @@ void LoopVersioning::versionLoop(
BasicBlock *RuntimeCheckBB = VersionedLoop->getLoopPreheader();
std::tie(FirstCheckInst, MemRuntimeCheck) =
LAI.addRuntimeChecks(RuntimeCheckBB->getTerminator(), AliasChecks);
- assert(MemRuntimeCheck && "called even though needsAnyChecking = false");
const SCEVUnionPredicate &Pred = LAI.PSE.getUnionPredicate();
SCEVExpander Exp(*SE, RuntimeCheckBB->getModule()->getDataLayout(),
diff --git a/llvm/test/Analysis/LoopAccessAnalysis/wrapping-pointer-versioning.ll b/llvm/test/Analysis/LoopAccessAnalysis/wrapping-pointer-versioning.ll
index 34d06ef12ea..038a0e3c4d2 100644
--- a/llvm/test/Analysis/LoopAccessAnalysis/wrapping-pointer-versioning.ll
+++ b/llvm/test/Analysis/LoopAccessAnalysis/wrapping-pointer-versioning.ll
@@ -1,5 +1,5 @@
; RUN: opt -basicaa -loop-accesses -analyze < %s | FileCheck %s -check-prefix=LAA
-; RUN: opt -loop-vectorize -force-vector-interleave=1 -force-vector-width=4 -S < %s | FileCheck %s -check-prefix=LV
+; RUN: opt -loop-versioning -S < %s | FileCheck %s -check-prefix=LV
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
@@ -32,12 +32,12 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
; i64 {0,+,2}<%for.body>
; LV-LABEL: f1
-; LV-LABEL: vector.scevcheck
+; LV-LABEL: for.body.lver.check
; LV: [[PredCheck0:%[^ ]*]] = icmp ne i128
; LV: [[Or0:%[^ ]*]] = or i1 false, [[PredCheck0]]
; LV: [[PredCheck1:%[^ ]*]] = icmp ne i128
; LV: [[FinalCheck:%[^ ]*]] = or i1 [[Or0]], [[PredCheck1]]
-; LV: br i1 [[FinalCheck]], label %scalar.ph, label %vector.ph
+; LV: br i1 [[FinalCheck]], label %for.body.ph.lver.orig, label %for.body.ph
define void @f1(i16* noalias %a,
i16* noalias %b, i64 %N) {
entry:
@@ -101,12 +101,12 @@ for.end: ; preds = %for.body
; i64 {zext i32 (2 * (trunc i64 %N to i32)) to i64,+,-2}<%for.body>
; LV-LABEL: f2
-; LV-LABEL: vector.scevcheck
+; LV-LABEL: for.body.lver.check
; LV: [[PredCheck0:%[^ ]*]] = icmp ne i128
; LV: [[Or0:%[^ ]*]] = or i1 false, [[PredCheck0]]
; LV: [[PredCheck1:%[^ ]*]] = icmp ne i128
; LV: [[FinalCheck:%[^ ]*]] = or i1 [[Or0]], [[PredCheck1]]
-; LV: br i1 [[FinalCheck]], label %scalar.ph, label %vector.ph
+; LV: br i1 [[FinalCheck]], label %for.body.ph.lver.orig, label %for.body.ph
define void @f2(i16* noalias %a,
i16* noalias %b, i64 %N) {
entry:
@@ -155,12 +155,12 @@ for.end: ; preds = %for.body
; i64 {0,+,2}<%for.body>
; LV-LABEL: f3
-; LV-LABEL: vector.scevcheck
+; LV-LABEL: for.body.lver.check
; LV: [[PredCheck0:%[^ ]*]] = icmp ne i128
; LV: [[Or0:%[^ ]*]] = or i1 false, [[PredCheck0]]
; LV: [[PredCheck1:%[^ ]*]] = icmp ne i128
; LV: [[FinalCheck:%[^ ]*]] = or i1 [[Or0]], [[PredCheck1]]
-; LV: br i1 [[FinalCheck]], label %scalar.ph, label %vector.ph
+; LV: br i1 [[FinalCheck]], label %for.body.ph.lver.orig, label %for.body.ph
define void @f3(i16* noalias %a,
i16* noalias %b, i64 %N) {
entry:
@@ -205,12 +205,12 @@ for.end: ; preds = %for.body
; i64 {sext i32 (2 * (trunc i64 %N to i32)) to i64,+,-2}<%for.body>
; LV-LABEL: f4
-; LV-LABEL: vector.scevcheck
+; LV-LABEL: for.body.lver.check
; LV: [[PredCheck0:%[^ ]*]] = icmp ne i128
; LV: [[Or0:%[^ ]*]] = or i1 false, [[PredCheck0]]
; LV: [[PredCheck1:%[^ ]*]] = icmp ne i128
; LV: [[FinalCheck:%[^ ]*]] = or i1 [[Or0]], [[PredCheck1]]
-; LV: br i1 [[FinalCheck]], label %scalar.ph, label %vector.ph
+; LV: br i1 [[FinalCheck]], label %for.body.ph.lver.orig, label %for.body.ph
define void @f4(i16* noalias %a,
i16* noalias %b, i64 %N) {
entry:
@@ -258,7 +258,7 @@ for.end: ; preds = %for.body
; LAA-NEXT: {((2 * (sext i32 (2 * (trunc i64 %N to i32)) to i64)) + %a),+,-4}<%for.body> Added Flags: <nusw>
; LV-LABEL: f5
-; LV-LABEL: vector.scevcheck
+; LV-LABEL: for.body.lver.check
define void @f5(i16* noalias %a,
i16* noalias %b, i64 %N) {
entry:
OpenPOWER on IntegriCloud