summaryrefslogtreecommitdiff
path: root/polly/lib/CodeGen/BlockGenerators.cpp
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2017-02-09 08:05:50 +0000
committerTobias Grosser <tobias@grosser.es>2017-02-09 08:05:50 +0000
commit02400a0e0c5b60ea588fa76ac921e68a8b22c087 (patch)
tree5f22f28e1667210c953e56350dc6df6cfbc6e5cf /polly/lib/CodeGen/BlockGenerators.cpp
parented43f156377ac74216237290335f15576ca0c647 (diff)
[BlockGenerator] BBMap uses original BaseAddress for scalar loads [NFC]
When regenerating code in the BlockGenerator we copy instructions that may references scalar values, for which the new value of a given scalar is looked up in BBMap using the original scalar llvm::Value as index. It is consequently necessary that (re)loaded scalar values are made available in BBMap using the original llvm::Value as key independently if the llvm::Value was (re)loaded from the original scalar or a new access function has been specified that caused the value to be reloaded from an array with a differnet base address. We make this clear by using MemoryAccess::getOriginalBaseAddr() instead of MemoryAccess::getBaseAddr() as index to BBMap. This change removes unnecessary uses of MemoryAddress::getBaseAddr() in preparation for https://reviews.llvm.org/D28518. llvm-svn: 294566
Diffstat (limited to 'polly/lib/CodeGen/BlockGenerators.cpp')
-rw-r--r--polly/lib/CodeGen/BlockGenerators.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp
index 7109d6a06509..c3263396c989 100644
--- a/polly/lib/CodeGen/BlockGenerators.cpp
+++ b/polly/lib/CodeGen/BlockGenerators.cpp
@@ -465,7 +465,7 @@ void BlockGenerator::generateScalarLoads(
DT.dominates(cast<Instruction>(Address)->getParent(),
Builder.GetInsertBlock())) &&
"Domination violation");
- BBMap[MA->getBaseAddr()] =
+ BBMap[MA->getOriginalBaseAddr()] =
Builder.CreateLoad(Address, Address->getName() + ".reload");
}
}
@@ -1043,7 +1043,7 @@ void VectorBlockGenerator::generateScalarVectorLoads(
Value *VectorVal = Builder.CreateShuffleVector(
Val, Val, SplatVector, Address->getName() + "_p_splat");
- VectorBlockMap[MA->getBaseAddr()] = VectorVal;
+ VectorBlockMap[MA->getOriginalBaseAddr()] = VectorVal;
}
}