From 23d697c51730006b86fba208803ebc691548a585 Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Wed, 26 Jul 2017 22:01:28 +0000 Subject: [PATCH] [Simplify] Do not setInstructions() of region stmts. NFC. The instruction list is ignored for region statements, there is no reason to set it. git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@309196 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/polly/ScopInfo.h | 2 ++ lib/Transform/Simplify.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/include/polly/ScopInfo.h b/include/polly/ScopInfo.h index e016a2ba..b8fa7dc3 100644 --- a/include/polly/ScopInfo.h +++ b/include/polly/ScopInfo.h @@ -1566,6 +1566,8 @@ public: /// Set the list of instructions for this statement. It replaces the current /// list. void setInstructions(ArrayRef Range) { + assert(isBlockStmt() && + "The instruction list only matters for block-statements"); Instructions.assign(Range.begin(), Range.end()); } diff --git a/lib/Transform/Simplify.cpp b/lib/Transform/Simplify.cpp index 4f1f0168..6f9a334e 100644 --- a/lib/Transform/Simplify.cpp +++ b/lib/Transform/Simplify.cpp @@ -380,6 +380,9 @@ private: // Remove all non-reachable instructions. for (ScopStmt &Stmt : *S) { + if (!Stmt.isBlockStmt()) + continue; + SmallVector AllInsts(Stmt.insts_begin(), Stmt.insts_end()); SmallVector RemainInsts; -- 2.11.4.GIT