<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 gives up on alloca used exclusively within extracted region"
   href="https://bugs.llvm.org/show_bug.cgi?id=39441">39441</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>CodeExtractor gives up on alloca used exclusively within extracted region
          </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>All
          </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>Transformation Utilities
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>vsk@apple.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>On Darwin, there is an extremely pervasive kind of cold code (error logging)
which CodeExtractor has trouble with:

```
if.then3:                                         ; preds = %if.then
  %3 = tail call i8* @llvm.stacksave(), !dbg !5744
  %vla13 = alloca [2 x i8], align 16, !dbg !5744
  %vla13.sub = getelementptr inbounds [2 x i8], [2 x i8]* %vla13, i64 0, i64 0
  store i8 0, i8* %vla13.sub, align 16, !dbg !5750
  %numArgs.i = getelementptr inbounds [2 x i8], [2 x i8]* %vla13, i64 0, i64 1,
!dbg !5750
  store i8 0, i8* %numArgs.i, align 1, !dbg !5750
  notail call void @_os_log_debug_impl(... %numArgs.i ...)
  call void @llvm.stackrestore(i8* %3), !dbg !5752
  br label %if.end, !dbg !5752
```

By default, extracting regions containing allocas is not enabled. In general
this seems difficult to do. But here, all uses of the alloca are within the
outlined region...

Can we do something simple to permit outlining in this scenario? Maybe check
that the transitive closure of the alloca's uses all live within the alloca's
block?</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>