[llvm-bugs] [Bug 27973] New: [x86] assertion failure for SSE target

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 1 15:01:49 PDT 2016


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

            Bug ID: 27973
           Summary: [x86] assertion failure for SSE target
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: spatel+llvm at rotateright.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

$ ./llc bad_sse.ll -o -
    .section    __TEXT,__text,regular,pure_instructions
    .macosx_version_min 10, 11
Assertion failed: (Subtarget.hasSSE2() && "Requires at least SSE2!"), function
ReplaceNodeResults, file llvm/lib/Target/X86/X86ISelLowering.cpp, line 21523.
Stack dump:
0.    Program arguments: ./llc bad_sse.ll -o -
1.    Running pass 'Function Pass Manager' on module 'bad_sse.ll'.
2.    Running pass 'X86 DAG->DAG Instruction Selection' on function '@fn1'

$ cat bad_sse.ll
target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128"
target triple = "i386-apple-macosx10.11.0"

@b = common global i32 0, align 4
@a = common global i32 0, align 4

; Function Attrs: norecurse nounwind ssp
define void @fn1() #0 {
entry:
  %0 = load i32, i32* @b, align 4, !tbaa !2
  %1 = load i32, i32* @a, align 4, !tbaa !2
  %cmp23 = icmp sgt i32 %1, 0
  br i1 %cmp23, label %for.cond1.preheader.preheader, label %for.cond.cleanup

for.cond1.preheader.preheader:                    ; preds = %entry
  %2 = add i32 %0, -1
  %3 = shl i32 %0, 1
  %4 = add i32 %3, -1
  br label %for.cond1.preheader

for.cond.loopexit.loopexit:                       ; preds = %for.body4,
%middle.block
  %scevgep = getelementptr i8, i8* %d.024, i32 %0
  %scevgep27 = getelementptr i8, i8* %scevgep, i32 %6
  %scevgep29 = getelementptr i8, i8* %scevgep28, i32 %6
  br label %for.cond.loopexit

for.cond.loopexit:                                ; preds =
%for.cond.loopexit.loopexit, %for.cond1.preheader
  %i.1.lcssa = phi i32 [ %i.026, %for.cond1.preheader ], [ %0,
%for.cond.loopexit.loopexit ]
  %c.1.lcssa = phi i8* [ %c.025, %for.cond1.preheader ], [ %scevgep29,
%for.cond.loopexit.loopexit ]
  %d.1.lcssa = phi i8* [ %d.024, %for.cond1.preheader ], [ %scevgep27,
%for.cond.loopexit.loopexit ]
  %5 = load i32, i32* @a, align 4, !tbaa !2
  %cmp = icmp sgt i32 %5, 2
  br i1 %cmp, label %for.cond1.preheader, label %for.cond.cleanup

for.cond1.preheader:                              ; preds =
%for.cond1.preheader.preheader, %for.cond.loopexit
  %i.026 = phi i32 [ %i.1.lcssa, %for.cond.loopexit ], [ undef,
%for.cond1.preheader.preheader ]
  %c.025 = phi i8* [ %c.1.lcssa, %for.cond.loopexit ], [ undef,
%for.cond1.preheader.preheader ]
  %d.024 = phi i8* [ %d.1.lcssa, %for.cond.loopexit ], [ undef,
%for.cond1.preheader.preheader ]
  %cmp217 = icmp sgt i32 %0, %i.026
  br i1 %cmp217, label %for.body4.preheader, label %for.cond.loopexit

for.body4.preheader:                              ; preds =
%for.cond1.preheader
  %6 = sub i32 0, %i.026
  %scevgep28 = getelementptr i8, i8* %c.025, i32 %0
  %7 = sub i32 %0, %i.026
  %min.iters.check = icmp ult i32 %7, 16
  br i1 %min.iters.check, label %for.body4, label %min.iters.checked

min.iters.checked:                                ; preds =
%for.body4.preheader
  %n.vec = and i32 %7, -16
  %cmp.zero = icmp eq i32 %n.vec, 0
  br i1 %cmp.zero, label %for.body4, label %vector.memcheck

vector.memcheck:                                  ; preds = %min.iters.checked
  %scevgep30 = getelementptr i8, i8* %c.025, i32 %2
  %scevgep31 = getelementptr i8, i8* %scevgep30, i32 %6
  %scevgep32 = getelementptr i8, i8* %d.024, i32 %0
  %scevgep33 = getelementptr i8, i8* %d.024, i32 %4
  %scevgep34 = getelementptr i8, i8* %scevgep33, i32 %6
  %bound0 = icmp ule i8* %c.025, %scevgep34
  %bound1 = icmp ule i8* %scevgep32, %scevgep31
  %memcheck.conflict = and i1 %bound0, %bound1
  %ind.end = add i32 %i.026, %n.vec
  %ind.end36 = getelementptr i8, i8* %c.025, i32 %n.vec
  %ind.end38 = getelementptr i8, i8* %d.024, i32 %n.vec
  br i1 %memcheck.conflict, label %for.body4, label %vector.body

