<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - CodeExtractor: converting to users fails lit tests"
   href="https://bugs.llvm.org/show_bug.cgi?id=43663">43663</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>CodeExtractor: converting to users fails lit tests
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Scalar Optimizations
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>hiraditya@msn.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following patch results in test failures.

diff --git a/llvm/lib/Transforms/Utils/CodeExtractor.cpp
b/llvm/lib/Transforms/Utils/CodeExtractor.cpp
index 3e1bea77f6c..c4661fde0fb 100644
--- a/llvm/lib/Transforms/Utils/CodeExtractor.cpp
+++ b/llvm/lib/Transforms/Utils/CodeExtractor.cpp
@@ -929,8 +929,7 @@ Function *CodeExtractor::constructFunction(const ValueSet
&inputs,
   // Rewrite branches to basic blocks outside of the loop to new dummy blocks
   // within the new function. This must be done before we lose track of which
   // blocks were originally in the code region.
-  std::vector<User *> Users(header->user_begin(), header->user_end());
-  for (auto &U : Users)
+  for (auto U : header->users())
     // The BasicBlock which contains the branch is not in the region
     // modify the branch target to a new block
     if (Instruction *I = dyn_cast<Instruction>(U))

Failing Tests (6):

LLVM :: Transforms/CodeExtractor/PartialInlineAndOr.ll
LLVM :: Transforms/CodeExtractor/PartialInlineOr.ll
LLVM :: Transforms/CodeExtractor/PartialInlineOrAnd.ll    // Crashed: Assertion
`(Flags & RF_IgnoreMissingLocals) && "Referenced value not in value map!"'
failed.
LLVM :: Transforms/HotColdSplit/eh-pads.ll
LLVM :: Transforms/HotColdSplit/outline-multiple-entry-region.ll
LLVM :: Transforms/HotColdSplit/unwind.ll</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>