[llvm-bugs] [Bug 38414] New: Loop versioning introduces illegal inttoptr

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 1 18:08:46 PDT 2018


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

            Bug ID: 38414
           Summary: Loop versioning introduces illegal inttoptr
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedbugs at nondot.org
          Reporter: keno at alumni.harvard.edu
                CC: llvm-bugs at lists.llvm.org

Consider the following bugpoint-reduced testcase of
https://github.com/JuliaLang/julia/issues/28388. 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}
```

-- 
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/20180802/7a8f852b/attachment.html>


More information about the llvm-bugs mailing list