File: fp-une-cmp.ll

package info (click to toggle)
llvm-toolchain-3.8 1%3A3.8.1-24
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 379,280 kB
  • ctags: 388,501
  • sloc: cpp: 2,309,705; ansic: 477,070; objc: 100,918; asm: 97,974; python: 95,911; sh: 18,634; makefile: 7,294; perl: 5,584; ml: 5,460; pascal: 4,661; lisp: 2,548; xml: 686; cs: 350; php: 212; csh: 117
file content (43 lines) | stat: -rw-r--r-- 917 bytes parent folder | download | duplicates (6)
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
33
34
35
36
37
38
39
40
41
42
43
; RUN: llc < %s -march=x86 -mattr=sse4.1 | FileCheck %s
; <rdar://problem/7859988>

; Make sure we don't generate more jumps than we need to. We used to generate
; something like this:
;
;       jne  LBB0_1
;       jnp  LBB0_2
;   LBB0_1:
;       jmp  LBB0_3
;   LBB0_2:
;       addsd ...
;   LBB0_3:
;
; Now we generate this:
;
;       jne  LBB0_2
;       jp   LBB0_2
;       addsd ...
;   LBB0_2:

; CHECK:       func
; CHECK:       jne [[LABEL:.*]]
; CHECK-NEXT:  jp  [[LABEL]]
; CHECK-NOT:   jmp

define float @func(float %x, float %y) nounwind readnone optsize ssp {
entry:
  %0 = fpext float %x to double
  %1 = fpext float %y to double
  %2 = fmul double %0, %1
  %3 = fcmp une double %2, 0.000000e+00
  br i1 %3, label %bb2, label %bb1

bb1:
  %4 = fadd double %2, -1.000000e+00
  br label %bb2

bb2:
  %.0.in = phi double [ %4, %bb1 ], [ %2, %entry ]
  %.0 = fptrunc double %.0.in to float
  ret float %.0
}