From: Johannes Doerfert Date: Mon, 2 Feb 2015 19:41:30 +0000 (+0000) Subject: [NFC] Remove some unnecessary local objects X-Git-Tag: llvmorg-3.7.0-rc1~13368 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f33706b53c2a50ae5420fde9efc869545e8dbd5;p=platform%2Fupstream%2Fllvm.git [NFC] Remove some unnecessary local objects llvm-svn: 227844 --- diff --git a/polly/include/polly/TempScopInfo.h b/polly/include/polly/TempScopInfo.h index cc23ccc..44791c0 100644 --- a/polly/include/polly/TempScopInfo.h +++ b/polly/include/polly/TempScopInfo.h @@ -55,6 +55,11 @@ public: SmallVector Subscripts, Sizes; explicit IRAccess(TypeKind Type, Value *BaseAddress, const SCEV *Offset, + unsigned elemBytes, bool Affine) + : BaseAddress(BaseAddress), Offset(Offset), ElemBytes(elemBytes), + Type(Type), IsAffine(Affine) {} + + explicit IRAccess(TypeKind Type, Value *BaseAddress, const SCEV *Offset, unsigned elemBytes, bool Affine, SmallVector Subscripts, SmallVector Sizes) diff --git a/polly/lib/Analysis/TempScopInfo.cpp b/polly/lib/Analysis/TempScopInfo.cpp index 5311148..5076549 100644 --- a/polly/lib/Analysis/TempScopInfo.cpp +++ b/polly/lib/Analysis/TempScopInfo.cpp @@ -136,12 +136,9 @@ bool TempScopInfo::buildScalarDependences(Instruction *Inst, Region *R) { assert(!isa(UI) && "Non synthesizable PHINode found in a SCoP!"); - SmallVector Subscripts, Sizes; - // Use the def instruction as base address of the IRAccess, so that it will // become the name of the scalar access in the polyhedral form. - IRAccess ScalarAccess(IRAccess::READ, Inst, ZeroOffset, 1, true, Subscripts, - Sizes); + IRAccess ScalarAccess(IRAccess::READ, Inst, ZeroOffset, 1, true); AccFuncMap[UseParent].push_back(std::make_pair(ScalarAccess, UI)); } @@ -172,7 +169,6 @@ IRAccess TempScopInfo::buildIRAccess(Instruction *Inst, Loop *L, Region *R) { assert(BasePointer && "Could not find base pointer"); AccessFunction = SE->getMinusSCEV(AccessFunction, BasePointer); - SmallVector Subscripts, Sizes; MemAcc *Acc = InsnToMemAcc[Inst]; if (PollyDelinearize && Acc) @@ -180,11 +176,14 @@ IRAccess TempScopInfo::buildIRAccess(Instruction *Inst, Loop *L, Region *R) { Acc->DelinearizedSubscripts, Acc->Shape->DelinearizedSizes); bool IsAffine = isAffineExpr(R, AccessFunction, *SE, BasePointer->getValue()); + + SmallVector Subscripts, Sizes; Subscripts.push_back(AccessFunction); + Sizes.push_back(SE->getConstant(ZeroOffset->getType(), Size)); + if (!IsAffine && Type == IRAccess::MUST_WRITE) Type = IRAccess::MAY_WRITE; - Sizes.push_back(SE->getConstant(ZeroOffset->getType(), Size)); return IRAccess(Type, BasePointer->getValue(), AccessFunction, Size, IsAffine, Subscripts, Sizes); } @@ -201,9 +200,7 @@ void TempScopInfo::buildAccessFunctions(Region &R, BasicBlock &BB) { if (!isa(Inst) && buildScalarDependences(Inst, &R)) { // If the Instruction is used outside the statement, we need to build the // write access. - SmallVector Subscripts, Sizes; - IRAccess ScalarAccess(IRAccess::MUST_WRITE, Inst, ZeroOffset, 1, true, - Subscripts, Sizes); + IRAccess ScalarAccess(IRAccess::MUST_WRITE, Inst, ZeroOffset, 1, true); Functions.push_back(std::make_pair(ScalarAccess, Inst)); } }