[llvm-bugs] [Bug 31672] New: Assertion failed: ((TLI.getTypeAction(*DAG.getContext(), Op.getValueType()) == TargetLowering::TypeLegal || TLI.isTypeLegal(Op.getValueType()) || Op.getOpcode() == ISD::TargetConstant) && "Unexpected illegal type!"), function LegalizeOp

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jan 17 11:11:28 PST 2017


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

            Bug ID: 31672
           Summary: Assertion failed:
                    ((TLI.getTypeAction(*DAG.getContext(),
                    Op.getValueType()) == TargetLowering::TypeLegal ||
                    TLI.isTypeLegal(Op.getValueType()) || Op.getOpcode()
                    == ISD::TargetConstant) && "Unexpected illegal
                    type!"), function LegalizeOp
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: dimitry at andric.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

This assertion has been encountered in https://bugs.freebsd.org/216166, while
compiling gegl on i386.  It has been produced since at least trunk r281149, and
still reproduces as of trunk r291476.

Minimized test case in C:
------------------------------------------------------------------------
/* clang -cc1 -triple i386 -S -menable-unsafe-fp-math -ffast-math -target-cpu
i486 -target-feature +sse -O2 -w -vectorize-loops -vectorize-slp testcase.c */
x0, x1, x2;
float x3;
x4(float x5) {
  float x6 = x0 * x5, x7 = sqrtf(x6);
  return x7;
}
x8(int x5, double *x9) {
  int x10 = x4(x3 - x5);
  *x9 += x10;
}
x11() {
  do
    x8(x2, &x1);
  while (++x2);
}
------------------------------------------------------------------------

Minimized and simplified .ll:
------------------------------------------------------------------------
; ModuleID = 'bugpoint-reduced-simplified.bc'
source_filename = "bugpoint-output-48ce2a9.bc"
target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
target triple = "i386"

@x1 = external global i32, align 4

; Function Attrs: nounwind
define void @x11() local_unnamed_addr #0 {
entry:
  %0 = call fast <2 x float> @llvm.sqrt.v2f32(<2 x float> zeroinitializer)
  %1 = fptosi <2 x float> %0 to <2 x i32>
  %2 = sitofp <2 x i32> %1 to <2 x double>
  %3 = fadd fast <2 x double> %2, zeroinitializer
  %bin.rdx = fadd fast <2 x double> %3, zeroinitializer
  %4 = extractelement <2 x double> %bin.rdx, i32 0
  store double %4, double* bitcast (i32* @x1 to double*), align 4, !tbaa !1
  ret void
}

; Function Attrs: nounwind readnone
declare <2 x float> @llvm.sqrt.v2f32(<2 x float>) #1

attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false"
"disable-tail-calls"="false" "less-precise-fpmad"="false"
"no-frame-pointer-elim"="false" "no-infs-fp-math"="false"
"no-jump-tables"="false" "no-nans-fp-math"="false"
"no-signed-zeros-fp-math"="false" "no-trapping-math"="false"
"stack-protector-buffer-size"="8" "target-cpu"="i486"
"target-features"="+mmx,+sse,+x87" "unsafe-fp-math"="true"
"use-soft-float"="false" }
attributes #1 = { nounwind readnone }

!llvm.ident = !{!0}

!0 = !{!"FreeBSD clang version 4.0.0 (branches/release_40 292009) (based on
LLVM 4.0.0)"}
!1 = !{!2, !2, i64 0}
!2 = !{!"double", !3, i64 0}
!3 = !{!"omnipotent char", !4, i64 0}
!4 = !{!"Simple C/C++ TBAA"}
------------------------------------------------------------------------

-- 
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/20170117/315d9a36/attachment.html>


More information about the llvm-bugs mailing list