<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 - Loop versioning introduces illegal inttoptr"
href="https://bugs.llvm.org/show_bug.cgi?id=38414">38414</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Loop versioning introduces illegal inttoptr
</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>Loop Optimizer
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>keno@alumni.harvard.edu
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Consider the following bugpoint-reduced testcase of
<a href="https://github.com/JuliaLang/julia/issues/28388">https://github.com/JuliaLang/julia/issues/28388</a>. Running `opt
-mcpu=skylake-avx512 -loop-vectorize bug.ll` results in the introduction of an
illegal ptrtoint.
```
; ModuleID = 'bugpoint-reduced-simplified.bc'
source_filename = "bugpoint-output-db8c91b.bc"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:10:11:12:13"
target triple = "x86_64-unknown-linux-gnu"
%jl_value_t = type opaque
%jl_array_t = type { i8 addrspace(13)*, i64, i16, i16, i32 }
; Function Attrs: sspstrong
define void @"japi1_permutedims!_33509"(%jl_value_t addrspace(10)**) #0 {
top:
%1 = alloca [3 x i64], align 8
%2 = load %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %0, align
8, !nonnull !1, !dereferenceable !2, !align !3
%3 = getelementptr inbounds %jl_value_t addrspace(10)*, %jl_value_t
addrspace(10)** %0, i64 1
%4 = load %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %3, align
8, !nonnull !1, !dereferenceable !2, !align !3
%5 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 0
store i64 1, i64* %5, align 8, !tbaa !4
%6 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 undef
%7 = load i64, i64* inttoptr (i64 24 to i64*), align 8, !tbaa !7,
!invariant.load !1
%8 = addrspacecast %jl_value_t addrspace(10)* %4 to %jl_value_t
addrspace(11)*
%9 = bitcast %jl_value_t addrspace(11)* %8 to double addrspace(13)*
addrspace(11)*
%10 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %9,
align 8, !tbaa !7, !invariant.load !1, !nonnull !1
%11 = addrspacecast %jl_value_t addrspace(10)* %2 to %jl_value_t
addrspace(11)*
%12 = bitcast %jl_value_t addrspace(11)* %11 to double addrspace(13)*
addrspace(11)*
%13 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %12,
align 8, !tbaa !7, !invariant.load !1, !nonnull !1
%14 = load i64, i64* %6, align 8, !tbaa !4
br label %L54
L54: ; preds = %L94, %top
br label %L74
L74: ; preds = %L74, %L54
%value_phi20 = phi i64 [ undef, %L54 ], [ %22, %L74 ]
%value_phi21 = phi i64 [ undef, %L54 ], [ %23, %L74 ]
%value_phi22 = phi i64 [ 1, %L54 ], [ %25, %L74 ]
%15 = add i64 %value_phi21, -1
%16 = getelementptr inbounds double, double addrspace(13)* %10, i64 %15
%17 = bitcast double addrspace(13)* %16 to i64 addrspace(13)*
%18 = load i64, i64 addrspace(13)* %17, align 8, !tbaa !9
%19 = add i64 %value_phi20, -1
%20 = getelementptr inbounds double, double addrspace(13)* %13, i64 %19
%21 = bitcast double addrspace(13)* %20 to i64 addrspace(13)*
store i64 %18, i64 addrspace(13)* %21, align 8, !tbaa !9
%22 = add i64 %value_phi20, 1
%23 = add i64 %14, %value_phi21
%24 = icmp eq i64 %value_phi22, %7
%25 = add i64 %value_phi22, 1
br i1 %24, label %L94, label %L74
L94: ; preds = %L74
br label %L54
}
attributes #0 = { sspstrong "target-cpu"="skylake-avx512" "thunk" }
!llvm.module.flags = !{!0}
!0 = !{i32 1, !"Debug Info Version", i32 3}
!1 = !{}
!2 = !{i64 40}
!3 = !{i64 16}
!4 = !{!5, !5, i64 0}
!5 = !{!"jtbaa_stack", !6, i64 0}
!6 = !{!"jtbaa"}
!7 = !{!8, !8, i64 0, i64 1}
!8 = !{!"jtbaa_const", !6, i64 0}
!9 = !{!10, !10, i64 0}
!10 = !{!"jtbaa_arraybuf", !11, i64 0}
!11 = !{!"jtbaa_data", !6, i64 0}
```</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>