File: select-crash.ll

package info (click to toggle)
llvm-toolchain-6.0 1:6.0-1~bpo9+1
  • links: PTS, VCS
  • area: main
  • in suites: stretch-backports
  • size: 594,652 kB
  • sloc: cpp: 3,044,500; ansic: 595,051; asm: 271,890; python: 128,923; objc: 106,554; sh: 21,854; lisp: 10,191; pascal: 6,094; ml: 5,544; perl: 5,265; makefile: 2,214; cs: 2,027; xml: 686; php: 212; csh: 117
file content (32 lines) | stat: -rw-r--r-- 1,134 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
; RUN: opt < %s -instcombine -S | FileCheck %s
; Formerly crashed, PR8490.

define fastcc double @gimp_operation_color_balance_map(float %value, double %highlights) nounwind readnone inlinehint {
entry:
; CHECK: gimp_operation_color_balance_map
; CHECK: fsub double -0.000000
  %conv = fpext float %value to double
  %div = fdiv double %conv, 1.600000e+01
  %add = fadd double %div, 1.000000e+00
  %div1 = fdiv double 1.000000e+00, %add
  %sub = fsub double 1.075000e+00, %div1
  %sub24 = fsub double 1.000000e+00, %sub
  %add26 = fadd double %sub, 1.000000e+00
  %cmp86 = fcmp ogt double %highlights, 0.000000e+00
  %cond90 = select i1 %cmp86, double %sub24, double %add26
  %mul91 = fmul double %highlights, %cond90
  %add94 = fadd double undef, %mul91
  ret double %add94
}

; PR10180: same crash, but with vectors
define <4 x float> @foo(i1 %b, <4 x float> %x, <4 x float> %y, <4 x float> %z) {
; CHECK-LABEL: @foo(
; CHECK: fsub <4 x float>
; CHECK: select
; CHECK: fadd <4 x float>
  %a = fadd <4 x float> %x, %y
  %sub = fsub <4 x float> %x, %z
  %sel = select i1 %b, <4 x float> %a, <4 x float> %sub 
  ret <4 x float> %sel
}