From fb47d66a066ab2a9bd94b8d383316a9e1335eba1 Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Wed, 9 Nov 2011 22:34:39 +0000 Subject: [PATCH] Remove unused code from SCEVAffFunc constructor llvm-svn: 144224 --- polly/lib/Analysis/TempScopInfo.cpp | 43 ----------------- polly/test/ScopInfo/cast.ll | 52 -------------------- polly/test/ScopInfo/indvar_out_of_loop_3.ll | 53 --------------------- 3 files changed, 148 deletions(-) delete mode 100644 polly/test/ScopInfo/cast.ll delete mode 100755 polly/test/ScopInfo/indvar_out_of_loop_3.ll diff --git a/polly/lib/Analysis/TempScopInfo.cpp b/polly/lib/Analysis/TempScopInfo.cpp index 8213f470ba4e..afdaf487fb95 100644 --- a/polly/lib/Analysis/TempScopInfo.cpp +++ b/polly/lib/Analysis/TempScopInfo.cpp @@ -40,50 +40,7 @@ SCEVAffFunc::SCEVAffFunc(const SCEV *S, SCEVAffFuncType Type, Region &R, ParamSetType &Params, LoopInfo *LI, ScalarEvolution *SE) : ElemBytes(0), FuncType(Type) { - assert(S && "S can not be null!"); - assert(!isa(S) && "Non affine function in Scop"); - OriginalSCEV = S; - - for (AffineSCEVIterator I = affine_begin(S, SE), E = affine_end(); - I != E; ++I) { - // The constant part must be a SCEVConstant. - // TODO: support sizeof in coefficient. - assert(isa(I->second) - && "Expected SCEVConst in coefficient!"); - - const SCEV *Var = I->first; - - if (isa(Var)) // Extract the constant part. - // Add the translation component. - TransComp = I->second; - else if (Var->getType()->isPointerTy()) { // Extract the base address. - const SCEVUnknown *Addr = dyn_cast(Var); - assert(Addr && "Broken SCEV detected!"); - BaseAddr = Addr->getValue(); - } else { // Extract other affine components. - LnrTrans.insert(*I); - - if (isIndVar(Var, R, *LI, *SE)) - continue; - - assert(isParameter(Var, R, *LI, *SE) - && "Found non affine function in Scop!"); - Params.insert(Var); - } - } -} - -void SCEVAffFunc::print(raw_ostream &OS, bool PrintInequality) const { -} - -void SCEVAffFunc::dump() const { - print(errs()); -} - -inline raw_ostream &operator<<(raw_ostream &OS, const SCEVAffFunc &AffFunc) { - AffFunc.print(OS); - return OS; } void Comparison::print(raw_ostream &OS) const { diff --git a/polly/test/ScopInfo/cast.ll b/polly/test/ScopInfo/cast.ll deleted file mode 100644 index f26e7c4677c4..000000000000 --- a/polly/test/ScopInfo/cast.ll +++ /dev/null @@ -1,52 +0,0 @@ -; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze %s | FileCheck %s -; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -analyze %s | FileCheck %s -;void f(long a[], long N, long M) { -; long i, j, k; -; for (j = 0; j < M; ++j) -; ((long*)j)[(long)a] = j; - -; for (j = 0; j < N; ++j) -; a[j] = (char)(M + j); -;} - -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" -target triple = "x86_64-unknown-linux-gnu" - -define void @f(i64* %a, i64 %N, i64 %M) nounwind { -entry: - %0 = icmp sgt i64 %M, 0 ; [#uses=1] - br i1 %0, label %bb.nph8, label %bb4.loopexit - -bb.nph8: ; preds = %entry - %1 = ptrtoint i64* %a to i64 ; [#uses=1] - br label %bb - -bb: ; preds = %bb, %bb.nph8 - %2 = phi i64 [ 0, %bb.nph8 ], [ %5, %bb ] ; [#uses=3] - %3 = inttoptr i64 %2 to i64* ; [#uses=1] - %4 = getelementptr inbounds i64* %3, i64 %1 ; [#uses=1] - store i64 %2, i64* %4, align 8 - %5 = add nsw i64 %2, 1 ; [#uses=2] - %exitcond10 = icmp eq i64 %5, %M ; [#uses=1] - br i1 %exitcond10, label %bb4.loopexit, label %bb - -bb3: ; preds = %bb4.loopexit, %bb3 - %j.16 = phi i64 [ 0, %bb4.loopexit ], [ %7, %bb3 ] ; [#uses=3] - %scevgep = getelementptr i64* %a, i64 %j.16 ; [#uses=1] - %tmp = add i64 %j.16, %M ; [#uses=1] - %tmp9 = trunc i64 %tmp to i8 ; [#uses=1] - %6 = sext i8 %tmp9 to i64 ; [#uses=1] - store i64 %6, i64* %scevgep, align 8 - %7 = add nsw i64 %j.16, 1 ; [#uses=2] - %exitcond = icmp eq i64 %7, %N ; [#uses=1] - br i1 %exitcond, label %return, label %bb3 - -bb4.loopexit: ; preds = %bb, %entry - %8 = icmp sgt i64 %N, 0 ; [#uses=1] - br i1 %8, label %bb3, label %return - -return: ; preds = %bb4.loopexit, %bb3 - ret void -} - -; CHECK: Scop: bb4.loopexit => return Parameters: (%N, ), Max Loop Depth: 1 diff --git a/polly/test/ScopInfo/indvar_out_of_loop_3.ll b/polly/test/ScopInfo/indvar_out_of_loop_3.ll deleted file mode 100755 index 7d4c4d238195..000000000000 --- a/polly/test/ScopInfo/indvar_out_of_loop_3.ll +++ /dev/null @@ -1,53 +0,0 @@ -; RUN: opt %loadPolly %defaultOpts -polly-prepare -polly-analyze-ir -analyze %s | FileCheck %s - -;void f(long a[], long n, long m) { -; long i0, i1; -; for (i0 = 0; i0 < 2 * n + m; ++i0)//loop0 -; a[i0] = n; - -; for (i1 = 0; i1 < i0 + m; ++i1)//loop1 -; a[i1] += 2; -;} - - -; ModuleID = '/tmp/webcompile/_19162_0.bc' -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" -target triple = "x86_64-linux-gnu" - -define void @_Z1fPlll(i64* nocapture %a, i64 %n, i64 %m) nounwind { -entry: - %0 = shl i64 %n, 1 ; [#uses=1] - %1 = add nsw i64 %0, %m ; [#uses=3] - %2 = icmp sgt i64 %1, 0 ; [#uses=1] - br i1 %2, label %bb, label %bb4.preheader - -bb: ; preds = %bb, %entry - %i0.07 = phi i64 [ %3, %bb ], [ 0, %entry ] ; [#uses=2] - %scevgep11 = getelementptr i64* %a, i64 %i0.07 ; [#uses=1] - store i64 %n, i64* %scevgep11, align 8 - %3 = add nsw i64 %i0.07, 1 ; [#uses=2] - %exitcond10 = icmp eq i64 %3, %1 ; [#uses=1] - br i1 %exitcond10, label %bb4.preheader, label %bb - -bb4.preheader: ; preds = %bb, %entry - %i0.0.lcssa = phi i64 [ 0, %entry ], [ %1, %bb ] ; [#uses=1] - %4 = add nsw i64 %i0.0.lcssa, %m ; [#uses=2] - %5 = icmp sgt i64 %4, 0 ; [#uses=1] - br i1 %5, label %bb3, label %return - -bb3: ; preds = %bb3, %bb4.preheader - %i1.06 = phi i64 [ %8, %bb3 ], [ 0, %bb4.preheader ] ; [#uses=2] - %scevgep = getelementptr i64* %a, i64 %i1.06 ; [#uses=2] - %6 = load i64* %scevgep, align 8 ; [#uses=1] - %7 = add nsw i64 %6, 2 ; [#uses=1] - store i64 %7, i64* %scevgep, align 8 - %8 = add nsw i64 %i1.06, 1 ; [#uses=2] - %exitcond = icmp eq i64 %8, %4 ; [#uses=1] - br i1 %exitcond, label %return, label %bb3 - -return: ; preds = %bb3, %bb4.preheader - ret void -} - - -; CHECK: Scop: entry.split => bb4.preheader.region Parameters: (%m, %n, ), Max Loop