Remove unused code from SCEVAffFunc constructor
llvm-svn: 144224
This commit is contained in:
parent
5683df4a23
commit
fb47d66a06
|
@ -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<SCEVCouldNotCompute>(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<SCEVConstant>(I->second)
|
||||
&& "Expected SCEVConst in coefficient!");
|
||||
|
||||
const SCEV *Var = I->first;
|
||||
|
||||
if (isa<SCEVConstant>(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<SCEVUnknown>(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 {
|
||||
|
|
|
@ -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 ; <i1> [#uses=1]
|
||||
br i1 %0, label %bb.nph8, label %bb4.loopexit
|
||||
|
||||
bb.nph8: ; preds = %entry
|
||||
%1 = ptrtoint i64* %a to i64 ; <i64> [#uses=1]
|
||||
br label %bb
|
||||
|
||||
bb: ; preds = %bb, %bb.nph8
|
||||
%2 = phi i64 [ 0, %bb.nph8 ], [ %5, %bb ] ; <i64> [#uses=3]
|
||||
%3 = inttoptr i64 %2 to i64* ; <i64*> [#uses=1]
|
||||
%4 = getelementptr inbounds i64* %3, i64 %1 ; <i64*> [#uses=1]
|
||||
store i64 %2, i64* %4, align 8
|
||||
%5 = add nsw i64 %2, 1 ; <i64> [#uses=2]
|
||||
%exitcond10 = icmp eq i64 %5, %M ; <i1> [#uses=1]
|
||||
br i1 %exitcond10, label %bb4.loopexit, label %bb
|
||||
|
||||
bb3: ; preds = %bb4.loopexit, %bb3
|
||||
%j.16 = phi i64 [ 0, %bb4.loopexit ], [ %7, %bb3 ] ; <i64> [#uses=3]
|
||||
%scevgep = getelementptr i64* %a, i64 %j.16 ; <i64*> [#uses=1]
|
||||
%tmp = add i64 %j.16, %M ; <i64> [#uses=1]
|
||||
%tmp9 = trunc i64 %tmp to i8 ; <i8> [#uses=1]
|
||||
%6 = sext i8 %tmp9 to i64 ; <i64> [#uses=1]
|
||||
store i64 %6, i64* %scevgep, align 8
|
||||
%7 = add nsw i64 %j.16, 1 ; <i64> [#uses=2]
|
||||
%exitcond = icmp eq i64 %7, %N ; <i1> [#uses=1]
|
||||
br i1 %exitcond, label %return, label %bb3
|
||||
|
||||
bb4.loopexit: ; preds = %bb, %entry
|
||||
%8 = icmp sgt i64 %N, 0 ; <i1> [#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
|
|
@ -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 ; <i64> [#uses=1]
|
||||
%1 = add nsw i64 %0, %m ; <i64> [#uses=3]
|
||||
%2 = icmp sgt i64 %1, 0 ; <i1> [#uses=1]
|
||||
br i1 %2, label %bb, label %bb4.preheader
|
||||
|
||||
bb: ; preds = %bb, %entry
|
||||
%i0.07 = phi i64 [ %3, %bb ], [ 0, %entry ] ; <i64> [#uses=2]
|
||||
%scevgep11 = getelementptr i64* %a, i64 %i0.07 ; <i64*> [#uses=1]
|
||||
store i64 %n, i64* %scevgep11, align 8
|
||||
%3 = add nsw i64 %i0.07, 1 ; <i64> [#uses=2]
|
||||
%exitcond10 = icmp eq i64 %3, %1 ; <i1> [#uses=1]
|
||||
br i1 %exitcond10, label %bb4.preheader, label %bb
|
||||
|
||||
bb4.preheader: ; preds = %bb, %entry
|
||||
%i0.0.lcssa = phi i64 [ 0, %entry ], [ %1, %bb ] ; <i64> [#uses=1]
|
||||
%4 = add nsw i64 %i0.0.lcssa, %m ; <i64> [#uses=2]
|
||||
%5 = icmp sgt i64 %4, 0 ; <i1> [#uses=1]
|
||||
br i1 %5, label %bb3, label %return
|
||||
|
||||
bb3: ; preds = %bb3, %bb4.preheader
|
||||
%i1.06 = phi i64 [ %8, %bb3 ], [ 0, %bb4.preheader ] ; <i64> [#uses=2]
|
||||
%scevgep = getelementptr i64* %a, i64 %i1.06 ; <i64*> [#uses=2]
|
||||
%6 = load i64* %scevgep, align 8 ; <i64> [#uses=1]
|
||||
%7 = add nsw i64 %6, 2 ; <i64> [#uses=1]
|
||||
store i64 %7, i64* %scevgep, align 8
|
||||
%8 = add nsw i64 %i1.06, 1 ; <i64> [#uses=2]
|
||||
%exitcond = icmp eq i64 %8, %4 ; <i1> [#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
|
Loading…
Reference in New Issue