diff options
| -rw-r--r-- | polly/include/polly/ScopInfo.h | 4 | ||||
| -rw-r--r-- | polly/lib/CodeGen/BlockGenerators.cpp | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h index a42181be5b9..3b40fa0b748 100644 --- a/polly/include/polly/ScopInfo.h +++ b/polly/include/polly/ScopInfo.h @@ -1502,6 +1502,10 @@ public: Scop *getParent() { return &Parent; } const Scop *getParent() const { return &Parent; } + const std::vector<Instruction *> &getInstructions() const { + return Instructions; + } + const char *getBaseName() const; /// Set the isl AST build. diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp index f2c21c4e7d6..8ad17575b77 100644 --- a/polly/lib/CodeGen/BlockGenerators.cpp +++ b/polly/lib/CodeGen/BlockGenerators.cpp @@ -441,8 +441,12 @@ void BlockGenerator::copyBB(ScopStmt &Stmt, BasicBlock *BB, BasicBlock *CopyBB, isl_id_to_ast_expr *NewAccesses) { EntryBB = &CopyBB->getParent()->getEntryBlock(); - for (Instruction &Inst : *BB) - copyInstruction(Stmt, &Inst, BBMap, LTS, NewAccesses); + if (Stmt.isBlockStmt()) + for (Instruction *Inst : Stmt.getInstructions()) + copyInstruction(Stmt, Inst, BBMap, LTS, NewAccesses); + else + for (Instruction &Inst : *BB) + copyInstruction(Stmt, &Inst, BBMap, LTS, NewAccesses); } Value *BlockGenerator::getOrCreateAlloca(const MemoryAccess &Access) { |

