Default target found: x86 valist.sizeof = 4 Generating module: dotproduct Ignoring Dsymbol::toObjFile for object StructDeclaration::toObjFile(0): vec3 VarDeclaration::toObjFile(): x | float Aggregate var declaration: 'x' offset=0 const default initializer for float RealExp::toConstElem: nan | float field init is: float 0x7FF8000000000000 type should be float VarDeclaration::toObjFile is done VarDeclaration::toObjFile(): y | float Aggregate var declaration: 'y' offset=4 const default initializer for float RealExp::toConstElem: nan | float field init is: float 0x7FF8000000000000 type should be float VarDeclaration::toObjFile is done VarDeclaration::toObjFile(): z | float Aggregate var declaration: 'z' offset=8 const default initializer for float RealExp::toConstElem: nan | float field init is: float 0x7FF8000000000000 type should be float VarDeclaration::toObjFile is done FuncDeclaration::toObjFile(this): dot isMember = this is: vec3 this llvm type: opaque opaque param queueing dot FuncDeclaration::toObjFile(this): print isMember = this is: vec3 this llvm type: opaque struct param queueing print Not zero initialized { float, float, float } Type: float Value: float 0x7FF8000000000000 Type: float Value: float 0x7FF8000000000000 Type: float Value: float 0x7FF8000000000000 Initializer printed uses this CompoundStatement::toIR(0): <<< return (this.x) * *(&v + 0) + (this.y) * *(&v + 4) + (this.z) * *(&v + 8); >>> ReturnStatement::toIR(0): return (this.x) * *(&v + 0) + (this.y) * *(&v + 4) + (this.z) * *(&v + 8); return type is: float AddExp::toElem: (this.x) * *(&v + 0) + (this.y) * *(&v + 4) + (this.z) * *(&v + 8) | float AddExp::toElem: (this.x) * *(&v + 0) + (this.y) * *(&v + 4) | float MulExp::toElem: (this.x) * *(&v + 0) DotVarExp::toElem: this.x | float ThisExp::toElem: this | vec3 * e1->type=vec3 * checking for offset 0 type float: found 0 type float Struct member offset:0 src: %"10dotproduct4vec3"* %this indices for '%"10dotproduct4vec3"* %this': 0 1 mem: %tmp = getelementptr %"10dotproduct4vec3"* %this, i32 0, i32 0 ; [#uses=0] PtrExp::toElem: *(&v + 0) | float AddExp::toElem: &v + 0 | float* AddrExp::toElem: &v | vec3 * VarExp::toElem: v | vec3 VarDeclaration v function param IntegerExp::toElem: 0 | int IntegerExp::toConstElem: 0 | int checking for offset 0 type float: found 0 type float indices for '%"10dotproduct4vec3"* %v': 0 1 mem: %tmp1 = getelementptr %"10dotproduct4vec3"* %v, i32 0, i32 0 ; [#uses=0] mul: %tmp2 = load float* %tmp ; [#uses=0] , %tmp3 = load float* %tmp1 ; [#uses=0] MulExp::toElem: (this.y) * *(&v + 4) DotVarExp::toElem: this.y | float ThisExp::toElem: this | vec3 * e1->type=vec3 * checking for offset 4 type float: found 0 type float found 4 type float Struct member offset:4 src: %"10dotproduct4vec3"* %this indices for '%"10dotproduct4vec3"* %this': 0 1 mem: %tmp5 = getelementptr %"10dotproduct4vec3"* %this, i32 0, i32 1 ; [#uses=0] PtrExp::toElem: *(&v + 4) | float AddExp::toElem: &v + 4 | float* AddrExp::toElem: &v | vec3 * VarExp::toElem: v | vec3 VarDeclaration v function param IntegerExp::toElem: 4 | int IntegerExp::toConstElem: 4 | int checking for offset 4 type float: found 0 type float found 4 type float indices for '%"10dotproduct4vec3"* %v': 0 1 mem: %tmp6 = getelementptr %"10dotproduct4vec3"* %v, i32 0, i32 1 ; [#uses=0] mul: %tmp7 = load float* %tmp5 ; [#uses=0] , %tmp8 = load float* %tmp6 ; [#uses=0] MulExp::toElem: (this.z) * *(&v + 8) DotVarExp::toElem: this.z | float ThisExp::toElem: this | vec3 * e1->type=vec3 * checking for offset 8 type float: found 0 type float found 4 type float found 8 type float Struct member offset:8 src: %"10dotproduct4vec3"* %this indices for '%"10dotproduct4vec3"* %this': 0 1 mem: %tmp11 = getelementptr %"10dotproduct4vec3"* %this, i32 0, i32 2 ; [#uses=0] PtrExp::toElem: *(&v + 8) | float AddExp::toElem: &v + 8 | float* AddrExp::toElem: &v | vec3 * VarExp::toElem: v | vec3 VarDeclaration v function param IntegerExp::toElem: 8 | int IntegerExp::toConstElem: 8 | int checking for offset 8 type float: found 0 type float found 4 type float found 8 type float indices for '%"10dotproduct4vec3"* %v': 0 1 mem: %tmp12 = getelementptr %"10dotproduct4vec3"* %v, i32 0, i32 2 ; [#uses=0] mul: %tmp13 = load float* %tmp11 ; [#uses=0] , %tmp14 = load float* %tmp12 ; [#uses=0] return value is ' %tmp16 = add float %tmp10, %tmp15 ; [#uses=0] ' uses this CompoundStatement::toIR(1): <<< printf("%.*s = vec3(%.4f, %.4f, %.4f)\x0a",(n.length),cast(char*)n,cast(double)(this.x),cast(double)(this.y),cast(double)(this.z)); >>> ExpStatement::toIR(0): printf("%.*s = vec3(%.4f, %.4f, %.4f)\x0a",(n.length),cast(char*)n,cast(double)(this.x),cast(double)(this.y),cast(double)(this.z)); CallExp::toElem: printf("%.*s = vec3(%.4f, %.4f, %.4f)\x0a",(n.length),cast(char*)n,cast(double)(this.x),cast(double)(this.y),cast(double)(this.z)) VarExp::toElem: printf | intC (char*,...) FuncDeclaration FuncDeclaration::toObjFile(static): printf in param doing normal arguments StringExp::toElem: "%.*s = vec3(%.4f, %.4f, %.4f)\x0a" | char* regular arg mem = i8 * getelementptr ([31 x i8]* @stringliteral, i32 0, i32 0) ArrayLengthExp::toElem: n.length | uint VarExp::toElem: n | char[] VarDeclaration n function param DtoGEP: { i32, i8* }* %n regular arg val = %tmp1 = load i32* %tmp ; [#uses=0] CastExp::toElem: cast(char*)n | char* VarExp::toElem: n | char[] VarDeclaration n function param from array or sarray to pointer DtoGEP: { i32, i8* }* %n regular arg mem = { i32, i8* }* %n val = %tmp3 = load i8** %tmp2 ; [#uses=0] CastExp::toElem: cast(double)(this.x) | double DotVarExp::toElem: this.x | float ThisExp::toElem: this | vec3 * e1->type=vec3 * checking for offset 0 type float: found 0 type float Struct member offset:0 src: %"10dotproduct4vec3"* %this indices for '%"10dotproduct4vec3"* %this': 0 1 mem: %tmp4 = getelementptr %"10dotproduct4vec3"* %this, i32 0, i32 0 ; [#uses=0] regular arg mem = %tmp4 = getelementptr %"10dotproduct4vec3"* %this, i32 0, i32 0 ; [#uses=1] val = %tmp6 = fpext float %tmp5 to double ; [#uses=0] CastExp::toElem: cast(double)(this.y) | double DotVarExp::toElem: this.y | float ThisExp::toElem: this | vec3 * e1->type=vec3 * checking for offset 4 type float: found 0 type float found 4 type float Struct member offset:4 src: %"10dotproduct4vec3"* %this indices for '%"10dotproduct4vec3"* %this': 0 1 mem: %tmp7 = getelementptr %"10dotproduct4vec3"* %this, i32 0, i32 1 ; [#uses=0] regular arg mem = %tmp7 = getelementptr %"10dotproduct4vec3"* %this, i32 0, i32 1 ; [#uses=1] val = %tmp9 = fpext float %tmp8 to double ; [#uses=0] CastExp::toElem: cast(double)(this.z) | double DotVarExp::toElem: this.z | float ThisExp::toElem: this | vec3 * e1->type=vec3 * checking for offset 8 type float: found 0 type float found 4 type float found 8 type float Struct member offset:8 src: %"10dotproduct4vec3"* %this indices for '%"10dotproduct4vec3"* %this': 0 1 mem: %tmp10 = getelementptr %"10dotproduct4vec3"* %this, i32 0, i32 2 ; [#uses=0] regular arg mem = %tmp10 = getelementptr %"10dotproduct4vec3"* %this, i32 0, i32 2 ; [#uses=1] val = %tmp12 = fpext float %tmp11 to double ; [#uses=0] 6 params passed i8 * getelementptr ([31 x i8]* @stringliteral, i32 0, i32 0) %tmp1 = load i32* %tmp ; [#uses=0] %tmp3 = load i8** %tmp2 ; [#uses=0] %tmp6 = fpext float %tmp5 to double ; [#uses=0] %tmp9 = fpext float %tmp8 to double ; [#uses=0] %tmp12 = fpext float %tmp11 to double ; [#uses=0] Calling: i32 (i8 *, ...) * FuncDeclaration::toObjFile(static): main CompoundStatement::toIR(2): <<< printf("Dot Product test\x0a"); const static float f = 0xb.504f333f9de6p-4F; vec3 v = v = (vec3(0xb.504f333f9de6p-4F,0xb.504f333f9de6p-4F,0F)); vec3 w = w = (vec3(0xb.504f333f9de6p-4F,0F,0xb.504f333f9de6p-4F)); (v.print)("v"); (v.print)("w"); float dp = dp = (v.dot)(w); printf("v \xc2\xb7 w = %f\x0a",cast(double)dp); assert(cast(double)dp > 0.4999 && cast(double)dp < 0.5001); printf(" SUCCESS\x0a"); return 0; >>> CompoundStatement::toIR(3): <<< printf("Dot Product test\x0a"); const static float f = 0xb.504f333f9de6p-4F; vec3 v = v = (vec3(0xb.504f333f9de6p-4F,0xb.504f333f9de6p-4F,0F)); vec3 w = w = (vec3(0xb.504f333f9de6p-4F,0F,0xb.504f333f9de6p-4F)); (v.print)("v"); (v.print)("w"); float dp = dp = (v.dot)(w); printf("v \xc2\xb7 w = %f\x0a",cast(double)dp); assert(cast(double)dp > 0.4999 && cast(double)dp < 0.5001); printf(" SUCCESS\x0a"); return 0; >>> ExpStatement::toIR(1): printf("Dot Product test\x0a"); CallExp::toElem: printf("Dot Product test\x0a") VarExp::toElem: printf | intC (char*,...) FuncDeclaration doing normal arguments StringExp::toElem: "Dot Product test\x0a" | char* regular arg mem = i8 * getelementptr ([18 x i8]* @stringliteral1, i32 0, i32 0) 1 params passed i8 * getelementptr ([18 x i8]* @stringliteral1, i32 0, i32 0) Calling: i32 (i8 *, ...) * ExpStatement::toIR(2): const static float f = 0xb.504f333f9de6p-4F; DeclarationExp::toElem: const static float f = 0xb.504f333f9de6p-4F; | T=void VarDeclaration VarDeclaration::toObjFile(): f | float Creating global variable const expression initializer RealExp::toConstElem: 0.707107 | float final init = float 0x3FE6A09E60000000 VarDeclaration::toObjFile is done ExpStatement::toIR(3): vec3 v = v = (vec3(0xb.504f333f9de6p-4F,0xb.504f333f9de6p-4F,0F)); DeclarationExp::toElem: vec3 v = v = (vec3(0xb.504f333f9de6p-4F,0xb.504f333f9de6p-4F,0F)); | T=void VarDeclaration vdtype = vec3 expression initializer AssignExp::toElem: v = (vec3(0xb.504f333f9de6p-4F,0xb.504f333f9de6p-4F,0F)) | vec3 = vec3 VarExp::toElem: v | vec3 VarDeclaration v StructLiteralExp::toElem: vec3(0xb.504f333f9de6p-4F,0xb.504f333f9de6p-4F,0F) | vec3 DtoGEP: %v = alloca %"10dotproduct4vec3" ; <%"10dotproduct4vec3"*> [#uses=0] RealExp::toElem: 0.707107 | float RealExp::toConstElem: 0.707107 | float float 0x3FE6A09E60000000 | %tmp1 = getelementptr %"10dotproduct4vec3"* %v, i32 0, i32 0 ; [#uses=0] assignment: %tmp1 = getelementptr %"10dotproduct4vec3"* %v, i32 0, i32 0 ; [#uses=0] float 0x3FE6A09E60000000 DtoGEP: %v = alloca %"10dotproduct4vec3" ; <%"10dotproduct4vec3"*> [#uses=1] RealExp::toElem: 0.707107 | float RealExp::toConstElem: 0.707107 | float float 0x3FE6A09E60000000 | %tmp2 = getelementptr %"10dotproduct4vec3"* %v, i32 0, i32 1 ; [#uses=0] assignment: %tmp2 = getelementptr %"10dotproduct4vec3"* %v, i32 0, i32 1 ; [#uses=0] float 0x3FE6A09E60000000 DtoGEP: %v = alloca %"10dotproduct4vec3" ; <%"10dotproduct4vec3"*> [#uses=2] RealExp::toElem: 0 | float RealExp::toConstElem: 0 | float float 0.000000e+00 | %tmp3 = getelementptr %"10dotproduct4vec3"* %v, i32 0, i32 2 ; [#uses=0] assignment: %tmp3 = getelementptr %"10dotproduct4vec3"* %v, i32 0, i32 2 ; [#uses=0] float 0.000000e+00 ExpStatement::toIR(4): vec3 w = w = (vec3(0xb.504f333f9de6p-4F,0F,0xb.504f333f9de6p-4F)); DeclarationExp::toElem: vec3 w = w = (vec3(0xb.504f333f9de6p-4F,0F,0xb.504f333f9de6p-4F)); | T=void VarDeclaration vdtype = vec3 expression initializer AssignExp::toElem: w = (vec3(0xb.504f333f9de6p-4F,0F,0xb.504f333f9de6p-4F)) | vec3 = vec3 VarExp::toElem: w | vec3 VarDeclaration w StructLiteralExp::toElem: vec3(0xb.504f333f9de6p-4F,0F,0xb.504f333f9de6p-4F) | vec3 DtoGEP: %w = alloca %"10dotproduct4vec3" ; <%"10dotproduct4vec3"*> [#uses=0] RealExp::toElem: 0.707107 | float RealExp::toConstElem: 0.707107 | float float 0x3FE6A09E60000000 | %tmp4 = getelementptr %"10dotproduct4vec3"* %w, i32 0, i32 0 ; [#uses=0] assignment: %tmp4 = getelementptr %"10dotproduct4vec3"* %w, i32 0, i32 0 ; [#uses=0] float 0x3FE6A09E60000000 DtoGEP: %w = alloca %"10dotproduct4vec3" ; <%"10dotproduct4vec3"*> [#uses=1] RealExp::toElem: 0 | float RealExp::toConstElem: 0 | float float 0.000000e+00 | %tmp5 = getelementptr %"10dotproduct4vec3"* %w, i32 0, i32 1 ; [#uses=0] assignment: %tmp5 = getelementptr %"10dotproduct4vec3"* %w, i32 0, i32 1 ; [#uses=0] float 0.000000e+00 DtoGEP: %w = alloca %"10dotproduct4vec3" ; <%"10dotproduct4vec3"*> [#uses=2] RealExp::toElem: 0.707107 | float RealExp::toConstElem: 0.707107 | float float 0x3FE6A09E60000000 | %tmp6 = getelementptr %"10dotproduct4vec3"* %w, i32 0, i32 2 ; [#uses=0] assignment: %tmp6 = getelementptr %"10dotproduct4vec3"* %w, i32 0, i32 2 ; [#uses=0] float 0x3FE6A09E60000000 ExpStatement::toIR(5): (v.print)("v"); CallExp::toElem: (v.print)("v") DotVarExp::toElem: v.print | void(char[] n) VarExp::toElem: v | vec3 VarDeclaration v e1->type=vec3 This Call doing normal arguments StringExp::toElem: "v" | char[] LLVM_DtoSetArray( %tmp7 = alloca { i32, i8* } ; <{ i32, i8* }*> [#uses=0] , i32 1, i8 * getelementptr ([2 x i8]* @stringliteral2, i32 0, i32 0)) DtoGEP: %tmp7 = alloca { i32, i8* } ; <{ i32, i8* }*> [#uses=0] DtoGEP: %tmp7 = alloca { i32, i8* } ; <{ i32, i8* }*> [#uses=1] 2 params passed %v = alloca %"10dotproduct4vec3" ; <%"10dotproduct4vec3"*> [#uses=3] %tmpparam = alloca { i32, i8* } ; <{ i32, i8* }*> [#uses=2] Calling: void ({ float, float, float } *, { i32, i8 * } *) * ExpStatement::toIR(6): (v.print)("w"); CallExp::toElem: (v.print)("w") DotVarExp::toElem: v.print | void(char[] n) VarExp::toElem: v | vec3 VarDeclaration v e1->type=vec3 This Call doing normal arguments StringExp::toElem: "w" | char[] LLVM_DtoSetArray( %tmp16 = alloca { i32, i8* } ; <{ i32, i8* }*> [#uses=0] , i32 1, i8 * getelementptr ([2 x i8]* @stringliteral3, i32 0, i32 0)) DtoGEP: %tmp16 = alloca { i32, i8* } ; <{ i32, i8* }*> [#uses=0] DtoGEP: %tmp16 = alloca { i32, i8* } ; <{ i32, i8* }*> [#uses=1] 2 params passed %v = alloca %"10dotproduct4vec3" ; <%"10dotproduct4vec3"*> [#uses=4] %tmpparam19 = alloca { i32, i8* } ; <{ i32, i8* }*> [#uses=2] Calling: void ({ float, float, float } *, { i32, i8 * } *) * ExpStatement::toIR(7): float dp = dp = (v.dot)(w); DeclarationExp::toElem: float dp = dp = (v.dot)(w); | T=void VarDeclaration vdtype = float expression initializer AssignExp::toElem: dp = (v.dot)(w) | float = float VarExp::toElem: dp | float VarDeclaration dp CallExp::toElem: (v.dot)(w) DotVarExp::toElem: v.dot | float(ref vec3 v) VarExp::toElem: v | vec3 VarDeclaration v e1->type=vec3 This Call doing normal arguments VarExp::toElem: w | vec3 VarDeclaration w 2 params passed %v = alloca %"10dotproduct4vec3" ; <%"10dotproduct4vec3"*> [#uses=5] %w = alloca %"10dotproduct4vec3" ; <%"10dotproduct4vec3"*> [#uses=3] Calling: float ({ float, float, float } *, { float, float, float } *) * %dp = alloca float ; [#uses=0] ExpStatement::toIR(8): printf("v \xc2\xb7 w = %f\x0a",cast(double)dp); CallExp::toElem: printf("v \xc2\xb7 w = %f\x0a",cast(double)dp) VarExp::toElem: printf | intC (char*,...) FuncDeclaration doing normal arguments StringExp::toElem: "v \xc2\xb7 w = %f\x0a" | char* regular arg mem = i8 * getelementptr ([13 x i8]* @stringliteral4, i32 0, i32 0) CastExp::toElem: cast(double)dp | double VarExp::toElem: dp | float VarDeclaration dp regular arg mem = %dp = alloca float ; [#uses=2] val = %tmp28 = fpext float %tmp27 to double ; [#uses=0] 2 params passed i8 * getelementptr ([13 x i8]* @stringliteral4, i32 0, i32 0) %tmp28 = fpext float %tmp27 to double ; [#uses=0] Calling: i32 (i8 *, ...) * ExpStatement::toIR(9): assert(cast(double)dp > 0.4999 && cast(double)dp < 0.5001); AssertExp::toElem: assert(cast(double)dp > 0.4999 && cast(double)dp < 0.5001) | void AndAndExp::toElem: cast(double)dp > 0.4999 && cast(double)dp < 0.5001 | bool CmpExp::toElem: cast(double)dp > 0.4999 | bool CastExp::toElem: cast(double)dp | double VarExp::toElem: dp | float VarDeclaration dp RealExp::toElem: 0.4999 | double RealExp::toConstElem: 0.4999 | double CmpExp::toElem: cast(double)dp < 0.5001 | bool CastExp::toElem: cast(double)dp | double VarExp::toElem: dp | float VarDeclaration dp RealExp::toElem: 0.5001 | double RealExp::toConstElem: 0.5001 | double *** Loading D runtime *** ExpStatement::toIR(10): printf(" SUCCESS\x0a"); CallExp::toElem: printf(" SUCCESS\x0a") VarExp::toElem: printf | intC (char*,...) FuncDeclaration doing normal arguments StringExp::toElem: " SUCCESS\x0a" | char* regular arg mem = i8 * getelementptr ([11 x i8]* @stringliteral5, i32 0, i32 0) 1 params passed i8 * getelementptr ([11 x i8]* @stringliteral5, i32 0, i32 0) Calling: i32 (i8 *, ...) * ReturnStatement::toIR(1): return 0; return type is: int IntegerExp::toElem: 0 | int IntegerExp::toConstElem: 0 | int return value is ' i32 0' Verifying module... Verification passed! Writing LLVM bitcode *** Freeing D runtime *** ; ModuleID = 'test/dotproduct.bc' target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:8" target triple = "i686-unknown-linux-gnu" %"10dotproduct4vec3" = type { float, float, float } @"10dotproduct4vec3__initZ" = constant %"10dotproduct4vec3" { float 0x7FF8000000000000, float 0x7FF8000000000000, float 0x7FF8000000000000 } ; <%"10dotproduct4vec3"*> [#uses=0] @stringliteral = internal constant [31 x i8] c"%.*s = vec3(%.4f, %.4f, %.4f)\0A\00" ; <[31 x i8]*> [#uses=1] @stringliteral1 = internal constant [18 x i8] c"Dot Product test\0A\00" ; <[18 x i8]*> [#uses=1] @_D10dotproduct4mainFZi1ff = internal constant float 0x3FE6A09E60000000 ; [#uses=0] @stringliteral2 = internal constant [2 x i8] c"v\00" ; <[2 x i8]*> [#uses=1] @stringliteral3 = internal constant [2 x i8] c"w\00" ; <[2 x i8]*> [#uses=1] @stringliteral4 = internal constant [13 x i8] c"v \C2\B7 w = %f\0A\00" ; <[13 x i8]*> [#uses=1] @stringliteral5 = internal constant [11 x i8] c" SUCCESS\0A\00" ; <[11 x i8]*> [#uses=1] define fastcc float @_D10dotproduct4vec33dotMFKS10dotproduct4vec3Zf(%"10dotproduct4vec3"* %this, %"10dotproduct4vec3"* %v) { entry: %tmp = getelementptr %"10dotproduct4vec3"* %this, i32 0, i32 0 ; [#uses=1] %tmp1 = getelementptr %"10dotproduct4vec3"* %v, i32 0, i32 0 ; [#uses=1] %tmp2 = load float* %tmp ; [#uses=1] %tmp3 = load float* %tmp1 ; [#uses=1] %tmp4 = mul float %tmp2, %tmp3 ; [#uses=1] %tmp5 = getelementptr %"10dotproduct4vec3"* %this, i32 0, i32 1 ; [#uses=1] %tmp6 = getelementptr %"10dotproduct4vec3"* %v, i32 0, i32 1 ; [#uses=1] %tmp7 = load float* %tmp5 ; [#uses=1] %tmp8 = load float* %tmp6 ; [#uses=1] %tmp9 = mul float %tmp7, %tmp8 ; [#uses=1] %tmp10 = add float %tmp4, %tmp9 ; [#uses=1] %tmp11 = getelementptr %"10dotproduct4vec3"* %this, i32 0, i32 2 ; [#uses=1] %tmp12 = getelementptr %"10dotproduct4vec3"* %v, i32 0, i32 2 ; [#uses=1] %tmp13 = load float* %tmp11 ; [#uses=1] %tmp14 = load float* %tmp12 ; [#uses=1] %tmp15 = mul float %tmp13, %tmp14 ; [#uses=1] %tmp16 = add float %tmp10, %tmp15 ; [#uses=1] ret float %tmp16 } define fastcc void @_D10dotproduct4vec35printMFAaZv(%"10dotproduct4vec3"* %this, { i32, i8* }* %n) { entry: %tmp = getelementptr { i32, i8* }* %n, i32 0, i32 0 ; [#uses=1] %tmp1 = load i32* %tmp ; [#uses=1] %tmp2 = getelementptr { i32, i8* }* %n, i32 0, i32 1 ; [#uses=1] %tmp3 = load i8** %tmp2 ; [#uses=1] %tmp4 = getelementptr %"10dotproduct4vec3"* %this, i32 0, i32 0 ; [#uses=1] %tmp5 = load float* %tmp4 ; [#uses=1] %tmp6 = fpext float %tmp5 to double ; [#uses=1] %tmp7 = getelementptr %"10dotproduct4vec3"* %this, i32 0, i32 1 ; [#uses=1] %tmp8 = load float* %tmp7 ; [#uses=1] %tmp9 = fpext float %tmp8 to double ; [#uses=1] %tmp10 = getelementptr %"10dotproduct4vec3"* %this, i32 0, i32 2 ; [#uses=1] %tmp11 = load float* %tmp10 ; [#uses=1] %tmp12 = fpext float %tmp11 to double ; [#uses=1] %tmp13 = call i32 (i8*, ...)* @printf( i8* getelementptr ([31 x i8]* @stringliteral, i32 0, i32 0), i32 %tmp1, i8* %tmp3, double %tmp6, double %tmp9, double %tmp12 ) ; [#uses=0] ret void } declare i32 @printf(i8*, ...) define fastcc i32 @_Dmain() { entry: %v = alloca %"10dotproduct4vec3" ; <%"10dotproduct4vec3"*> [#uses=6] %w = alloca %"10dotproduct4vec3" ; <%"10dotproduct4vec3"*> [#uses=4] %tmp7 = alloca { i32, i8* } ; <{ i32, i8* }*> [#uses=4] %tmpparam = alloca { i32, i8* } ; <{ i32, i8* }*> [#uses=3] %tmp16 = alloca { i32, i8* } ; <{ i32, i8* }*> [#uses=4] %tmpparam19 = alloca { i32, i8* } ; <{ i32, i8* }*> [#uses=3] %dp = alloca float ; [#uses=4] %andandtmp = alloca i1 ; [#uses=3] %tmp = call i32 (i8*, ...)* @printf( i8* getelementptr ([18 x i8]* @stringliteral1, i32 0, i32 0) ) ; [#uses=0] %tmp1 = getelementptr %"10dotproduct4vec3"* %v, i32 0, i32 0 ; [#uses=1] store float 0x3FE6A09E60000000, float* %tmp1 %tmp2 = getelementptr %"10dotproduct4vec3"* %v, i32 0, i32 1 ; [#uses=1] store float 0x3FE6A09E60000000, float* %tmp2 %tmp3 = getelementptr %"10dotproduct4vec3"* %v, i32 0, i32 2 ; [#uses=1] store float 0.000000e+00, float* %tmp3 %tmp4 = getelementptr %"10dotproduct4vec3"* %w, i32 0, i32 0 ; [#uses=1] store float 0x3FE6A09E60000000, float* %tmp4 %tmp5 = getelementptr %"10dotproduct4vec3"* %w, i32 0, i32 1 ; [#uses=1] store float 0.000000e+00, float* %tmp5 %tmp6 = getelementptr %"10dotproduct4vec3"* %w, i32 0, i32 2 ; [#uses=1] store float 0x3FE6A09E60000000, float* %tmp6 %tmp8 = getelementptr { i32, i8* }* %tmp7, i32 0, i32 0 ; [#uses=1] store i32 1, i32* %tmp8 %tmp9 = getelementptr { i32, i8* }* %tmp7, i32 0, i32 1 ; [#uses=1] store i8* getelementptr ([2 x i8]* @stringliteral2, i32 0, i32 0), i8** %tmp9 %tmp10 = getelementptr { i32, i8* }* %tmp7, i32 0, i32 0 ; [#uses=1] %tmp11 = load i32* %tmp10 ; [#uses=1] %tmp12 = getelementptr { i32, i8* }* %tmpparam, i32 0, i32 0 ; [#uses=1] store i32 %tmp11, i32* %tmp12 %tmp13 = getelementptr { i32, i8* }* %tmp7, i32 0, i32 1 ; [#uses=1] %tmp14 = load i8** %tmp13 ; [#uses=1] %tmp15 = getelementptr { i32, i8* }* %tmpparam, i32 0, i32 1 ; [#uses=1] store i8* %tmp14, i8** %tmp15 call void @_D10dotproduct4vec35printMFAaZv( %"10dotproduct4vec3"* %v, { i32, i8* }* %tmpparam ) %tmp17 = getelementptr { i32, i8* }* %tmp16, i32 0, i32 0 ; [#uses=1] store i32 1, i32* %tmp17 %tmp18 = getelementptr { i32, i8* }* %tmp16, i32 0, i32 1 ; [#uses=1] store i8* getelementptr ([2 x i8]* @stringliteral3, i32 0, i32 0), i8** %tmp18 %tmp20 = getelementptr { i32, i8* }* %tmp16, i32 0, i32 0 ; [#uses=1] %tmp21 = load i32* %tmp20 ; [#uses=1] %tmp22 = getelementptr { i32, i8* }* %tmpparam19, i32 0, i32 0 ; [#uses=1] store i32 %tmp21, i32* %tmp22 %tmp23 = getelementptr { i32, i8* }* %tmp16, i32 0, i32 1 ; [#uses=1] %tmp24 = load i8** %tmp23 ; [#uses=1] %tmp25 = getelementptr { i32, i8* }* %tmpparam19, i32 0, i32 1 ; [#uses=1] store i8* %tmp24, i8** %tmp25 call void @_D10dotproduct4vec35printMFAaZv( %"10dotproduct4vec3"* %v, { i32, i8* }* %tmpparam19 ) %tmp26 = call float @_D10dotproduct4vec33dotMFKS10dotproduct4vec3Zf( %"10dotproduct4vec3"* %v, %"10dotproduct4vec3"* %w ) ; [#uses=1] store float %tmp26, float* %dp %tmp27 = load float* %dp ; [#uses=1] %tmp28 = fpext float %tmp27 to double ; [#uses=1] %tmp29 = call i32 (i8*, ...)* @printf( i8* getelementptr ([13 x i8]* @stringliteral4, i32 0, i32 0), double %tmp28 ) ; [#uses=0] %tmp30 = load float* %dp ; [#uses=1] %tmp31 = fpext float %tmp30 to double ; [#uses=1] %tmp32 = fcmp ogt double %tmp31, 4.999000e-01 ; [#uses=3] store i1 %tmp32, i1* %andandtmp br i1 %tmp32, label %andand, label %andandend andand: ; preds = %entry %tmp33 = load float* %dp ; [#uses=1] %tmp34 = fpext float %tmp33 to double ; [#uses=1] %tmp35 = fcmp olt double %tmp34, 5.001000e-01 ; [#uses=1] %tmp36 = and i1 %tmp32, %tmp35 ; [#uses=1] store i1 %tmp36, i1* %andandtmp br label %andandend andandend: ; preds = %andand, %entry %tmp37 = load i1* %andandtmp ; [#uses=1] call void @_d_assert( i1 %tmp37, i32 29, i8* null ) %tmp38 = call i32 (i8*, ...)* @printf( i8* getelementptr ([11 x i8]* @stringliteral5, i32 0, i32 0) ) ; [#uses=0] ret i32 0 } declare void @_d_assert(i1, i32, i8*) define i32 @main(i32, i8**, i8**) { entry: call void @_d_run_module_ctors( ) %ret = call fastcc i32 @_Dmain( ) ; [#uses=1] call void @_d_run_module_dtors( ) ret i32 %ret } declare void @_d_run_module_ctors() declare void @_d_run_module_dtors() llvmdc test/dotproduct.d -Itest -odtest -vv -c llvm-dis -f test/dotproduct.bc