[llvm-bugs] [Bug 46737] New: Inlining introduces illegal ptrtoint

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 15 10:26:16 PDT 2020


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

            Bug ID: 46737
           Summary: Inlining introduces illegal ptrtoint
           Product: libraries
           Version: 10.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Transformation Utilities
          Assignee: unassignedbugs at nondot.org
          Reporter: yyc1992 at gmail.com
                CC: llvm-bugs at lists.llvm.org

Bugpoint reduced IR:

```
; ModuleID = 'bugpoint-reduced-simplified.bc'
source_filename = "text"
target datalayout =
"e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64-ni:10:11:12:13"
target triple = "armv7l-unknown-linux-gnueabihf"

define void @julia_show_tuple_as_call_23179() local_unnamed_addr {
top:
  br i1 undef, label %L16.lr.ph, label %L51

L16.lr.ph:                                        ; preds = %top
  unreachable

L51:                                              ; preds = %top
  %0 = addrspacecast [2 x {} addrspace(10)*]* undef to [2 x {} addrspace(10)*]
addrspace(11)*
  call fastcc void @julia_show_signature_function_32381([2 x {} addrspace(10)*]
addrspace(11)* nocapture readonly %0)
  ret void
}

define dso_local fastcc void @julia_show_signature_function_32381([2 x {}
addrspace(10)*] addrspace(11)* nocapture nonnull readonly align 4
dereferenceable(8) %0) unnamed_addr {
top:
  %1 = bitcast [2 x {} addrspace(10)*] addrspace(11)* %0 to i64 addrspace(11)*
  ret void
}

!llvm.module.flags = !{!0}

!0 = !{i32 1, !"Debug Info Version", i32 3}
```

reproducible with `opt bugpoint-reduced-simplified.ll -inline`.

Inlining produces

```
define void @julia_show_tuple_as_call_23179() local_unnamed_addr {
top:
  br i1 undef, label %L16.lr.ph, label %L51

L16.lr.ph:                                        ; preds = %top
  unreachable

L51:                                              ; preds = %top
  %0 = addrspacecast [2 x {} addrspace(10)*]* undef to [2 x {} addrspace(10)*]
addrspace(11)*
  %ptrint = ptrtoint [2 x {} addrspace(10)*] addrspace(11)* %0 to i32
  %maskedptr = and i32 %ptrint, 3
  %maskcond = icmp eq i32 %maskedptr, 0
  call void @llvm.assume(i1 %maskcond)
  %1 = bitcast [2 x {} addrspace(10)*] addrspace(11)* %0 to i64 addrspace(11)*
  ret void
}
```

-- 
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/20200715/1ca6e298/attachment.html>


More information about the llvm-bugs mailing list