Index: include/polly/ScopInfo.h =================================================================== --- include/polly/ScopInfo.h +++ include/polly/ScopInfo.h @@ -1502,6 +1502,10 @@ Scop *getParent() { return &Parent; } const Scop *getParent() const { return &Parent; } + const std::vector &getInstructions() const { + return Instructions; + } + const char *getBaseName() const; /// Set the isl AST build. Index: lib/CodeGen/BlockGenerators.cpp =================================================================== --- lib/CodeGen/BlockGenerators.cpp +++ lib/CodeGen/BlockGenerators.cpp @@ -441,8 +441,12 @@ 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) {