vector.body:                                      ; preds = %vector.memcheck,
%vector.body  %index = phi i32 [ %index.next, %vector.body ], [ 0,
%vector.memcheck ]
  %next.gep = getelementptr i8, i8* %c.025, i32 %index
  %next.gep69 = getelementptr i8, i8* %d.024, i32 %index
  %8 = getelementptr inbounds i8, i8* %next.gep69, i32 %0
  %9 = bitcast i8* %8 to <16 x i8>*
  %wide.load = load <16 x i8>, <16 x i8>* %9, align 1, !tbaa !6, !alias.scope
!7
  %10 = zext <16 x i8> %wide.load to <16 x i32>
  %11 = add nuw nsw <16 x i32> %10, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1,
i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
  %12 = lshr <16 x i32> %11, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1,
i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
  %13 = trunc <16 x i32> %12 to <16 x i8>
  %14 = bitcast i8* %next.gep to <16 x i8>*
  store <16 x i8> %13, <16 x i8>* %14, align 1, !tbaa !6, !alias.scope !10,
!noalias !7
  %index.next = add i32 %index, 16
  %15 = icmp eq i32 %index.next, %n.vec
  br i1 %15, label %middle.block, label %vector.body, !llvm.loop !12

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i32 %7, %n.vec
  br i1 %cmp.n, label %for.cond.loopexit.loopexit, label %for.body4

for.cond.cleanup:                                 ; preds = %for.cond.loopexit,
%entry
  ret void

for.body4:                                        ; preds =
%for.body4.preheader, %min.iters.checked, %vector.memcheck, %middle.block,
%for.body4
  %i.120 = phi i32 [ %inc, %for.body4 ], [ %ind.end, %middle.block ], [ %i.026,
%for.body4.preheader ], [ %i.026, %min.iters.checked ], [ %i.026,
%vector.memcheck ]
  %c.119 = phi i8* [ %incdec.ptr, %for.body4 ], [ %ind.end36, %middle.block ],
[ %c.025, %for.body4.preheader ], [ %c.025, %min.iters.checked ], [ %c.025,
%vector.memcheck ]
  %d.118 = phi i8* [ %incdec.ptr6, %for.body4 ], [ %ind.end38, %middle.block ],
[ %d.024, %for.body4.preheader ], [ %d.024, %min.iters.checked ], [ %d.024,
%vector.memcheck ]
  %arrayidx = getelementptr inbounds i8, i8* %d.118, i32 %0
  %16 = load i8, i8* %arrayidx, align 1, !tbaa !6
  %conv = zext i8 %16 to i32
  %add = add nuw nsw i32 %conv, 1
  %div = lshr i32 %add, 1
  %conv5 = trunc i32 %div to i8
  %incdec.ptr = getelementptr inbounds i8, i8* %c.119, i32 1
  store i8 %conv5, i8* %c.119, align 1, !tbaa !6
  %incdec.ptr6 = getelementptr inbounds i8, i8* %d.118, i32 1
  %inc = add nsw i32 %i.120, 1
  %exitcond = icmp eq i32 %inc, %0
  br i1 %exitcond, label %for.cond.loopexit.loopexit, label %for.body4,
!llvm.loop !15
}

attributes #0 = { norecurse nounwind ssp "disable-tail-calls"="false"
"less-precise-fpmad"="false" "no-frame-pointer-elim"="true"
"no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false"
"no-jump-tables"="false" "no-nans-fp-math"="false"
"stack-protector-buffer-size"="8" "target-cpu"="pentium3"
"target-features"="+fxsr,+mmx,+sse,+x87" "unsafe-fp-math"="false"
"use-soft-float"="false" }

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

!0 = !{i32 1, !"PIC Level", i32 2}
!1 = !{!"clang version 3.9.0 (trunk 271435)"}
!2 = !{!3, !3, i64 0}
!3 = !{!"int", !4, i64 0}
!4 = !{!"omnipotent char", !5, i64 0}
!5 = !{!"Simple C/C++ TBAA"}
!6 = !{!4, !4, i64 0}
!7 = !{!8}
!8 = distinct !{!8, !9}
!9 = distinct !{!9, !"LVerDomain"}
!10 = !{!11}
!11 = distinct !{!11, !9}
!12 = distinct !{!12, !13, !14}
!13 = !{!"llvm.loop.vectorize.width", i32 1}
!14 = !{!"llvm.loop.interleave.count", i32 1}
!15 = distinct !{!15, !13, !14}

-- 
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/20160601/3191a210/attachment-0001.html>


More information about the llvm-bugs mailing list