summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--polly/include/polly/CodeGen/BlockGenerators.h6
-rw-r--r--polly/lib/CodeGen/BlockGenerators.cpp12
2 files changed, 9 insertions, 9 deletions
diff --git a/polly/include/polly/CodeGen/BlockGenerators.h b/polly/include/polly/CodeGen/BlockGenerators.h
index 7ec5060d238..ee961e731d8 100644
--- a/polly/include/polly/CodeGen/BlockGenerators.h
+++ b/polly/include/polly/CodeGen/BlockGenerators.h
@@ -68,7 +68,7 @@ public:
///@{
/// @see The ScalarMap and PHIOpMap member.
- using ScalarAllocaMapTy = DenseMap<Value *, AllocaInst *>;
+ using ScalarAllocaMapTy = DenseMap<Value *, Value *>;
/// @brief Simple vector of instructions to store escape users.
using EscapeUserVectorTy = SmallVector<Instruction *, 4>;
@@ -77,7 +77,7 @@ public:
///
/// @see The EscapeMap member.
using EscapeUsersAllocaMapTy =
- DenseMap<Instruction *, std::pair<AllocaInst *, EscapeUserVectorTy>>;
+ DenseMap<Instruction *, std::pair<Value *, EscapeUserVectorTy>>;
///@}
@@ -388,7 +388,7 @@ protected:
/// SCoP.
/// @param Address If given it is used as the escape address for @p Inst.
void handleOutsideUsers(const Region &R, Instruction *Inst, Value *InstCopy,
- AllocaInst *Address = nullptr);
+ Value *Address = nullptr);
/// @brief Initialize the memory of demoted scalars.
///
diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp
index d7788c11ea7..b0212cd1254 100644
--- a/polly/lib/CodeGen/BlockGenerators.cpp
+++ b/polly/lib/CodeGen/BlockGenerators.cpp
@@ -333,14 +333,15 @@ Value *BlockGenerator::getOrCreateAlloca(Value *ScalarBase,
ScalarAllocaMapTy &Map,
const char *NameExt) {
// Check if an alloca was cached for the base instruction.
- AllocaInst *&Addr = Map[ScalarBase];
+ Value *&Addr = Map[ScalarBase];
// If no alloca was found create one and insert it in the entry block.
if (!Addr) {
auto *Ty = ScalarBase->getType();
- Addr = new AllocaInst(Ty, ScalarBase->getName() + NameExt);
+ auto NewAddr = new AllocaInst(Ty, ScalarBase->getName() + NameExt);
EntryBB = &Builder.GetInsertBlock()->getParent()->getEntryBlock();
- Addr->insertBefore(EntryBB->getFirstInsertionPt());
+ NewAddr->insertBefore(EntryBB->getFirstInsertionPt());
+ Addr = NewAddr;
}
if (GlobalMap.count(Addr))
@@ -365,7 +366,7 @@ Value *BlockGenerator::getOrCreatePHIAlloca(Value *ScalarBase) {
}
void BlockGenerator::handleOutsideUsers(const Region &R, Instruction *Inst,
- Value *InstCopy, AllocaInst *Address) {
+ Value *InstCopy, Value *Address) {
// If there are escape users we get the alloca for this instruction and put it
// in the EscapeMap for later finalization. Lastly, if the instruction was
// copied multiple times we already did this and can exit.
@@ -391,8 +392,7 @@ void BlockGenerator::handleOutsideUsers(const Region &R, Instruction *Inst,
return;
// Get or create an escape alloca for this instruction.
- auto *ScalarAddr =
- Address ? Address : cast<AllocaInst>(getOrCreateScalarAlloca(Inst));
+ auto *ScalarAddr = Address ? Address : getOrCreateScalarAlloca(Inst);
// Remember that this instruction has escape uses and the escape alloca.
EscapeMap[Inst] = std::make_pair(ScalarAddr, std::move(EscapeUsers));
OpenPOWER on IntegriCloud