次にrustcによるLLVM IR生成
$ rustc -C opt-level=2 --emit llvm-ir -o fibonacci_rs.ll fibonacci.rs
そのうちfibonacci()関数部分を抜粋すると以下のコードとなった

; fibonacci::fibonacci
; Function Attrs: nofree nosync nounwind nonlazybind memory(none) uwtable
define internal fastcc noundef i32 @_ZN9fibonacci9fibonacci17h1af4b62ef57b502cE(i32 noundef %n) unnamed_addr #4 {
start:
 %switch1 = icmp ult i32 %n, 2
 br i1 %switch1, label %bb8, label %bb5

bb5: ; preds = %start, %bb5
 %n.tr3 = phi i32 [ %_7, %bb5 ], [ %n, %start ]
 %accumulator.tr2 = phi i32 [ %0, %bb5 ], [ 0, %start ]
 %_5 = add i32 %n.tr3, -2
; call fibonacci::fibonacci
 %_4 = tail call fastcc noundef i32 @_ZN9fibonacci9fibonacci17h1af4b62ef57b502cE(i32 noundef %_5)
 %_7 = add i32 %n.tr3, -1
 %0 = add i32 %_4, %accumulator.tr2
 %switch = icmp ult i32 %_7, 2
 br i1 %switch, label %bb8, label %bb5

bb8: ; preds = %bb5, %start
 %accumulator.tr.lcssa = phi i32 [ 0, %start ], [ %0, %bb5 ]
 %n.tr.lcssa = phi i32 [ %n, %start ], [ 1, %bb5 ]
 %accumulator.ret.tr = add i32 %n.tr.lcssa, %accumulator.tr.lcssa
 ret i32 %accumulator.ret.tr
}

clangの場合>>357とは異なり「call」によるfibonacci()呼び出しが一つとなり最適化されている