[llvm] r260086 - [LoopVersioning] Don't assert when there are no memchecks

Silviu Baranga via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 8 03:15:30 PST 2016


Author: sbaranga
Date: Mon Feb  8 05:15:29 2016
New Revision: 260086

URL: http://llvm.org/viewvc/llvm-project?rev=260086&view=rev
Log:
[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).


Modified:
    llvm/trunk/lib/Transforms/Utils/LoopVersioning.cpp
    llvm/trunk/test/Analysis/LoopAccessAnalysis/wrapping-pointer-versioning.ll

Modified: llvm/trunk/lib/Transforms/Utils/LoopVersioning.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopVersioning.cpp?rev=260086&r1=260085&r2=260086&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LoopVersioning.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LoopVersioning.cpp Mon Feb  8 05:15:29 2016
@@ -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(),

Modified: llvm/trunk/test/Analysis/LoopAccessAnalysis/wrapping-pointer-versioning.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/LoopAccessAnalysis/wrapping-pointer-versioning.ll?rev=260086&r1=260085&r2=260086&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/LoopAccessAnalysis/wrapping-pointer-versioning.ll (original)
+++ llvm/trunk/test/Analysis/LoopAccessAnalysis/wrapping-pointer-versioning.ll Mon Feb  8 05:15:29 2016
@@ -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:12
 ;    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:
 ;     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:
 ;     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:
 ;     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:
 ; 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:




More information about the llvm-commits mailing list