File: 2012-02-13-FCmp.ll

package info (click to toggle)
llvm-toolchain-9 1%3A9.0.1-16.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 882,388 kB
  • sloc: cpp: 4,167,636; ansic: 714,256; asm: 457,610; python: 155,927; objc: 65,094; sh: 42,856; lisp: 26,908; perl: 7,786; pascal: 7,722; makefile: 6,881; ml: 5,581; awk: 3,648; cs: 2,027; xml: 888; javascript: 381; ruby: 156
file content (35 lines) | stat: -rw-r--r-- 1,464 bytes parent folder | download | duplicates (21)
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
; RUN: opt -instcombine -S < %s | FileCheck %s
; Radar 10803727
@.str = private unnamed_addr constant [35 x i8] c"\0Ain_range input (should be 0): %f\0A\00", align 1
@.str1 = external hidden unnamed_addr constant [35 x i8], align 1

declare i32 @printf(i8*, ...)
define i64 @_Z8tempCastj(i32 %val) uwtable ssp {
entry:
  %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str1, i64 0, i64 0), i32 %val)
  %conv = uitofp i32 %val to double
  %call.i = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double %conv)
  %cmp.i = fcmp oge double %conv, -1.000000e+00
  br i1 %cmp.i, label %land.rhs.i, label %if.end.critedge
; CHECK:  br i1 true, label %land.rhs.i, label %if.end.critedge

land.rhs.i:                                       ; preds = %entry
  %cmp1.i = fcmp olt double %conv, 1.000000e+00
  br i1 %cmp1.i, label %if.then, label %if.end

if.then:                                          ; preds = %land.rhs.i
  %add = fadd double %conv, 5.000000e-01
  %conv3 = fptosi double %add to i64
  br label %return

if.end.critedge:                                  ; preds = %entry
  br label %if.end

if.end:                                           ; preds = %if.end.critedge, %land.rhs.i
  br label %return

return:                                           ; preds = %if.end, %if.then
  %retval.0 = phi i64 [ %conv3, %if.then ], [ -1, %if.end ]
  ret i64 %retval.0
}