<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 vectorizer introduces ptrtoint on non-integral address space"
   href="https://bugs.llvm.org/show_bug.cgi?id=38290">38290</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Loop vectorizer introduces ptrtoint on non-integral address space
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>6.0
          </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>Running `opt -loop-vectorize` on the below bugpoint-reduced test case fails
verification due to the introduction of ptrtoint in the SCEV assumption check
BB.

```
$ opt bug.ll -loop-vectorize
ptrtoint not supported for non-integral pointers
ptrtoint not supported for non-integral pointers
LLVM ERROR: Broken function found, compilation aborted!
```

```
$ cat bug.ll
source_filename = "bugpoint-output-878a985.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 }

declare i64 @julia_steprange_last_4949()

define void @"japi1_align!_9477"(%jl_value_t addrspace(10)**) #0 {
top:
  %1 = load %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %0, align
8, !nonnull !1, !dereferenceable !2, !align !3
  %2 = load i32, i32* inttoptr (i64 12 to i32*), align 4, !tbaa !4
  %3 = sub i32 0, %2
  %4 = call i64 @julia_steprange_last_4949()
  %5 = addrspacecast %jl_value_t addrspace(10)* %1 to %jl_value_t
addrspace(11)*
  %6 = bitcast %jl_value_t addrspace(11)* %5 to %jl_value_t addrspace(10)*
addrspace(11)*
  %7 = load %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)*
addrspace(11)* %6, align 8, !tbaa !4, !nonnull !1, !dereferenceable !9, !align
!2
  %8 = addrspacecast %jl_value_t addrspace(10)* %7 to %jl_value_t
addrspace(11)*
  %9 = bitcast %jl_value_t addrspace(11)* %8 to i32 addrspace(13)*
addrspace(11)*
  %10 = load i32 addrspace(13)*, i32 addrspace(13)* addrspace(11)* %9, align 8,
!tbaa !10, !nonnull !1
  %11 = sext i32 %3 to i64
  br label %L26

L26:                                              ; preds = %L26, %top
  %value_phi3 = phi i64 [ 0, %top ], [ %12, %L26 ]
  %12 = add i64 %value_phi3, -1
  %13 = getelementptr inbounds i32, i32 addrspace(13)* %10, i64 %12
  %14 = load i32, i32 addrspace(13)* %13, align 4, !tbaa !13
  %15 = add i64 %12, %11
  %16 = getelementptr inbounds i32, i32 addrspace(13)* %10, i64 %15
  store i32 %14, i32 addrspace(13)* %16, align 4, !tbaa !13
  %17 = icmp eq i64 %value_phi3, %4
  br i1 %17, label %L45, label %L26

L45:                                              ; preds = %L26
  ret void
}

attributes #0 = { "thunk" }

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

!0 = !{i32 1, !"Debug Info Version", i32 3}
!1 = !{}
!2 = !{i64 16}
!3 = !{i64 8}
!4 = !{!5, !5, i64 0}
!5 = !{!"jtbaa_mutab", !6, i64 0}
!6 = !{!"jtbaa_value", !7, i64 0}
!7 = !{!"jtbaa_data", !8, i64 0}
!8 = !{!"jtbaa"}
!9 = !{i64 40}
!10 = !{!11, !11, i64 0}
!11 = !{!"jtbaa_arrayptr", !12, i64 0}
!12 = !{!"jtbaa_array", !8, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"jtbaa_arraybuf", !7, 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>