[polly] r299914 - Exploit BasicBlock::getModule to shorten code
Tobias Grosser via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 10 21:59:13 PDT 2017
Author: grosser
Date: Mon Apr 10 23:59:13 2017
New Revision: 299914
URL: http://llvm.org/viewvc/llvm-project?rev=299914&view=rev
Log:
Exploit BasicBlock::getModule to shorten code
Suggested-by: Roman Gareev <gareevroman at gmail.com>
Modified:
polly/trunk/lib/Analysis/ScopDetection.cpp
polly/trunk/lib/CodeGen/BlockGenerators.cpp
polly/trunk/lib/CodeGen/LoopGenerators.cpp
polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp
polly/trunk/lib/Transform/DeLICM.cpp
Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=299914&r1=299913&r2=299914&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Mon Apr 10 23:59:13 2017
@@ -344,8 +344,7 @@ bool ScopDetection::addOverApproximatedR
bool ScopDetection::onlyValidRequiredInvariantLoads(
InvariantLoadsSetTy &RequiredILS, DetectionContext &Context) const {
Region &CurRegion = Context.CurRegion;
- const DataLayout &DL =
- CurRegion.getEntry()->getParent()->getParent()->getDataLayout();
+ const DataLayout &DL = CurRegion.getEntry()->getModule()->getDataLayout();
if (!PollyInvariantLoadHoisting && !RequiredILS.empty())
return false;
Modified: polly/trunk/lib/CodeGen/BlockGenerators.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/BlockGenerators.cpp?rev=299914&r1=299913&r2=299914&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/BlockGenerators.cpp (original)
+++ polly/trunk/lib/CodeGen/BlockGenerators.cpp Mon Apr 10 23:59:13 2017
@@ -408,8 +408,7 @@ Value *BlockGenerator::getOrCreateAlloca
else
NameExt = ".s2a";
- const DataLayout &DL =
- Builder.GetInsertBlock()->getParent()->getParent()->getDataLayout();
+ const DataLayout &DL = Builder.GetInsertBlock()->getModule()->getDataLayout();
Addr = new AllocaInst(Ty, DL.getAllocaAddrSpace(),
ScalarBase->getName() + NameExt);
Modified: polly/trunk/lib/CodeGen/LoopGenerators.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/LoopGenerators.cpp?rev=299914&r1=299913&r2=299914&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/LoopGenerators.cpp (original)
+++ polly/trunk/lib/CodeGen/LoopGenerators.cpp Mon Apr 10 23:59:13 2017
@@ -281,8 +281,7 @@ ParallelLoopGenerator::storeValuesIntoSt
for (Value *V : Values)
Members.push_back(V->getType());
- const DataLayout &DL =
- Builder.GetInsertBlock()->getParent()->getParent()->getDataLayout();
+ const DataLayout &DL = Builder.GetInsertBlock()->getModule()->getDataLayout();
// We do not want to allocate the alloca inside any loop, thus we allocate it
// in the entry block of the function and use annotations to denote the actual
Modified: polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp?rev=299914&r1=299913&r2=299914&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp (original)
+++ polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp Mon Apr 10 23:59:13 2017
@@ -2447,7 +2447,7 @@ public:
LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
SE = &getAnalysis<ScalarEvolutionWrapperPass>().getSE();
- DL = &S->getRegion().getEntry()->getParent()->getParent()->getDataLayout();
+ DL = &S->getRegion().getEntry()->getModule()->getDataLayout();
RI = &getAnalysis<RegionInfoPass>().getRegionInfo();
// We currently do not support scops with invariant loads.
Modified: polly/trunk/lib/Transform/DeLICM.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Transform/DeLICM.cpp?rev=299914&r1=299913&r2=299914&view=diff
==============================================================================
--- polly/trunk/lib/Transform/DeLICM.cpp (original)
+++ polly/trunk/lib/Transform/DeLICM.cpp Mon Apr 10 23:59:13 2017
@@ -1465,8 +1465,7 @@ private:
ProcessAllIncoming(TargetStmt);
auto AnyMapped = false;
- auto &DL =
- S->getRegion().getEntry()->getParent()->getParent()->getDataLayout();
+ auto &DL = S->getRegion().getEntry()->getModule()->getDataLayout();
auto StoreSize =
DL.getTypeAllocSize(TargetStoreMA->getAccessValue()->getType());
More information about the llvm-commits
mailing list