Skip to content

Instantly share code, notes, and snippets.

@huonw

huonw/no_std.ll Secret

Created September 25, 2013 07:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huonw/f825d529e29430b7eb53 to your computer and use it in GitHub Desktop.
Save huonw/f825d529e29430b7eb53 to your computer and use it in GitHub Desktop.
; ModuleID = 'no_std.rc'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%struct.Vec = type { float, float, float }
@_rust_crate_map_toplevel = global { i32, i64, [1 x i64] } { i32 1, i64 ptrtoint ([1 x { i64, i64 }]* @_rust_mod_map to i64), [1 x i64] zeroinitializer }
@const = private constant [9 x i32] [i32 301252, i32 336932, i32 402628, i32 468255, i32 304324, i32 458756, i32 0, i32 0, i32 0]
@_ZN1G18hc31daf886cce669aB4v0.0E = constant { i32*, i64 } { i32* getelementptr inbounds ([9 x i32]* @const, i32 0, i32 0), i64 36 }
@_rust_mod_map = internal global [1 x { i64, i64 }] zeroinitializer
@rust_abi_version = constant i64 1
; Function Attrs: nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #0
; Function Attrs: nounwind readonly
declare float @llvm.pow.f32(float, float) #1
; Function Attrs: nounwind readonly
declare float @llvm.sqrt.f32(float) #1
; Function Attrs: nounwind readonly
declare float @llvm.ceil.f32(float) #1
declare i64 @write(i32, i8* nocapture readonly, i64)
declare i32 @rand()
; Function Attrs: nounwind uwtable
define internal fastcc i32 @T(%struct.Vec* nocapture readonly, %struct.Vec* nocapture readonly, float* nocapture, %struct.Vec* nocapture) #2 {
"function top level":
store float 1.000000e+09, float* %2, align 4
%4 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 2
%5 = load float* %4, align 4
%6 = fsub float -0.000000e+00, %5
%7 = getelementptr inbounds %struct.Vec* %1, i64 0, i32 2
%8 = load float* %7, align 4
%9 = fdiv float %6, %8
%10 = fcmp ogt float %9, 0x3F847AE140000000
br i1 %10, label %then, label %"function top level.while loop cond.preheader_crit_edge"
"function top level.while loop cond.preheader_crit_edge": ; preds = %"function top level"
%.sroa.029.0.idx.pre = getelementptr inbounds %struct.Vec* %3, i64 0, i32 0
%.sroa.230.0.idx31.pre = getelementptr inbounds %struct.Vec* %3, i64 0, i32 1
%.sroa.3.0.idx32.pre = getelementptr inbounds %struct.Vec* %3, i64 0, i32 2
br label %"while loop cond.preheader"
then: ; preds = %"function top level"
store float %9, float* %2, align 4
%.sroa.055.0.idx = getelementptr inbounds %struct.Vec* %3, i64 0, i32 0
store float 0.000000e+00, float* %.sroa.055.0.idx, align 4
%.sroa.256.0.idx57 = getelementptr inbounds %struct.Vec* %3, i64 0, i32 1
store float 0.000000e+00, float* %.sroa.256.0.idx57, align 4
%.sroa.358.0.idx59 = getelementptr inbounds %struct.Vec* %3, i64 0, i32 2
store float 1.000000e+00, float* %.sroa.358.0.idx59, align 4
br label %"while loop cond.preheader"
"while loop cond.preheader": ; preds = %"function top level.while loop cond.preheader_crit_edge", %then
%.sroa.3.0.idx32.pre-phi = phi float* [ %.sroa.3.0.idx32.pre, %"function top level.while loop cond.preheader_crit_edge" ], [ %.sroa.358.0.idx59, %then ]
%.sroa.230.0.idx31.pre-phi = phi float* [ %.sroa.230.0.idx31.pre, %"function top level.while loop cond.preheader_crit_edge" ], [ %.sroa.256.0.idx57, %then ]
%.sroa.029.0.idx.pre-phi = phi float* [ %.sroa.029.0.idx.pre, %"function top level.while loop cond.preheader_crit_edge" ], [ %.sroa.055.0.idx, %then ]
%m.1.ph = phi i32 [ 0, %"function top level.while loop cond.preheader_crit_edge" ], [ 1, %then ]
%__self8.sroa.0.0.idx = getelementptr inbounds %struct.Vec* %0, i64 0, i32 0
%__self8.sroa.2.0.idx44 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 1
%__self10.sroa.0.0.idx = getelementptr inbounds %struct.Vec* %1, i64 0, i32 0
%__self10.sroa.2.0.idx37 = getelementptr inbounds %struct.Vec* %1, i64 0, i32 1
br label %"while loop cond4.preheader"
"while next": ; preds = %"while next2"
ret i32 %m.3
"while loop cond4.preheader": ; preds = %"while loop cond.preheader", %"while next2"
%m.163 = phi i32 [ %m.1.ph, %"while loop cond.preheader" ], [ %m.3, %"while next2" ]
%k.062 = phi i64 [ 18, %"while loop cond.preheader" ], [ %15, %"while next2" ]
%11 = trunc i64 %k.062 to i32
%12 = shl i32 1, %11
%13 = sub i64 0, %k.062
%14 = sitofp i64 %13 to float
br label %"while loop body5"
"while next2": ; preds = %next19
%15 = add i64 %k.062, -1
%16 = icmp sgt i64 %15, -1
br i1 %16, label %"while loop cond4.preheader", label %"while next"
"while loop body5": ; preds = %"while loop cond4.preheader", %next19
%m.261 = phi i32 [ %m.163, %"while loop cond4.preheader" ], [ %m.3, %next19 ]
%j.060 = phi i64 [ 8, %"while loop cond4.preheader" ], [ %66, %next19 ]
%17 = getelementptr inbounds [9 x i32]* @const, i64 0, i64 %j.060
%18 = load i32* %17, align 4
%19 = and i32 %18, %12
%20 = icmp eq i32 %19, 0
br i1 %20, label %next19, label %then6
then6: ; preds = %"while loop body5"
%__self8.sroa.0.0.copyload = load float* %__self8.sroa.0.0.idx, align 4
%__self8.sroa.2.0.copyload = load float* %__self8.sroa.2.0.idx44, align 4
%__self8.sroa.3.0.copyload = load float* %4, align 4
%21 = sitofp i64 %j.060 to float
%22 = fsub float -4.000000e+00, %21
%23 = fadd float %14, %__self8.sroa.0.0.copyload
%24 = fadd float %__self8.sroa.2.0.copyload, 3.000000e+00
%25 = fadd float %22, %__self8.sroa.3.0.copyload
%__self10.sroa.0.0.copyload = load float* %__self10.sroa.0.0.idx, align 4
%__self10.sroa.2.0.copyload = load float* %__self10.sroa.2.0.idx37, align 4
%__self10.sroa.3.0.copyload = load float* %7, align 4
%26 = fmul float %23, %__self10.sroa.0.0.copyload
%27 = fmul float %24, %__self10.sroa.2.0.copyload
%28 = fadd float %26, %27
%29 = fmul float %25, %__self10.sroa.3.0.copyload
%30 = fadd float %28, %29
%31 = fmul float %23, %23
%32 = fmul float %24, %24
%33 = fadd float %31, %32
%34 = fmul float %25, %25
%35 = fadd float %33, %34
%36 = fadd float %35, -1.000000e+00
%37 = fmul float %30, %30
%38 = fsub float %37, %36
%39 = fcmp ogt float %38, 0.000000e+00
br i1 %39, label %then13, label %next19
then13: ; preds = %then6
%40 = fsub float -0.000000e+00, %30
%41 = tail call float @llvm.sqrt.f32(float %38) #0
%42 = fsub float %40, %41
%43 = fcmp ogt float %42, 0x3F847AE140000000
%44 = zext i1 %43 to i8
br i1 %43, label %rhs, label %join
join: ; preds = %rhs, %then13
%45 = phi i8 [ %44, %then13 ], [ %49, %rhs ]
%46 = icmp eq i8 %45, 0
br i1 %46, label %next19, label %then14
rhs: ; preds = %then13
%47 = load float* %2, align 4
%48 = fcmp olt float %42, %47
%49 = zext i1 %48 to i8
br label %join
then14: ; preds = %join
store float %42, float* %2, align 4
%__self16.sroa.0.0.copyload = load float* %__self10.sroa.0.0.idx, align 4
%__self16.sroa.2.0.copyload = load float* %__self10.sroa.2.0.idx37, align 4
%__self16.sroa.3.0.copyload = load float* %7, align 4
%50 = fmul float %42, %__self16.sroa.0.0.copyload
%51 = fmul float %42, %__self16.sroa.2.0.copyload
%52 = fmul float %42, %__self16.sroa.3.0.copyload
%53 = fadd float %23, %50
%54 = fadd float %24, %51
%55 = fadd float %25, %52
%56 = fmul float %53, %53
%57 = fmul float %54, %54
%58 = fadd float %56, %57
%59 = fmul float %55, %55
%60 = fadd float %58, %59
%61 = tail call float @llvm.sqrt.f32(float %60) #0
%62 = fdiv float 1.000000e+00, %61
%63 = fmul float %53, %62
%64 = fmul float %54, %62
%65 = fmul float %55, %62
store float %63, float* %.sroa.029.0.idx.pre-phi, align 4
store float %64, float* %.sroa.230.0.idx31.pre-phi, align 4
store float %65, float* %.sroa.3.0.idx32.pre-phi, align 4
br label %next19
next19: ; preds = %join, %"while loop body5", %then6, %then14
%m.3 = phi i32 [ 2, %then14 ], [ %m.261, %join ], [ %m.261, %then6 ], [ %m.261, %"while loop body5" ]
%66 = add i64 %j.060, -1
%67 = icmp sgt i64 %66, -1
br i1 %67, label %"while loop body5", label %"while next2"
}
; Function Attrs: uwtable
define internal fastcc void @S(%struct.Vec* noalias nocapture sret, %struct.Vec* nocapture readonly, %struct.Vec* nocapture readonly) #3 {
"function top level":
%t = alloca float, align 4
%n = alloca %struct.Vec, align 8
%__self = alloca %struct.Vec, align 8
%__self1 = alloca %struct.Vec, align 8
%__self11 = alloca %struct.Vec, align 8
%__self12 = alloca %struct.Vec, align 8
%3 = alloca %struct.Vec, align 8
%__self22 = alloca %struct.Vec, align 8
%__self23 = alloca %struct.Vec, align 8
store float 0.000000e+00, float* %t, align 4
%4 = getelementptr inbounds %struct.Vec* %n, i64 0, i32 0
store float 0.000000e+00, float* %4, align 8
%5 = getelementptr inbounds %struct.Vec* %n, i64 0, i32 1
store float 0.000000e+00, float* %5, align 4
%6 = getelementptr inbounds %struct.Vec* %n, i64 0, i32 2
store float 0.000000e+00, float* %6, align 8
%7 = bitcast %struct.Vec* %1 to i8*
%8 = bitcast %struct.Vec* %__self to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %8, i8* %7, i64 12, i32 4, i1 false)
%9 = bitcast %struct.Vec* %2 to i8*
%10 = bitcast %struct.Vec* %__self1 to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %10, i8* %9, i64 12, i32 4, i1 false)
%11 = call fastcc i32 @T(%struct.Vec* %__self, %struct.Vec* %__self1, float* %t, %struct.Vec* %n)
%12 = icmp eq i32 %11, 0
br i1 %12, label %then, label %next
then: ; preds = %"function top level"
%13 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 2
%14 = load float* %13, align 4
%15 = fsub float 1.000000e+00, %14
%16 = tail call float @llvm.pow.f32(float %15, float 4.000000e+00) #0
%17 = fmul float %16, 0x3FE6666660000000
%18 = fmul float %16, 0x3FE3333340000000
%19 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 0
store float %17, float* %19, align 4
%20 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 1
store float %18, float* %20, align 4
%21 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 2
store float %16, float* %21, align 4
br label %return
next: ; preds = %"function top level"
%__self2.sroa.0.0.idx = getelementptr inbounds %struct.Vec* %1, i64 0, i32 0
%__self2.sroa.0.0.copyload = load float* %__self2.sroa.0.0.idx, align 4
%__self2.sroa.2.0.idx99 = getelementptr inbounds %struct.Vec* %1, i64 0, i32 1
%__self2.sroa.2.0.copyload = load float* %__self2.sroa.2.0.idx99, align 4
%__self2.sroa.3.0.idx100 = getelementptr inbounds %struct.Vec* %1, i64 0, i32 2
%__self2.sroa.3.0.copyload = load float* %__self2.sroa.3.0.idx100, align 4
%__self3.sroa.0.0.idx = getelementptr inbounds %struct.Vec* %2, i64 0, i32 0
%__self3.sroa.0.0.copyload = load float* %__self3.sroa.0.0.idx, align 4
%__self3.sroa.2.0.idx94 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 1
%__self3.sroa.2.0.copyload = load float* %__self3.sroa.2.0.idx94, align 4
%__self3.sroa.3.0.idx95 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 2
%__self3.sroa.3.0.copyload = load float* %__self3.sroa.3.0.idx95, align 4
%22 = load float* %t, align 4
%23 = fmul float %__self3.sroa.0.0.copyload, %22
%24 = fmul float %__self3.sroa.2.0.copyload, %22
%25 = fmul float %__self3.sroa.3.0.copyload, %22
%26 = fadd float %__self2.sroa.0.0.copyload, %23
%27 = fadd float %__self2.sroa.2.0.copyload, %24
%28 = fadd float %__self2.sroa.3.0.copyload, %25
%29 = tail call i32 @rand()
%30 = sitofp i32 %29 to float
%31 = fmul float %30, 0x3E00000000000000
%32 = fadd float %31, 9.000000e+00
%33 = tail call i32 @rand()
%34 = sitofp i32 %33 to float
%35 = fmul float %34, 0x3E00000000000000
%36 = fadd float %35, 9.000000e+00
%37 = fmul float %26, -1.000000e+00
%38 = fmul float %27, -1.000000e+00
%39 = fmul float %28, -1.000000e+00
%40 = fadd float %37, %32
%41 = fadd float %38, %36
%42 = fadd float %39, 1.600000e+01
%43 = fmul float %40, %40
%44 = fmul float %41, %41
%45 = fadd float %43, %44
%46 = fmul float %42, %42
%47 = fadd float %46, %45
%48 = tail call float @llvm.sqrt.f32(float %47) #0
%49 = fdiv float 1.000000e+00, %48
%50 = fmul float %49, %40
%51 = fmul float %49, %41
%52 = fmul float %42, %49
%__self5.sroa.0.0.copyload = load float* %__self3.sroa.0.0.idx, align 4
%__self5.sroa.2.0.copyload = load float* %__self3.sroa.2.0.idx94, align 4
%__self5.sroa.3.0.copyload = load float* %__self3.sroa.3.0.idx95, align 4
%__self6.sroa.0.0.copyload = load float* %4, align 8
%__self6.sroa.2.0.copyload = load float* %5, align 4
%__self6.sroa.3.0.copyload = load float* %6, align 8
%53 = fmul float %__self5.sroa.0.0.copyload, %__self6.sroa.0.0.copyload
%54 = fmul float %__self5.sroa.2.0.copyload, %__self6.sroa.2.0.copyload
%55 = fadd float %53, %54
%56 = fmul float %__self5.sroa.3.0.copyload, %__self6.sroa.3.0.copyload
%57 = fadd float %55, %56
%58 = fmul float %57, -2.000000e+00
%59 = fmul float %__self6.sroa.0.0.copyload, %58
%60 = fmul float %__self6.sroa.2.0.copyload, %58
%61 = fmul float %__self6.sroa.3.0.copyload, %58
%62 = fadd float %__self5.sroa.0.0.copyload, %59
%63 = fadd float %__self5.sroa.2.0.copyload, %60
%64 = fadd float %__self5.sroa.3.0.copyload, %61
%65 = fmul float %50, %__self6.sroa.0.0.copyload
%66 = fmul float %51, %__self6.sroa.2.0.copyload
%67 = fadd float %65, %66
%68 = fmul float %52, %__self6.sroa.3.0.copyload
%69 = fadd float %67, %68
%70 = fcmp olt float %69, 0.000000e+00
%71 = zext i1 %70 to i8
br i1 %70, label %join, label %rhs
join: ; preds = %rhs, %next
%72 = phi i8 [ %71, %next ], [ %86, %rhs ]
%73 = icmp eq i8 %72, 0
%. = select i1 %73, float %69, float 0.000000e+00
%74 = fmul float %50, %62
%75 = fmul float %51, %63
%76 = fadd float %74, %75
%77 = fmul float %52, %64
%78 = fadd float %77, %76
%79 = fcmp ogt float %., 0.000000e+00
%80 = uitofp i1 %79 to float
%81 = fmul float %78, %80
%82 = tail call float @llvm.pow.f32(float %81, float 9.900000e+01) #0
%83 = icmp eq i32 %11, 1
br i1 %83, label %then17, label %else21
rhs: ; preds = %next
%h.sroa.0.0.idx102 = getelementptr inbounds %struct.Vec* %__self11, i64 0, i32 0
store float %26, float* %h.sroa.0.0.idx102, align 8
%h.sroa.5.0.idx105 = getelementptr inbounds %struct.Vec* %__self11, i64 0, i32 1
store float %27, float* %h.sroa.5.0.idx105, align 4
%h.sroa.8.0.idx109 = getelementptr inbounds %struct.Vec* %__self11, i64 0, i32 2
store float %28, float* %h.sroa.8.0.idx109, align 8
%l.sroa.0.0.idx = getelementptr inbounds %struct.Vec* %__self12, i64 0, i32 0
store float %50, float* %l.sroa.0.0.idx, align 8
%l.sroa.4.0.idx90 = getelementptr inbounds %struct.Vec* %__self12, i64 0, i32 1
store float %51, float* %l.sroa.4.0.idx90, align 4
%l.sroa.7.0.idx92 = getelementptr inbounds %struct.Vec* %__self12, i64 0, i32 2
store float %52, float* %l.sroa.7.0.idx92, align 8
%84 = call fastcc i32 @T(%struct.Vec* %__self11, %struct.Vec* %__self12, float* %t, %struct.Vec* %n)
%85 = icmp ne i32 %84, 0
%86 = zext i1 %85 to i8
br label %join
then17: ; preds = %join
%87 = fmul float %26, 0x3FC99999A0000000
%88 = fmul float %27, 0x3FC99999A0000000
%89 = tail call float @llvm.ceil.f32(float %87) #0
%90 = tail call float @llvm.ceil.f32(float %88) #0
%91 = fadd float %89, %90
%92 = fptosi float %91 to i32
%93 = and i32 %92, 1
%94 = icmp eq i32 %93, 0
%.117 = select i1 %94, float 3.000000e+00, float 1.000000e+00
%95 = fmul float %., 0x3FC99999A0000000
%96 = fadd float %95, 0x3FB99999A0000000
%97 = fmul float %96, 3.000000e+00
%98 = fmul float %96, %.117
%99 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 0
store float %97, float* %99, align 4
%100 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 1
store float %98, float* %100, align 4
%101 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 2
store float %98, float* %101, align 4
br label %return
else21: ; preds = %join
%h.sroa.0.0.idx = getelementptr inbounds %struct.Vec* %__self22, i64 0, i32 0
store float %26, float* %h.sroa.0.0.idx, align 8
%h.sroa.5.0.idx104 = getelementptr inbounds %struct.Vec* %__self22, i64 0, i32 1
store float %27, float* %h.sroa.5.0.idx104, align 4
%h.sroa.8.0.idx108 = getelementptr inbounds %struct.Vec* %__self22, i64 0, i32 2
store float %28, float* %h.sroa.8.0.idx108, align 8
%r.sroa.0.0.idx = getelementptr inbounds %struct.Vec* %__self23, i64 0, i32 0
store float %62, float* %r.sroa.0.0.idx, align 8
%r.sroa.3.0.idx76 = getelementptr inbounds %struct.Vec* %__self23, i64 0, i32 1
store float %63, float* %r.sroa.3.0.idx76, align 4
%r.sroa.5.0.idx77 = getelementptr inbounds %struct.Vec* %__self23, i64 0, i32 2
store float %64, float* %r.sroa.5.0.idx77, align 8
call fastcc void @S(%struct.Vec* sret %3, %struct.Vec* %__self22, %struct.Vec* %__self23)
%.idx26 = getelementptr %struct.Vec* %3, i64 0, i32 0
%.idx26.val = load float* %.idx26, align 8
%.idx27 = getelementptr %struct.Vec* %3, i64 0, i32 1
%.idx27.val = load float* %.idx27, align 4
%.idx28 = getelementptr %struct.Vec* %3, i64 0, i32 2
%.idx28.val = load float* %.idx28, align 8
%102 = fmul float %.idx26.val, 5.000000e-01
%103 = fmul float %.idx27.val, 5.000000e-01
%104 = fmul float %.idx28.val, 5.000000e-01
%105 = fadd float %82, %102
%106 = fadd float %82, %103
%107 = fadd float %82, %104
%108 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 0
store float %105, float* %108, align 4
%109 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 1
store float %106, float* %109, align 4
%110 = getelementptr inbounds %struct.Vec* %0, i64 0, i32 2
store float %107, float* %110, align 4
br label %return
return: ; preds = %then17, %else21, %then
ret void
}
; Function Attrs: noinline uwtable
define internal fastcc void @_ZN4main18h2588239c84f92dbab4v0.0E() #4 {
"function top level":
%0 = alloca [15 x i8], align 1
%1 = alloca %struct.Vec, align 8
%2 = alloca %struct.Vec, align 8
%__self22 = alloca %struct.Vec, align 8
%3 = alloca [3 x i8], align 1
%.sub = getelementptr inbounds [15 x i8]* %0, i64 0, i64 0
store i8 80, i8* %.sub, align 1
%4 = getelementptr inbounds [15 x i8]* %0, i64 0, i64 1
store i8 54, i8* %4, align 1
%5 = getelementptr inbounds [15 x i8]* %0, i64 0, i64 2
store i8 32, i8* %5, align 1
%6 = getelementptr inbounds [15 x i8]* %0, i64 0, i64 3
store i8 53, i8* %6, align 1
%7 = getelementptr inbounds [15 x i8]* %0, i64 0, i64 4
store i8 49, i8* %7, align 1
%8 = getelementptr inbounds [15 x i8]* %0, i64 0, i64 5
store i8 50, i8* %8, align 1
%9 = getelementptr inbounds [15 x i8]* %0, i64 0, i64 6
store i8 32, i8* %9, align 1
%10 = getelementptr inbounds [15 x i8]* %0, i64 0, i64 7
store i8 53, i8* %10, align 1
%11 = getelementptr inbounds [15 x i8]* %0, i64 0, i64 8
store i8 49, i8* %11, align 1
%12 = getelementptr inbounds [15 x i8]* %0, i64 0, i64 9
store i8 50, i8* %12, align 1
%13 = getelementptr inbounds [15 x i8]* %0, i64 0, i64 10
store i8 32, i8* %13, align 1
%14 = getelementptr inbounds [15 x i8]* %0, i64 0, i64 11
store i8 50, i8* %14, align 1
%15 = getelementptr inbounds [15 x i8]* %0, i64 0, i64 12
store i8 53, i8* %15, align 1
%16 = getelementptr inbounds [15 x i8]* %0, i64 0, i64 13
store i8 53, i8* %16, align 1
%17 = getelementptr inbounds [15 x i8]* %0, i64 0, i64 14
store i8 32, i8* %17, align 1
%18 = call i64 @write(i32 1, i8* %.sub, i64 15)
%19 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 0
%20 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 1
%21 = getelementptr inbounds %struct.Vec* %2, i64 0, i32 2
%dir.sroa.0.0.idx = getelementptr inbounds %struct.Vec* %__self22, i64 0, i32 0
%dir.sroa.2.0.idx141 = getelementptr inbounds %struct.Vec* %__self22, i64 0, i32 1
%dir.sroa.3.0.idx142 = getelementptr inbounds %struct.Vec* %__self22, i64 0, i32 2
%.idx22 = getelementptr %struct.Vec* %1, i64 0, i32 0
%.idx23 = getelementptr %struct.Vec* %1, i64 0, i32 1
%.idx24 = getelementptr %struct.Vec* %1, i64 0, i32 2
%22 = getelementptr inbounds [3 x i8]* %3, i64 0, i64 0
%23 = getelementptr inbounds [3 x i8]* %3, i64 0, i64 1
%24 = getelementptr inbounds [3 x i8]* %3, i64 0, i64 2
br label %"while loop cond9.preheader"
"while next": ; preds = %"while next7"
ret void
"while loop cond9.preheader": ; preds = %"function top level", %"while next7"
%y.0224 = phi i64 [ 511, %"function top level" ], [ %26, %"while next7" ]
%25 = sitofp i64 %y.0224 to float
br label %"while loop body10"
"while next7": ; preds = %"while next11"
%26 = add i64 %y.0224, -1
%27 = icmp sgt i64 %26, -1
br i1 %27, label %"while loop cond9.preheader", label %"while next"
"while loop body10": ; preds = %"while loop cond9.preheader", %"while next11"
%x.0223 = phi i64 [ 511, %"while loop cond9.preheader" ], [ %33, %"while next11" ]
%28 = sitofp i64 %x.0223 to float
br label %"while loop body14"
"while next11": ; preds = %"while loop body14"
%29 = fptoui float %97 to i8
store i8 %29, i8* %22, align 1
%30 = fptoui float %98 to i8
store i8 %30, i8* %23, align 1
%31 = fptoui float %99 to i8
store i8 %31, i8* %24, align 1
%32 = call i64 @write(i32 1, i8* %22, i64 3)
%33 = add i64 %x.0223, -1
%34 = icmp sgt i64 %33, -1
br i1 %34, label %"while loop body10", label %"while next7"
"while loop body14": ; preds = %"while loop body10", %"while loop body14"
%r.0222 = phi i64 [ 63, %"while loop body10" ], [ %100, %"while loop body14" ]
%p.sroa.0.0.load216221 = phi float [ 1.300000e+01, %"while loop body10" ], [ %97, %"while loop body14" ]
%p.sroa.4.4.load217220 = phi float [ 1.300000e+01, %"while loop body10" ], [ %98, %"while loop body14" ]
%p.sroa.8.8.load218219 = phi float [ 1.300000e+01, %"while loop body10" ], [ %99, %"while loop body14" ]
%35 = tail call i32 @rand()
%36 = sitofp i32 %35 to float
%37 = fmul float %36, 0x3E00000000000000
%38 = fadd float %37, -5.000000e-01
%39 = fmul float %38, 9.900000e+01
%40 = fmul float %39, 0x3F5EFCFE80000000
%41 = fmul float %39, 0xBF454DEF00000000
%42 = fmul float %39, 0.000000e+00
%43 = tail call i32 @rand()
%44 = sitofp i32 %43 to float
%45 = fmul float %44, 0x3E00000000000000
%46 = fadd float %45, -5.000000e-01
%47 = fmul float %46, 9.900000e+01
%48 = fmul float %47, 0.000000e+00
%49 = fmul float %47, 0x3F60624DE0000000
%50 = fadd float %40, %48
%51 = fadd float %41, %48
%52 = fadd float %42, %49
%53 = fmul float %50, -1.000000e+00
%54 = fmul float %51, -1.000000e+00
%55 = fmul float %52, -1.000000e+00
%56 = tail call i32 @rand()
%57 = sitofp i32 %56 to float
%58 = fmul float %57, 0x3E00000000000000
%59 = fadd float %28, %58
%60 = fmul float %59, 0x3F5EFCFE80000000
%61 = fmul float %59, 0xBF454DEF00000000
%62 = fmul float %59, 0.000000e+00
%63 = tail call i32 @rand()
%64 = sitofp i32 %63 to float
%65 = fmul float %64, 0x3E00000000000000
%66 = fadd float %25, %65
%67 = fmul float %66, 0.000000e+00
%68 = fmul float %66, 0x3F60624DE0000000
%69 = fadd float %67, 0xBFE9E58D00000000
%70 = fadd float %67, 0xBFE8EF94C0000000
%71 = fadd float %68, 0xBFE0624DE0000000
%72 = fadd float %60, %69
%73 = fadd float %61, %70
%74 = fadd float %62, %71
%75 = fmul float %72, 1.600000e+01
%76 = fmul float %73, 1.600000e+01
%77 = fmul float %74, 1.600000e+01
%78 = fadd float %53, %75
%79 = fadd float %54, %76
%80 = fadd float %55, %77
%81 = fmul float %78, %78
%82 = fmul float %79, %79
%83 = fadd float %81, %82
%84 = fmul float %80, %80
%85 = fadd float %84, %83
%86 = tail call float @llvm.sqrt.f32(float %85) #0
%87 = fdiv float 1.000000e+00, %86
%88 = fmul float %87, %78
%89 = fmul float %87, %79
%90 = fmul float %87, %80
%91 = fadd float %50, 1.700000e+01
%92 = fadd float %51, 1.600000e+01
%93 = fadd float %52, 8.000000e+00
store float %91, float* %19, align 8
store float %92, float* %20, align 4
store float %93, float* %21, align 8
store float %88, float* %dir.sroa.0.0.idx, align 8
store float %89, float* %dir.sroa.2.0.idx141, align 4
store float %90, float* %dir.sroa.3.0.idx142, align 8
call fastcc void @S(%struct.Vec* sret %1, %struct.Vec* %2, %struct.Vec* %__self22)
%.idx22.val = load float* %.idx22, align 8
%.idx23.val = load float* %.idx23, align 4
%.idx24.val = load float* %.idx24, align 8
%94 = fmul float %.idx22.val, 3.500000e+00
%95 = fmul float %.idx23.val, 3.500000e+00
%96 = fmul float %.idx24.val, 3.500000e+00
%97 = fadd float %p.sroa.0.0.load216221, %94
%98 = fadd float %p.sroa.4.4.load217220, %95
%99 = fadd float %p.sroa.8.8.load218219, %96
%100 = add i64 %r.0222, -1
%101 = icmp sgt i64 %100, -1
br i1 %101, label %"while loop body14", label %"while next11"
}
define i64 @main(i64, i8** nocapture readnone) {
top:
tail call fastcc void @_ZN4main18h2588239c84f92dbab4v0.0E()
ret i64 0
}
attributes #0 = { nounwind }
attributes #1 = { nounwind readonly }
attributes #2 = { nounwind uwtable }
attributes #3 = { uwtable }
attributes #4 = { noinline uwtable "fixed-stack-segment" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment