diff options
| -rw-r--r-- | polly/lib/CodeGen/BlockGenerators.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp index 0f488e783f2..82082cbdbe1 100644 --- a/polly/lib/CodeGen/BlockGenerators.cpp +++ b/polly/lib/CodeGen/BlockGenerators.cpp @@ -374,6 +374,13 @@ AllocaInst *BlockGenerator::getOrCreateAlloca(Value *ScalarBase, void BlockGenerator::handleOutsideUsers(const Region &R, Instruction *Inst, Value *InstCopy) { + // If there are escape users we get the alloca for this instruction and put + // it in the EscapeMap for later finalization. However, if the alloca was not + // created by an already handled scalar dependence we have to initialize it + // also. Lastly, if the instruction was copied multiple times we already did + // this and can exit. + if (EscapeMap.count(Inst)) + return; EscapeUserVectorTy EscapeUsers; for (User *U : Inst->users()) { @@ -393,14 +400,6 @@ void BlockGenerator::handleOutsideUsers(const Region &R, Instruction *Inst, if (EscapeUsers.empty()) return; - // If there are escape users we get the alloca for this instruction and put - // it in the EscapeMap for later finalization. However, if the alloca was not - // created by an already handled scalar dependence we have to initialize it - // also. Lastly, if the instruction was copied multiple times we already did - // this and can exit. - if (EscapeMap.count(Inst)) - return; - // Get or create an escape alloca for this instruction. bool IsNew; AllocaInst *ScalarAddr = |

