summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/PPCGCodeGeneration.cpp
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2017-01-28 07:42:10 +0000
committerTobias Grosser <tobias@grosser.es>2017-01-28 07:42:10 +0000
commit587f1f57ad72b002d9f2ab3111ddfa91a5f25184 (patch)
treed1f9f80a7f424be010448a6929c0f34101370452 /polly/lib/CodeGen/PPCGCodeGeneration.cpp
parentcfd0b6f34fcd9cccc666c73936cc44976bea37ee (diff)
downloadbcm5719-llvm-587f1f57ad72b002d9f2ab3111ddfa91a5f25184.tar.gz
bcm5719-llvm-587f1f57ad72b002d9f2ab3111ddfa91a5f25184.zip
[Polly] [BlockGenerator] Unify ScalarMap and PhiOpsMap
Instead of keeping two separate maps from Value to Allocas, one for MemoryType::Value and the other for MemoryType::PHI, we introduce a single map from ScopArrayInfo to the corresponding Alloca. This change is intended, both as a general simplification and cleanup, but also to reduce our use of MemoryAccess::getBaseAddr(). Moving away from using getBaseAddr() makes sure we have only a single place where the array (and its base pointer) for which we generate code for is specified, which means we can more easily introduce new access functions that use a different ScopArrayInfo as base. We already today experiment with modifiable access functions, so this change does not address a specific bug, but it just reduces the scope one needs to reason about. Another motivation for this patch is https://reviews.llvm.org/D28518, where memory accesses with different base pointers could possibly be mapped to a single ScopArrayInfo object. Such a mapping is currently not possible, as we currently generate alloca instructions according to the base addresses of the memory accesses, not according to the ScopArrayInfo object they belong to. By making allocas ScopArrayInfo specific, a mapping to a single ScopArrayInfo object will automatically mean that the same stack slot is used for these arrays. For D28518 this is not a problem, as only MemoryType::Array objects are mapping, but resolving this inconsistency will hopefully avoid confusion. llvm-svn: 293374
Diffstat (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp')
-rw-r--r--polly/lib/CodeGen/PPCGCodeGeneration.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
index 456382c2be6..462b825dfb3 100644
--- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp
+++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
@@ -1206,10 +1206,8 @@ void GPUNodeBuilder::createKernel(__isl_take isl_ast_node *KernelStmt) {
Instruction &HostInsertPoint = *Builder.GetInsertPoint();
IslExprBuilder::IDToValueTy HostIDs = IDToValue;
ValueMapT HostValueMap = ValueMap;
- BlockGenerator::ScalarAllocaMapTy HostScalarMap = ScalarMap;
- BlockGenerator::ScalarAllocaMapTy HostPHIOpMap = PHIOpMap;
+ BlockGenerator::AllocaMapTy HostScalarMap = ScalarMap;
ScalarMap.clear();
- PHIOpMap.clear();
SetVector<const Loop *> Loops;
@@ -1240,7 +1238,6 @@ void GPUNodeBuilder::createKernel(__isl_take isl_ast_node *KernelStmt) {
ValueMap = std::move(HostValueMap);
ScalarMap = std::move(HostScalarMap);
- PHIOpMap = std::move(HostPHIOpMap);
EscapeMap.clear();
IDToSAI.clear();
Annotator.resetAlternativeAliasBases();
OpenPOWER on IntegriCloud