[polly] r309196 - [Simplify] Do not setInstructions() of region stmts. NFC.

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 26 15:01:28 PDT 2017


Author: meinersbur
Date: Wed Jul 26 15:01:28 2017
New Revision: 309196

URL: http://llvm.org/viewvc/llvm-project?rev=309196&view=rev
Log:
[Simplify] Do not setInstructions() of region stmts. NFC.

The instruction list is ignored for region statements, there
is no reason to set it.

Modified:
    polly/trunk/include/polly/ScopInfo.h
    polly/trunk/lib/Transform/Simplify.cpp

Modified: polly/trunk/include/polly/ScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=309196&r1=309195&r2=309196&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Wed Jul 26 15:01:28 2017
@@ -1566,6 +1566,8 @@ public:
   /// Set the list of instructions for this statement. It replaces the current
   /// list.
   void setInstructions(ArrayRef<Instruction *> Range) {
+    assert(isBlockStmt() &&
+           "The instruction list only matters for block-statements");
     Instructions.assign(Range.begin(), Range.end());
   }
 

Modified: polly/trunk/lib/Transform/Simplify.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Transform/Simplify.cpp?rev=309196&r1=309195&r2=309196&view=diff
==============================================================================
--- polly/trunk/lib/Transform/Simplify.cpp (original)
+++ polly/trunk/lib/Transform/Simplify.cpp Wed Jul 26 15:01:28 2017
@@ -380,6 +380,9 @@ private:
 
     // Remove all non-reachable instructions.
     for (ScopStmt &Stmt : *S) {
+      if (!Stmt.isBlockStmt())
+        continue;
+
       SmallVector<Instruction *, 32> AllInsts(Stmt.insts_begin(),
                                               Stmt.insts_end());
       SmallVector<Instruction *, 32> RemainInsts;




More information about the llvm-commits mailing list