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: unassignedb...@nondot.org
          Reporter: yyc1...@gmail.com
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to