[polly] r294669 - [BlockGenerator] Use MemoryAccess::getAccessValue to get load instruction
Tobias Grosser via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 9 15:54:23 PST 2017
Author: grosser
Date: Thu Feb 9 17:54:23 2017
New Revision: 294669
URL: http://llvm.org/viewvc/llvm-project?rev=294669&view=rev
Log:
[BlockGenerator] Use MemoryAccess::getAccessValue to get load instruction
When generating code in the BlockGenerator we copy all (interesting)
instructions and keep track of the new values in a basic block map. To obtain
the original llvm::Value that belongs to a load memory access, we use
getAccessValue() instead of getOriginalBaseAddr(). The former always references
the instruction we use to load values from. The latter, on the other hand,
is obtaine from the corresponding ScopArrayInfo and would not be unique in
case ScopArrayInfo objects at some point allow memory accesses with different
base addresses.
This change is an update on r294566, which only clarified that we need the
original memory access, but where we still remained dependent to have one
base pointer per scop.
This change removes unnecessary uses of MemoryAddress::getOriginalBaseAddr() in
preparation for https://reviews.llvm.org/D28518.
Modified:
polly/trunk/lib/CodeGen/BlockGenerators.cpp
Modified: polly/trunk/lib/CodeGen/BlockGenerators.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/BlockGenerators.cpp?rev=294669&r1=294668&r2=294669&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/BlockGenerators.cpp (original)
+++ polly/trunk/lib/CodeGen/BlockGenerators.cpp Thu Feb 9 17:54:23 2017
@@ -465,7 +465,7 @@ void BlockGenerator::generateScalarLoads
DT.dominates(cast<Instruction>(Address)->getParent(),
Builder.GetInsertBlock())) &&
"Domination violation");
- BBMap[MA->getOriginalBaseAddr()] =
+ BBMap[MA->getAccessValue()] =
Builder.CreateLoad(Address, Address->getName() + ".reload");
}
}
@@ -1043,7 +1043,7 @@ void VectorBlockGenerator::generateScala
Value *VectorVal = Builder.CreateShuffleVector(
Val, Val, SplatVector, Address->getName() + "_p_splat");
- VectorBlockMap[MA->getOriginalBaseAddr()] = VectorVal;
+ VectorBlockMap[MA->getAccessValue()] = VectorVal;
}
}
More information about the llvm-commits
mailing list