[llvm-bugs] [Bug 32902] New: Assertion failed: (V->getType()->isPointerTy() && "V must be pointer type")

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 3 01:29:01 PDT 2017


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

            Bug ID: 32902
           Summary: Assertion failed: (V->getType()->isPointerTy() && "V
                    must be pointer type")
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: vadimcn at gmail.com
                CC: llvm-bugs at lists.llvm.org

opt bugpoint-reduced-simplified.ll -sroa
results in assertion:
Assertion failed: (V->getType()->isPointerTy() && "V must be pointer type"),
function isKnownNonNull, file
/Users/vadimcn/llvm/lib/Analysis/ValueTracking.cpp, line 3419.

----
; ModuleID = 'bugpoint-reduced-simplified.bc'
source_filename = "bugpoint-output-46383f3.bc"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-darwin"

%blah.3.39.47.55.59.63.67.95.3.7.11.39 = type {
%blah2.2.38.46.54.58.62.66.94.2.6.10.38*, [0 x i8],
%str_slice.0.103.206.953.1202.1949.2696.3443.4190.4937.5186.5435.5518.5767.6182.6597.7012.8091.8257.8340.8672.8838.9585.9668.9751.9834.9917.10332.10581.10664.10913.10996.11079.11162.11891.11974.12390.1.37.45.53.57.61.65.93.1.5.9.37*,
[0 x i8] }
%blah2.2.38.46.54.58.62.66.94.2.6.10.38 = type {
%"option::Option<char>.91.194.286.1033.1282.2029.2776.3523.4270.5017.5266.5515.5598.5847.6262.6677.7092.8171.8337.8420.8752.8918.9665.9748.9831.9914.9997.10412.10661.10744.10993.11076.11159.11242.11971.12054.12389.0.36.44.52.56.60.64.92.0.4.8.36"*,
[0 x i8], i8*, [0 x i8],
%str_slice.0.103.206.953.1202.1949.2696.3443.4190.4937.5186.5435.5518.5767.6182.6597.7012.8091.8257.8340.8672.8838.9585.9668.9751.9834.9917.10332.10581.10664.10913.10996.11079.11162.11891.11974.12390.1.37.45.53.57.61.65.93.1.5.9.37*,
[0 x i8] }
%"option::Option<char>.91.194.286.1033.1282.2029.2776.3523.4270.5017.5266.5515.5598.5847.6262.6677.7092.8171.8337.8420.8752.8918.9665.9748.9831.9914.9997.10412.10661.10744.10993.11076.11159.11242.11971.12054.12389.0.36.44.52.56.60.64.92.0.4.8.36"
= type { i32, [0 x i32], [1 x i32] }
%str_slice.0.103.206.953.1202.1949.2696.3443.4190.4937.5186.5435.5518.5767.6182.6597.7012.8091.8257.8340.8672.8838.9585.9668.9751.9834.9917.10332.10581.10664.10913.10996.11079.11162.11891.11974.12390.1.37.45.53.57.61.65.93.1.5.9.37
= type { i8*, i64 }

declare i32 @rust_eh_personality(...) unnamed_addr

; Function Attrs: uwtable
define void @_ZN4core3fmt9Formatter12pad_integral17h1dcf0f409406b6e5E()
unnamed_addr #0 personality i32 (...)* @rust_eh_personality {
start:
  %arg4.i = alloca %blah.3.39.47.55.59.63.67.95.3.7.11.39, align 8
  %0 = bitcast %blah.3.39.47.55.59.63.67.95.3.7.11.39* %arg4.i to i64*
  store i64 0, i64* %0, align 8, !noalias !0
  %1 = getelementptr inbounds %blah.3.39.47.55.59.63.67.95.3.7.11.39,
%blah.3.39.47.55.59.63.67.95.3.7.11.39* %arg4.i, i64 0, i32 0
  %2 = load %blah2.2.38.46.54.58.62.66.94.2.6.10.38*,
%blah2.2.38.46.54.58.62.66.94.2.6.10.38** %1, align 8, !alias.scope !3,
!noalias !0, !nonnull !6
  unreachable
}

attributes #0 = { uwtable "no-frame-pointer-elim"="true" }

!0 = !{!1}
!1 = distinct !{!1, !2,
!"_ZN4core3fmt9Formatter12with_padding17he89c0cd65ede2490E: argument 0"}
!2 = distinct !{!2,
!"_ZN4core3fmt9Formatter12with_padding17he89c0cd65ede2490E"}
!3 = !{!4}
!4 = distinct !{!4, !5,
!"_ZN4core3fmt9Formatter12pad_integral28_$u7b$$u7b$closure$u7d$$u7d$17he6d80cba181124abE:
argument 0"}
!5 = distinct !{!5,
!"_ZN4core3fmt9Formatter12pad_integral28_$u7b$$u7b$closure$u7d$$u7d$17he6d80cba181124abE"}
!6 = !{}
---

I've dumped the function IR just before SROA pass runs mem2reg:

; Function Attrs: uwtable
define void @_ZN4core3fmt9Formatter12pad_integral17h1dcf0f409406b6e5E()
unnamed_addr #0 personality i32 (...)* @rust_eh_personality {
start:
  %arg4.i.sroa.0 = alloca i64
  store i64 0, i64* %arg4.i.sroa.0
  %arg4.i.sroa.0.0. = load i64, i64* %arg4.i.sroa.0, !nonnull !0
  %0 = inttoptr i64 %arg4.i.sroa.0.0. to
%blah2.2.38.46.54.58.62.66.94.2.6.10.38*
  unreachable
}

So yeah, the result of load is indeed not a pointer type, though it gets cast
to one in the next line.

-- 
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/20170503/8fa7968b/attachment.html>


More information about the llvm-bugs mailing list