Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
LLVM 2.79 KB | None | 0 0
  1. ; ModuleID = 'fib.c'
  2. source_filename = "fib.c"
  3. target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
  4. target triple = "x86_64-pc-windows-msvc19.0.23026"
  5.  
  6. ; Function Attrs: noinline nounwind uwtable
  7. define i32 @fib(i32 %num) #0 {
  8. entry:
  9.   %retval = alloca i32, align 4
  10.   %num.addr = alloca i32, align 4
  11.   %q = alloca i32, align 4
  12.   %k = alloca i32, align 4
  13.   %i = alloca i32, align 4
  14.   store i32 %num, i32* %num.addr, align 4
  15.   store i32 1, i32* %q, align 4
  16.   store i32 0, i32* %k, align 4
  17.   store i32 1, i32* %i, align 4
  18.   br label %for.cond
  19.  
  20. for.cond:                                         ; preds = %for.inc, %entry
  21.   %0 = load i32, i32* %i, align 4
  22.   %1 = load i32, i32* %num.addr, align 4
  23.   %cmp = icmp sle i32 %0, %1
  24.   br i1 %cmp, label %for.body, label %for.end
  25.  
  26. for.body:                                         ; preds = %for.cond
  27.   %2 = load i32, i32* %num.addr, align 4
  28.   %3 = load i32, i32* %i, align 4
  29.   %rem = srem i32 %2, %3
  30.   %cmp1 = icmp eq i32 %rem, 0
  31.   br i1 %cmp1, label %if.then, label %if.end
  32.  
  33. if.then:                                          ; preds = %for.body
  34.   %4 = load i32, i32* %k, align 4
  35.   %inc = add nsw i32 %4, 1
  36.   store i32 %inc, i32* %k, align 4
  37.   br label %if.end
  38.  
  39. if.end:                                           ; preds = %if.then, %for.body
  40.   %5 = load i32, i32* %k, align 4
  41.   %cmp2 = icmp sgt i32 %5, 2
  42.   br i1 %cmp2, label %if.then3, label %if.end4
  43.  
  44. if.then3:                                         ; preds = %if.end
  45.   store i32 0, i32* %q, align 4
  46.   %6 = load i32, i32* %q, align 4
  47.   store i32 %6, i32* %retval, align 4
  48.   br label %return
  49.  
  50. if.end4:                                          ; preds = %if.end
  51.   br label %for.inc
  52.  
  53. for.inc:                                          ; preds = %if.end4
  54.   %7 = load i32, i32* %i, align 4
  55.   %inc5 = add nsw i32 %7, 1
  56.   store i32 %inc5, i32* %i, align 4
  57.   br label %for.cond
  58.  
  59. for.end:                                          ; preds = %for.cond
  60.   %8 = load i32, i32* %q, align 4
  61.   store i32 %8, i32* %retval, align 4
  62.   br label %return
  63.  
  64. return:                                           ; preds = %for.end, %if.then3
  65.   %9 = load i32, i32* %retval, align 4
  66.   ret i32 %9
  67. }
  68.  
  69. attributes #0 = { noinline nounwind uwtable "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"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
  70.  
  71. !llvm.module.flags = !{!0}
  72. !llvm.ident = !{!1}
  73.  
  74. !0 = !{i32 1, !"PIC Level", i32 2}
  75. !1 = !{!"clang version 4.0.0 (tags/RELEASE_400/final)"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement