[polly] r227844 - [NFC] Remove some unnecessary local objects
Johannes Doerfert
doerfert at cs.uni-saarland.de
Mon Feb 2 11:41:30 PST 2015
Author: jdoerfert
Date: Mon Feb 2 13:41:30 2015
New Revision: 227844
URL: http://llvm.org/viewvc/llvm-project?rev=227844&view=rev
Log:
[NFC] Remove some unnecessary local objects
Modified:
polly/trunk/include/polly/TempScopInfo.h
polly/trunk/lib/Analysis/TempScopInfo.cpp
Modified: polly/trunk/include/polly/TempScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/TempScopInfo.h?rev=227844&r1=227843&r2=227844&view=diff
==============================================================================
--- polly/trunk/include/polly/TempScopInfo.h (original)
+++ polly/trunk/include/polly/TempScopInfo.h Mon Feb 2 13:41:30 2015
@@ -55,6 +55,11 @@ public:
SmallVector<const SCEV *, 4> 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<const SCEV *, 4> Subscripts,
SmallVector<const SCEV *, 4> Sizes)
Modified: polly/trunk/lib/Analysis/TempScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/TempScopInfo.cpp?rev=227844&r1=227843&r2=227844&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/TempScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/TempScopInfo.cpp Mon Feb 2 13:41:30 2015
@@ -136,12 +136,9 @@ bool TempScopInfo::buildScalarDependence
assert(!isa<PHINode>(UI) && "Non synthesizable PHINode found in a SCoP!");
- SmallVector<const SCEV *, 4> 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(Ins
assert(BasePointer && "Could not find base pointer");
AccessFunction = SE->getMinusSCEV(AccessFunction, BasePointer);
- SmallVector<const SCEV *, 4> Subscripts, Sizes;
MemAcc *Acc = InsnToMemAcc[Inst];
if (PollyDelinearize && Acc)
@@ -180,11 +176,14 @@ IRAccess TempScopInfo::buildIRAccess(Ins
Acc->DelinearizedSubscripts, Acc->Shape->DelinearizedSizes);
bool IsAffine = isAffineExpr(R, AccessFunction, *SE, BasePointer->getValue());
+
+ SmallVector<const SCEV *, 4> 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(
if (!isa<StoreInst>(Inst) && buildScalarDependences(Inst, &R)) {
// If the Instruction is used outside the statement, we need to build the
// write access.
- SmallVector<const SCEV *, 4> 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));
}
}
More information about the llvm-commits
mailing list