[PATCH] D33653: [Polly] Iterate over explicit instruction list in CodeGen for block statements. NFC

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 1 17:14:24 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL304502: [CodeGen] Iterate over explicit instruction list for block statements. NFC (authored by Meinersbur).

Changed prior to commit:
  https://reviews.llvm.org/D33653?vs=100710&id=101141#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D33653

Files:
  polly/trunk/include/polly/ScopInfo.h
  polly/trunk/lib/CodeGen/BlockGenerators.cpp


Index: polly/trunk/include/polly/ScopInfo.h
===================================================================
--- polly/trunk/include/polly/ScopInfo.h
+++ polly/trunk/include/polly/ScopInfo.h
@@ -1502,6 +1502,10 @@
   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.
Index: polly/trunk/lib/CodeGen/BlockGenerators.cpp
===================================================================
--- polly/trunk/lib/CodeGen/BlockGenerators.cpp
+++ polly/trunk/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) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33653.101141.patch
Type: text/x-patch
Size: 1248 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170602/d18a1d49/attachment.bin>


More information about the llvm-commits mailing list