Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
LLVM 2.03 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: norecurse nounwind readnone uwtable
  7. define i32 @fib(i32 %num) local_unnamed_addr #0 {
  8. entry:
  9.   %cmp17 = icmp slt i32 %num, 1
  10.   br i1 %cmp17, label %cleanup, label %for.body.preheader
  11.  
  12. for.body.preheader:                               ; preds = %entry
  13.   br label %for.body
  14.  
  15. for.cond:                                         ; preds = %for.body
  16.   %inc5 = add nuw nsw i32 %i.019, 1
  17.   %cmp = icmp slt i32 %i.019, %num
  18.   br i1 %cmp, label %for.body, label %cleanup.loopexit
  19.  
  20. for.body:                                         ; preds = %for.body.preheader, %for.cond
  21.   %i.019 = phi i32 [ %inc5, %for.cond ], [ 1, %for.body.preheader ]
  22.   %k.018 = phi i32 [ %inc.k.0, %for.cond ], [ 0, %for.body.preheader ]
  23.   %rem = srem i32 %num, %i.019
  24.   %cmp1 = icmp eq i32 %rem, 0
  25.   %inc = zext i1 %cmp1 to i32
  26.   %inc.k.0 = add nsw i32 %inc, %k.018
  27.   %cmp2 = icmp sgt i32 %inc.k.0, 2
  28.   br i1 %cmp2, label %cleanup.loopexit, label %for.cond
  29.  
  30. cleanup.loopexit:                                 ; preds = %for.body, %for.cond
  31.   %.ph = phi i32 [ 1, %for.cond ], [ 0, %for.body ]
  32.   br label %cleanup
  33.  
  34. cleanup:                                          ; preds = %cleanup.loopexit, %entry
  35.   %0 = phi i32 [ 1, %entry ], [ %.ph, %cleanup.loopexit ]
  36.   ret i32 %0
  37. }
  38.  
  39. attributes #0 = { norecurse nounwind readnone 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" }
  40.  
  41. !llvm.module.flags = !{!0}
  42. !llvm.ident = !{!1}
  43.  
  44. !0 = !{i32 1, !"PIC Level", i32 2}
  45. !1 = !{!"clang version 4.0.0 (tags/RELEASE_400/final)"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement