[PATCH] D22699: Refactor - CodeExtractor : Move check for valid block to static utility and add assumption checks.

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 27 01:10:29 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL276846: Refactor - CodeExtractor : Move check for valid block to static utility (authored by silvas).

Changed prior to commit:
  https://reviews.llvm.org/D22699?vs=65371&id=65677#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D22699

Files:
  llvm/trunk/include/llvm/Transforms/Utils/CodeExtractor.h
  llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp

Index: llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp
+++ llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp
@@ -49,7 +49,7 @@
                  cl::desc("Aggregate arguments to code-extracted functions"));
 
 /// \brief Test whether a block is valid for extraction.
-static bool isBlockValidForExtraction(const BasicBlock &BB) {
+bool CodeExtractor::isBlockValidForExtraction(const BasicBlock &BB) {
   // Landing pads must be in the function where they were inserted for cleanup.
   if (BB.isEHPad())
     return false;
@@ -81,7 +81,7 @@
     if (!Result.insert(*BBBegin))
       llvm_unreachable("Repeated basic blocks in extraction input");
 
-    if (!isBlockValidForExtraction(**BBBegin)) {
+    if (!CodeExtractor::isBlockValidForExtraction(**BBBegin)) {
       Result.clear();
       return Result;
     }
Index: llvm/trunk/include/llvm/Transforms/Utils/CodeExtractor.h
===================================================================
--- llvm/trunk/include/llvm/Transforms/Utils/CodeExtractor.h
+++ llvm/trunk/include/llvm/Transforms/Utils/CodeExtractor.h
@@ -54,6 +54,12 @@
     Type *RetTy;
 
   public:
+
+    /// \brief Check to see if a block is valid for extraction.
+    ///
+    /// Blocks containing EHPads, allocas, invokes, or vastarts are not valid.
+    static bool isBlockValidForExtraction(const BasicBlock &BB);
+
     /// \brief Create a code extractor for a single basic block.
     ///
     /// In this formation, we don't require a dominator tree. The given basic


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22699.65677.patch
Type: text/x-patch
Size: 1620 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160727/4dc22004/attachment.bin>


More information about the llvm-commits mailing list