[polly] r294566 - [BlockGenerator] BBMap uses original BaseAddress for scalar loads [NFC]
Tobias Grosser via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 9 00:05:50 PST 2017
Author: grosser
Date: Thu Feb 9 02:05:50 2017
New Revision: 294566
URL: http://llvm.org/viewvc/llvm-project?rev=294566&view=rev
Log:
[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.
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=294566&r1=294565&r2=294566&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/BlockGenerators.cpp (original)
+++ polly/trunk/lib/CodeGen/BlockGenerators.cpp Thu Feb 9 02:05:50 2017
@@ -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::generateScala
Value *VectorVal = Builder.CreateShuffleVector(
Val, Val, SplatVector, Address->getName() + "_p_splat");
- VectorBlockMap[MA->getBaseAddr()] = VectorVal;
+ VectorBlockMap[MA->getOriginalBaseAddr()] = VectorVal;
}
}
More information about the llvm-commits
mailing list