[llvm-bugs] [Bug 39441] New: CodeExtractor gives up on alloca used exclusively within extracted region

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Oct 25 15:47:14 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=39441

            Bug ID: 39441
           Summary: CodeExtractor gives up on alloca used exclusively
                    within extracted region
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Transformation Utilities
          Assignee: unassignedbugs at nondot.org
          Reporter: vsk at apple.com
                CC: llvm-bugs at lists.llvm.org

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?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181025/404b5a58/attachment.html>


More information about the llvm-bugs mailing list