; ModuleID = 'input.cl' source_filename = "input.cl" target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-A5" target triple = "r600--" %struct.mwc64x_state_t = type { i32, i32 } @WaveletDenoise.noise = private unnamed_addr addrspace(4) constant [8 x float] [float 0x3FE99B3D00000000, float 0x3FD1810620000000, float 0x3FBEC56D60000000, float 0x3FADF3B640000000, float 0x3F9DCC6400000000, float 0x3F8F212D80000000, float 0x3F80624DE0000000, float 0x3F7205BC00000000], align 4 @WaveletDenoise.buffer = internal unnamed_addr addrspace(3) global [4096 x float] undef, align 4 @LOG_INV_TBL = linkonce_odr dso_local local_unnamed_addr addrspace(4) constant [129 x float] [float 2.000000e+00, float 0x3FFFC07F00000000, float 0x3FFF81F820000000, float 0x3FFF4465A0000000, float 0x3FFF07C200000000, float 0x3FFECC07C0000000, float 0x3FFE9131A0000000, float 0x3FFE573AC0000000, float 0x3FFE1E1E20000000, float 0x3FFDE5D6E0000000, float 0x3FFDAE6080000000, float 0x3FFD77B660000000, float 0x3FFD41D420000000, float 0x3FFD0CB580000000, float 0x3FFCD85680000000, float 0x3FFCA4B300000000, float 0x3FFC71C720000000, float 0x3FFC3F8F00000000, float 0x3FFC0E0700000000, float 0x3FFBDD2B80000000, float 0x3FFBACF920000000, float 0x3FFB7D6C40000000, float 0x3FFB4E81C0000000, float 0x3FFB203640000000, float 0x3FFAF286C0000000, float 0x3FFAC57020000000, float 0x3FFA98EF60000000, float 0x3FFA6D01A0000000, float 0x3FFA41A420000000, float 0x3FFA16D400000000, float 0x3FF9EC8EA0000000, float 0x3FF9C2D140000000, float 0x3FF99999A0000000, float 0x3FF970E500000000, float 0x3FF948B100000000, float 0x3FF920FB40000000, float 0x3FF8F9C180000000, float 0x3FF8D30180000000, float 0x3FF8ACB900000000, float 0x3FF886E600000000, float 0x3FF8618620000000, float 0x3FF83C9780000000, float 0x3FF8181820000000, float 0x3FF7F40600000000, float 0x3FF7D05F40000000, float 0x3FF7AD2200000000, float 0x3FF78A4C80000000, float 0x3FF767DCE0000000, float 0x3FF745D180000000, float 0x3FF7242880000000, float 0x3FF702E060000000, float 0x3FF6E1F760000000, float 0x3FF6C16C20000000, float 0x3FF6A13CE0000000, float 0x3FF6816820000000, float 0x3FF661EC60000000, float 0x3FF642C860000000, float 0x3FF623FA80000000, float 0x3FF6058160000000, float 0x3FF5E75BC0000000, float 0x3FF5C98820000000, float 0x3FF5AC0560000000, float 0x3FF58ED240000000, float 0x3FF571ED40000000, float 0x3FF5555560000000, float 0x3FF5390940000000, float 0x3FF51D07E0000000, float 0x3FF5015020000000, float 0x3FF4E5E0A0000000, float 0x3FF4CAB880000000, float 0x3FF4AFD6A0000000, float 0x3FF49539E0000000, float 0x3FF47AE140000000, float 0x3FF460CBC0000000, float 0x3FF446F860000000, float 0x3FF42D6620000000, float 0x3FF4141420000000, float 0x3FF3FB0140000000, float 0x3FF3E22CC0000000, float 0x3FF3C995A0000000, float 0x3FF3B13B20000000, float 0x3FF3991C20000000, float 0x3FF3813820000000, float 0x3FF3698E00000000, float 0x3FF3521D00000000, float 0x3FF33AE460000000, float 0x3FF323E340000000, float 0x3FF30D1900000000, float 0x3FF2F684C0000000, float 0x3FF2E025C0000000, float 0x3FF2C9FB40000000, float 0x3FF2B404A0000000, float 0x3FF29E4120000000, float 0x3FF288B020000000, float 0x3FF27350C0000000, float 0x3FF25E2280000000, float 0x3FF24924A0000000, float 0x3FF2345680000000, float 0x3FF21FB780000000, float 0x3FF20B4700000000, float 0x3FF1F70480000000, float 0x3FF1E2EF40000000, float 0x3FF1CF06A0000000, float 0x3FF1BB4A40000000, float 0x3FF1A7B960000000, float 0x3FF1945380000000, float 0x3FF1811820000000, float 0x3FF16E0680000000, float 0x3FF15B1E60000000, float 0x3FF1485F00000000, float 0x3FF135C820000000, float 0x3FF12358E0000000, float 0x3FF1111120000000, float 0x3FF0FEF020000000, float 0x3FF0ECF560000000, float 0x3FF0DB20A0000000, float 0x3FF0C97140000000, float 0x3FF0B7E6E0000000, float 0x3FF0A68100000000, float 0x3FF0953F40000000, float 0x3FF0842100000000, float 0x3FF0732600000000, float 0x3FF0624DE0000000, float 0x3FF0519800000000, float 0x3FF0410420000000, float 0x3FF03091C0000000, float 0x3FF0204080000000, float 0x3FF0101020000000, float 1.000000e+00], align 4 @LOG2_TBL = linkonce_odr dso_local local_unnamed_addr addrspace(4) constant [129 x <2 x float>] [<2 x float> zeroinitializer, <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> , <2 x float> ], align 8 ; Function Attrs: norecurse nounwind readnone define i64 @MWC_AddMod64(i64 %a, i64 %b, i64 %M) local_unnamed_addr #0 { entry: %add = add i64 %b, %a %cmp = icmp ult i64 %add, %M br i1 %cmp, label %lor.lhs.false, label %if.then lor.lhs.false: ; preds = %entry %0 = uitofp i64 %add to float %1 = uitofp i64 %a to float %cmp2 = fcmp olt float %0, %1 br i1 %cmp2, label %if.then, label %if.end if.then: ; preds = %entry, %lor.lhs.false %sub = sub i64 %add, %M br label %if.end if.end: ; preds = %if.then, %lor.lhs.false %v.0 = phi i64 [ %sub, %if.then ], [ %add, %lor.lhs.false ] ret i64 %v.0 } ; Function Attrs: argmemonly nounwind declare void @llvm.lifetime.start.p5i8(i64, i8 addrspace(5)* nocapture) #1 ; Function Attrs: argmemonly nounwind declare void @llvm.lifetime.end.p5i8(i64, i8 addrspace(5)* nocapture) #1 ; Function Attrs: norecurse nounwind readnone define i64 @MWC_MulMod64(i64 %a, i64 %b, i64 %M) local_unnamed_addr #0 { entry: %cmp17 = icmp eq i64 %a, 0 br i1 %cmp17, label %while.end, label %while.body while.body: ; preds = %entry, %MWC_AddMod64.exit16 %r.020 = phi i64 [ %r.1, %MWC_AddMod64.exit16 ], [ 0, %entry ] %a.addr.019 = phi i64 [ %shr, %MWC_AddMod64.exit16 ], [ %a, %entry ] %b.addr.018 = phi i64 [ %v.0.i15, %MWC_AddMod64.exit16 ], [ %b, %entry ] %and = and i64 %a.addr.019, 1 %tobool = icmp eq i64 %and, 0 br i1 %tobool, label %if.end, label %if.then if.then: ; preds = %while.body %add.i = add i64 %r.020, %b.addr.018 %cmp.i = icmp ult i64 %add.i, %M br i1 %cmp.i, label %lor.lhs.false.i, label %if.then.i lor.lhs.false.i: ; preds = %if.then %0 = uitofp i64 %add.i to float %1 = uitofp i64 %r.020 to float %cmp2.i = fcmp olt float %0, %1 br i1 %cmp2.i, label %if.then.i, label %if.end if.then.i: ; preds = %lor.lhs.false.i, %if.then %sub.i = sub i64 %add.i, %M br label %if.end if.end: ; preds = %if.then.i, %lor.lhs.false.i, %while.body %r.1 = phi i64 [ %r.020, %while.body ], [ %sub.i, %if.then.i ], [ %add.i, %lor.lhs.false.i ] %add.i9 = shl i64 %b.addr.018, 1 %cmp.i10 = icmp ult i64 %add.i9, %M br i1 %cmp.i10, label %lor.lhs.false.i12, label %if.then.i14 lor.lhs.false.i12: ; preds = %if.end %2 = uitofp i64 %add.i9 to float %3 = uitofp i64 %b.addr.018 to float %cmp2.i11 = fcmp olt float %2, %3 br i1 %cmp2.i11, label %if.then.i14, label %MWC_AddMod64.exit16 if.then.i14: ; preds = %lor.lhs.false.i12, %if.end %sub.i13 = sub i64 %add.i9, %M br label %MWC_AddMod64.exit16 MWC_AddMod64.exit16: ; preds = %lor.lhs.false.i12, %if.then.i14 %v.0.i15 = phi i64 [ %sub.i13, %if.then.i14 ], [ %add.i9, %lor.lhs.false.i12 ] %shr = lshr i64 %a.addr.019, 1 %cmp = icmp eq i64 %shr, 0 br i1 %cmp, label %while.end, label %while.body while.end: ; preds = %MWC_AddMod64.exit16, %entry %r.0.lcssa = phi i64 [ 0, %entry ], [ %r.1, %MWC_AddMod64.exit16 ] ret i64 %r.0.lcssa } ; Function Attrs: norecurse nounwind readnone define i64 @MWC_PowMod64(i64 %a, i64 %e, i64 %M) local_unnamed_addr #0 { entry: %cmp38 = icmp eq i64 %e, 0 br i1 %cmp38, label %while.end, label %while.body while.body: ; preds = %entry, %MWC_MulMod64.exit37 %acc.041 = phi i64 [ %acc.1, %MWC_MulMod64.exit37 ], [ 1, %entry ] %sqr.040 = phi i64 [ %r.0.lcssa.i36, %MWC_MulMod64.exit37 ], [ %a, %entry ] %e.addr.039 = phi i64 [ %shr, %MWC_MulMod64.exit37 ], [ %e, %entry ] %and = and i64 %e.addr.039, 1 %tobool = icmp eq i64 %and, 0 br i1 %tobool, label %if.end, label %if.then if.then: ; preds = %while.body %cmp17.i = icmp eq i64 %acc.041, 0 br i1 %cmp17.i, label %if.end, label %while.body.i while.body.i: ; preds = %if.then, %MWC_AddMod64.exit16.i %r.020.i = phi i64 [ %r.1.i, %MWC_AddMod64.exit16.i ], [ 0, %if.then ] %a.addr.019.i = phi i64 [ %shr.i, %MWC_AddMod64.exit16.i ], [ %acc.041, %if.then ] %b.addr.018.i = phi i64 [ %v.0.i15.i, %MWC_AddMod64.exit16.i ], [ %sqr.040, %if.then ] %and.i = and i64 %a.addr.019.i, 1 %tobool.i = icmp eq i64 %and.i, 0 br i1 %tobool.i, label %if.end.i, label %if.then.i if.then.i: ; preds = %while.body.i %add.i.i = add i64 %b.addr.018.i, %r.020.i %cmp.i.i = icmp ult i64 %add.i.i, %M br i1 %cmp.i.i, label %lor.lhs.false.i.i, label %if.then.i.i lor.lhs.false.i.i: ; preds = %if.then.i %0 = uitofp i64 %add.i.i to float %1 = uitofp i64 %r.020.i to float %cmp2.i.i = fcmp olt float %0, %1 br i1 %cmp2.i.i, label %if.then.i.i, label %if.end.i if.then.i.i: ; preds = %lor.lhs.false.i.i, %if.then.i %sub.i.i = sub i64 %add.i.i, %M br label %if.end.i if.end.i: ; preds = %if.then.i.i, %lor.lhs.false.i.i, %while.body.i %r.1.i = phi i64 [ %r.020.i, %while.body.i ], [ %sub.i.i, %if.then.i.i ], [ %add.i.i, %lor.lhs.false.i.i ] %add.i9.i = shl i64 %b.addr.018.i, 1 %cmp.i10.i = icmp ult i64 %add.i9.i, %M br i1 %cmp.i10.i, label %lor.lhs.false.i12.i, label %if.then.i14.i lor.lhs.false.i12.i: ; preds = %if.end.i %2 = uitofp i64 %add.i9.i to float %3 = uitofp i64 %b.addr.018.i to float %cmp2.i11.i = fcmp olt float %2, %3 br i1 %cmp2.i11.i, label %if.then.i14.i, label %MWC_AddMod64.exit16.i if.then.i14.i: ; preds = %lor.lhs.false.i12.i, %if.end.i %sub.i13.i = sub i64 %add.i9.i, %M br label %MWC_AddMod64.exit16.i MWC_AddMod64.exit16.i: ; preds = %if.then.i14.i, %lor.lhs.false.i12.i %v.0.i15.i = phi i64 [ %sub.i13.i, %if.then.i14.i ], [ %add.i9.i, %lor.lhs.false.i12.i ] %shr.i = lshr i64 %a.addr.019.i, 1 %cmp.i = icmp eq i64 %shr.i, 0 br i1 %cmp.i, label %if.end, label %while.body.i if.end: ; preds = %MWC_AddMod64.exit16.i, %if.then, %while.body %acc.1 = phi i64 [ %acc.041, %while.body ], [ 0, %if.then ], [ %r.1.i, %MWC_AddMod64.exit16.i ] %cmp17.i10 = icmp eq i64 %sqr.040, 0 br i1 %cmp17.i10, label %MWC_MulMod64.exit37, label %while.body.i16 while.body.i16: ; preds = %if.end, %MWC_AddMod64.exit16.i35 %r.020.i11 = phi i64 [ %r.1.i24, %MWC_AddMod64.exit16.i35 ], [ 0, %if.end ] %a.addr.019.i12 = phi i64 [ %shr.i33, %MWC_AddMod64.exit16.i35 ], [ %sqr.040, %if.end ] %b.addr.018.i13 = phi i64 [ %v.0.i15.i32, %MWC_AddMod64.exit16.i35 ], [ %sqr.040, %if.end ] %and.i14 = and i64 %a.addr.019.i12, 1 %tobool.i15 = icmp eq i64 %and.i14, 0 br i1 %tobool.i15, label %if.end.i27, label %if.then.i19 if.then.i19: ; preds = %while.body.i16 %add.i.i17 = add i64 %b.addr.018.i13, %r.020.i11 %cmp.i.i18 = icmp ult i64 %add.i.i17, %M br i1 %cmp.i.i18, label %lor.lhs.false.i.i21, label %if.then.i.i23 lor.lhs.false.i.i21: ; preds = %if.then.i19 %4 = uitofp i64 %add.i.i17 to float %5 = uitofp i64 %r.020.i11 to float %cmp2.i.i20 = fcmp olt float %4, %5 br i1 %cmp2.i.i20, label %if.then.i.i23, label %if.end.i27 if.then.i.i23: ; preds = %lor.lhs.false.i.i21, %if.then.i19 %sub.i.i22 = sub i64 %add.i.i17, %M br label %if.end.i27 if.end.i27: ; preds = %if.then.i.i23, %lor.lhs.false.i.i21, %while.body.i16 %r.1.i24 = phi i64 [ %r.020.i11, %while.body.i16 ], [ %sub.i.i22, %if.then.i.i23 ], [ %add.i.i17, %lor.lhs.false.i.i21 ] %add.i9.i25 = shl i64 %b.addr.018.i13, 1 %cmp.i10.i26 = icmp ult i64 %add.i9.i25, %M br i1 %cmp.i10.i26, label %lor.lhs.false.i12.i29, label %if.then.i14.i31 lor.lhs.false.i12.i29: ; preds = %if.end.i27 %6 = uitofp i64 %add.i9.i25 to float %7 = uitofp i64 %b.addr.018.i13 to float %cmp2.i11.i28 = fcmp olt float %6, %7 br i1 %cmp2.i11.i28, label %if.then.i14.i31, label %MWC_AddMod64.exit16.i35 if.then.i14.i31: ; preds = %lor.lhs.false.i12.i29, %if.end.i27 %sub.i13.i30 = sub i64 %add.i9.i25, %M br label %MWC_AddMod64.exit16.i35 MWC_AddMod64.exit16.i35: ; preds = %if.then.i14.i31, %lor.lhs.false.i12.i29 %v.0.i15.i32 = phi i64 [ %sub.i13.i30, %if.then.i14.i31 ], [ %add.i9.i25, %lor.lhs.false.i12.i29 ] %shr.i33 = lshr i64 %a.addr.019.i12, 1 %cmp.i34 = icmp eq i64 %shr.i33, 0 br i1 %cmp.i34, label %MWC_MulMod64.exit37, label %while.body.i16 MWC_MulMod64.exit37: ; preds = %MWC_AddMod64.exit16.i35, %if.end %r.0.lcssa.i36 = phi i64 [ 0, %if.end ], [ %r.1.i24, %MWC_AddMod64.exit16.i35 ] %shr = lshr i64 %e.addr.039, 1 %cmp = icmp eq i64 %shr, 0 br i1 %cmp, label %while.end, label %while.body while.end: ; preds = %MWC_MulMod64.exit37, %entry %acc.0.lcssa = phi i64 [ 1, %entry ], [ %acc.1, %MWC_MulMod64.exit37 ] ret i64 %acc.0.lcssa } ; Function Attrs: norecurse nounwind readnone define <2 x i32> @MWC_SkipImpl_Mod64(<2 x i32> %curr, i64 %A, i64 %M, i64 %distance) local_unnamed_addr #0 { entry: %cmp38.i = icmp eq i64 %distance, 0 br i1 %cmp38.i, label %MWC_PowMod64.exit, label %while.body.i while.body.i: ; preds = %entry, %MWC_MulMod64.exit37.i %acc.041.i = phi i64 [ %acc.1.i, %MWC_MulMod64.exit37.i ], [ 1, %entry ] %sqr.040.i = phi i64 [ %r.0.lcssa.i36.i, %MWC_MulMod64.exit37.i ], [ %A, %entry ] %e.addr.039.i = phi i64 [ %shr.i, %MWC_MulMod64.exit37.i ], [ %distance, %entry ] %and.i = and i64 %e.addr.039.i, 1 %tobool.i = icmp eq i64 %and.i, 0 br i1 %tobool.i, label %if.end.i, label %if.then.i if.then.i: ; preds = %while.body.i %cmp17.i.i = icmp eq i64 %acc.041.i, 0 br i1 %cmp17.i.i, label %if.end.i, label %while.body.i.i while.body.i.i: ; preds = %if.then.i, %MWC_AddMod64.exit16.i.i %r.020.i.i = phi i64 [ %r.1.i.i, %MWC_AddMod64.exit16.i.i ], [ 0, %if.then.i ] %a.addr.019.i.i = phi i64 [ %shr.i.i, %MWC_AddMod64.exit16.i.i ], [ %acc.041.i, %if.then.i ] %b.addr.018.i.i = phi i64 [ %v.0.i15.i.i, %MWC_AddMod64.exit16.i.i ], [ %sqr.040.i, %if.then.i ] %and.i.i = and i64 %a.addr.019.i.i, 1 %tobool.i.i = icmp eq i64 %and.i.i, 0 br i1 %tobool.i.i, label %if.end.i.i, label %if.then.i.i if.then.i.i: ; preds = %while.body.i.i %add.i.i.i = add i64 %b.addr.018.i.i, %r.020.i.i %cmp.i.i.i = icmp ult i64 %add.i.i.i, %M br i1 %cmp.i.i.i, label %lor.lhs.false.i.i.i, label %if.then.i.i.i lor.lhs.false.i.i.i: ; preds = %if.then.i.i %0 = uitofp i64 %add.i.i.i to float %1 = uitofp i64 %r.020.i.i to float %cmp2.i.i.i = fcmp olt float %0, %1 br i1 %cmp2.i.i.i, label %if.then.i.i.i, label %if.end.i.i if.then.i.i.i: ; preds = %lor.lhs.false.i.i.i, %if.then.i.i %sub.i.i.i = sub i64 %add.i.i.i, %M br label %if.end.i.i if.end.i.i: ; preds = %if.then.i.i.i, %lor.lhs.false.i.i.i, %while.body.i.i %r.1.i.i = phi i64 [ %r.020.i.i, %while.body.i.i ], [ %sub.i.i.i, %if.then.i.i.i ], [ %add.i.i.i, %lor.lhs.false.i.i.i ] %add.i9.i.i = shl i64 %b.addr.018.i.i, 1 %cmp.i10.i.i = icmp ult i64 %add.i9.i.i, %M br i1 %cmp.i10.i.i, label %lor.lhs.false.i12.i.i, label %if.then.i14.i.i lor.lhs.false.i12.i.i: ; preds = %if.end.i.i %2 = uitofp i64 %add.i9.i.i to float %3 = uitofp i64 %b.addr.018.i.i to float %cmp2.i11.i.i = fcmp olt float %2, %3 br i1 %cmp2.i11.i.i, label %if.then.i14.i.i, label %MWC_AddMod64.exit16.i.i if.then.i14.i.i: ; preds = %lor.lhs.false.i12.i.i, %if.end.i.i %sub.i13.i.i = sub i64 %add.i9.i.i, %M br label %MWC_AddMod64.exit16.i.i MWC_AddMod64.exit16.i.i: ; preds = %if.then.i14.i.i, %lor.lhs.false.i12.i.i %v.0.i15.i.i = phi i64 [ %sub.i13.i.i, %if.then.i14.i.i ], [ %add.i9.i.i, %lor.lhs.false.i12.i.i ] %shr.i.i = lshr i64 %a.addr.019.i.i, 1 %cmp.i.i = icmp eq i64 %shr.i.i, 0 br i1 %cmp.i.i, label %if.end.i, label %while.body.i.i if.end.i: ; preds = %MWC_AddMod64.exit16.i.i, %if.then.i, %while.body.i %acc.1.i = phi i64 [ %acc.041.i, %while.body.i ], [ 0, %if.then.i ], [ %r.1.i.i, %MWC_AddMod64.exit16.i.i ] %cmp17.i10.i = icmp eq i64 %sqr.040.i, 0 br i1 %cmp17.i10.i, label %MWC_MulMod64.exit37.i, label %while.body.i16.i while.body.i16.i: ; preds = %if.end.i, %MWC_AddMod64.exit16.i35.i %r.020.i11.i = phi i64 [ %r.1.i24.i, %MWC_AddMod64.exit16.i35.i ], [ 0, %if.end.i ] %a.addr.019.i12.i = phi i64 [ %shr.i33.i, %MWC_AddMod64.exit16.i35.i ], [ %sqr.040.i, %if.end.i ] %b.addr.018.i13.i = phi i64 [ %v.0.i15.i32.i, %MWC_AddMod64.exit16.i35.i ], [ %sqr.040.i, %if.end.i ] %and.i14.i = and i64 %a.addr.019.i12.i, 1 %tobool.i15.i = icmp eq i64 %and.i14.i, 0 br i1 %tobool.i15.i, label %if.end.i27.i, label %if.then.i19.i if.then.i19.i: ; preds = %while.body.i16.i %add.i.i17.i = add i64 %b.addr.018.i13.i, %r.020.i11.i %cmp.i.i18.i = icmp ult i64 %add.i.i17.i, %M br i1 %cmp.i.i18.i, label %lor.lhs.false.i.i21.i, label %if.then.i.i23.i lor.lhs.false.i.i21.i: ; preds = %if.then.i19.i %4 = uitofp i64 %add.i.i17.i to float %5 = uitofp i64 %r.020.i11.i to float %cmp2.i.i20.i = fcmp olt float %4, %5 br i1 %cmp2.i.i20.i, label %if.then.i.i23.i, label %if.end.i27.i if.then.i.i23.i: ; preds = %lor.lhs.false.i.i21.i, %if.then.i19.i %sub.i.i22.i = sub i64 %add.i.i17.i, %M br label %if.end.i27.i if.end.i27.i: ; preds = %if.then.i.i23.i, %lor.lhs.false.i.i21.i, %while.body.i16.i %r.1.i24.i = phi i64 [ %r.020.i11.i, %while.body.i16.i ], [ %sub.i.i22.i, %if.then.i.i23.i ], [ %add.i.i17.i, %lor.lhs.false.i.i21.i ] %add.i9.i25.i = shl i64 %b.addr.018.i13.i, 1 %cmp.i10.i26.i = icmp ult i64 %add.i9.i25.i, %M br i1 %cmp.i10.i26.i, label %lor.lhs.false.i12.i29.i, label %if.then.i14.i31.i lor.lhs.false.i12.i29.i: ; preds = %if.end.i27.i %6 = uitofp i64 %add.i9.i25.i to float %7 = uitofp i64 %b.addr.018.i13.i to float %cmp2.i11.i28.i = fcmp olt float %6, %7 br i1 %cmp2.i11.i28.i, label %if.then.i14.i31.i, label %MWC_AddMod64.exit16.i35.i if.then.i14.i31.i: ; preds = %lor.lhs.false.i12.i29.i, %if.end.i27.i %sub.i13.i30.i = sub i64 %add.i9.i25.i, %M br label %MWC_AddMod64.exit16.i35.i MWC_AddMod64.exit16.i35.i: ; preds = %if.then.i14.i31.i, %lor.lhs.false.i12.i29.i %v.0.i15.i32.i = phi i64 [ %sub.i13.i30.i, %if.then.i14.i31.i ], [ %add.i9.i25.i, %lor.lhs.false.i12.i29.i ] %shr.i33.i = lshr i64 %a.addr.019.i12.i, 1 %cmp.i34.i = icmp eq i64 %shr.i33.i, 0 br i1 %cmp.i34.i, label %MWC_MulMod64.exit37.i, label %while.body.i16.i MWC_MulMod64.exit37.i: ; preds = %MWC_AddMod64.exit16.i35.i, %if.end.i %r.0.lcssa.i36.i = phi i64 [ 0, %if.end.i ], [ %r.1.i24.i, %MWC_AddMod64.exit16.i35.i ] %shr.i = lshr i64 %e.addr.039.i, 1 %cmp.i = icmp eq i64 %shr.i, 0 br i1 %cmp.i, label %MWC_PowMod64.exit, label %while.body.i MWC_PowMod64.exit: ; preds = %MWC_MulMod64.exit37.i, %entry %acc.0.lcssa.i = phi i64 [ 1, %entry ], [ %acc.1.i, %MWC_MulMod64.exit37.i ] %8 = extractelement <2 x i32> %curr, i32 0 %conv = zext i32 %8 to i64 %mul = mul i64 %conv, %A %9 = extractelement <2 x i32> %curr, i32 1 %conv1 = zext i32 %9 to i64 %add = add i64 %mul, %conv1 %cmp17.i = icmp eq i64 %add, 0 br i1 %cmp17.i, label %MWC_MulMod64.exit, label %while.body.i17 while.body.i17: ; preds = %MWC_PowMod64.exit, %MWC_AddMod64.exit16.i %r.020.i = phi i64 [ %r.1.i, %MWC_AddMod64.exit16.i ], [ 0, %MWC_PowMod64.exit ] %a.addr.019.i = phi i64 [ %shr.i22, %MWC_AddMod64.exit16.i ], [ %add, %MWC_PowMod64.exit ] %b.addr.018.i = phi i64 [ %v.0.i15.i, %MWC_AddMod64.exit16.i ], [ %acc.0.lcssa.i, %MWC_PowMod64.exit ] %and.i15 = and i64 %a.addr.019.i, 1 %tobool.i16 = icmp eq i64 %and.i15, 0 br i1 %tobool.i16, label %if.end.i21, label %if.then.i19 if.then.i19: ; preds = %while.body.i17 %add.i.i = add i64 %b.addr.018.i, %r.020.i %cmp.i.i18 = icmp ult i64 %add.i.i, %M br i1 %cmp.i.i18, label %lor.lhs.false.i.i, label %if.then.i.i20 lor.lhs.false.i.i: ; preds = %if.then.i19 %10 = uitofp i64 %add.i.i to float %11 = uitofp i64 %r.020.i to float %cmp2.i.i = fcmp olt float %10, %11 br i1 %cmp2.i.i, label %if.then.i.i20, label %if.end.i21 if.then.i.i20: ; preds = %lor.lhs.false.i.i, %if.then.i19 %sub.i.i = sub i64 %add.i.i, %M br label %if.end.i21 if.end.i21: ; preds = %if.then.i.i20, %lor.lhs.false.i.i, %while.body.i17 %r.1.i = phi i64 [ %r.020.i, %while.body.i17 ], [ %sub.i.i, %if.then.i.i20 ], [ %add.i.i, %lor.lhs.false.i.i ] %add.i9.i = shl i64 %b.addr.018.i, 1 %cmp.i10.i = icmp ult i64 %add.i9.i, %M br i1 %cmp.i10.i, label %lor.lhs.false.i12.i, label %if.then.i14.i lor.lhs.false.i12.i: ; preds = %if.end.i21 %12 = uitofp i64 %add.i9.i to float %13 = uitofp i64 %b.addr.018.i to float %cmp2.i11.i = fcmp olt float %12, %13 br i1 %cmp2.i11.i, label %if.then.i14.i, label %MWC_AddMod64.exit16.i if.then.i14.i: ; preds = %lor.lhs.false.i12.i, %if.end.i21 %sub.i13.i = sub i64 %add.i9.i, %M br label %MWC_AddMod64.exit16.i MWC_AddMod64.exit16.i: ; preds = %if.then.i14.i, %lor.lhs.false.i12.i %v.0.i15.i = phi i64 [ %sub.i13.i, %if.then.i14.i ], [ %add.i9.i, %lor.lhs.false.i12.i ] %shr.i22 = lshr i64 %a.addr.019.i, 1 %cmp.i23 = icmp eq i64 %shr.i22, 0 br i1 %cmp.i23, label %MWC_MulMod64.exit, label %while.body.i17 MWC_MulMod64.exit: ; preds = %MWC_AddMod64.exit16.i, %MWC_PowMod64.exit %r.0.lcssa.i = phi i64 [ 0, %MWC_PowMod64.exit ], [ %r.1.i, %MWC_AddMod64.exit16.i ] %div = udiv i64 %r.0.lcssa.i, %A %conv3 = trunc i64 %div to i32 %vecinit = insertelement <2 x i32> undef, i32 %conv3, i32 0 %14 = mul i64 %div, %A %15 = sub i64 %r.0.lcssa.i, %14 %conv4 = trunc i64 %15 to i32 %vecinit5 = insertelement <2 x i32> %vecinit, i32 %conv4, i32 1 ret <2 x i32> %vecinit5 } ; Function Attrs: convergent nounwind readonly define <2 x i32> @MWC_SeedImpl_Mod64(i64 %A, i64 %M, i32 %vecSize, i32 %vecOffset, i64 %streamBase, i64 %streamGap) local_unnamed_addr #2 { entry: %0 = tail call i32 @llvm.r600.read.tgid.x() #13 %x.i.i = tail call i32 @llvm.r600.read.local.size.x() #13 %1 = mul i32 %x.i.i, %0 %2 = tail call i32 @llvm.r600.read.tidig.x() #13, !range !3 %3 = add i32 %1, %2 %4 = tail call i8 addrspace(7)* @llvm.r600.implicitarg.ptr() #13 %5 = getelementptr inbounds i8, i8 addrspace(7)* %4, i32 4 %6 = bitcast i8 addrspace(7)* %5 to i32 addrspace(7)* %7 = load i32, i32 addrspace(7)* %6, align 4, !tbaa !4 %8 = add i32 %3, %7 %mul = mul i32 %8, %vecSize %add = add i32 %mul, %vecOffset %conv = zext i32 %add to i64 %mul1 = mul i64 %conv, %streamGap %add2 = add i64 %mul1, %streamBase %cmp38.i = icmp eq i64 %add2, 0 br i1 %cmp38.i, label %while.body.i.preheader, label %while.body.i17 while.body.i17: ; preds = %entry, %MWC_MulMod64.exit37.i %acc.041.i = phi i64 [ %acc.1.i, %MWC_MulMod64.exit37.i ], [ 1, %entry ] %sqr.040.i = phi i64 [ %r.0.lcssa.i36.i, %MWC_MulMod64.exit37.i ], [ %A, %entry ] %e.addr.039.i = phi i64 [ %shr.i22, %MWC_MulMod64.exit37.i ], [ %add2, %entry ] %and.i15 = and i64 %e.addr.039.i, 1 %tobool.i16 = icmp eq i64 %and.i15, 0 br i1 %tobool.i16, label %if.end.i21, label %if.then.i18 if.then.i18: ; preds = %while.body.i17 %cmp17.i.i = icmp eq i64 %acc.041.i, 0 br i1 %cmp17.i.i, label %if.end.i21, label %while.body.i.i while.body.i.i: ; preds = %if.then.i18, %MWC_AddMod64.exit16.i.i %r.020.i.i = phi i64 [ %r.1.i.i, %MWC_AddMod64.exit16.i.i ], [ 0, %if.then.i18 ] %a.addr.019.i.i = phi i64 [ %shr.i.i, %MWC_AddMod64.exit16.i.i ], [ %acc.041.i, %if.then.i18 ] %b.addr.018.i.i = phi i64 [ %v.0.i15.i.i, %MWC_AddMod64.exit16.i.i ], [ %sqr.040.i, %if.then.i18 ] %and.i.i = and i64 %a.addr.019.i.i, 1 %tobool.i.i = icmp eq i64 %and.i.i, 0 br i1 %tobool.i.i, label %if.end.i.i, label %if.then.i.i19 if.then.i.i19: ; preds = %while.body.i.i %add.i.i.i = add i64 %b.addr.018.i.i, %r.020.i.i %cmp.i.i.i = icmp ult i64 %add.i.i.i, %M br i1 %cmp.i.i.i, label %lor.lhs.false.i.i.i, label %if.then.i.i.i lor.lhs.false.i.i.i: ; preds = %if.then.i.i19 %9 = uitofp i64 %add.i.i.i to float %10 = uitofp i64 %r.020.i.i to float %cmp2.i.i.i = fcmp olt float %9, %10 br i1 %cmp2.i.i.i, label %if.then.i.i.i, label %if.end.i.i if.then.i.i.i: ; preds = %lor.lhs.false.i.i.i, %if.then.i.i19 %sub.i.i.i = sub i64 %add.i.i.i, %M br label %if.end.i.i if.end.i.i: ; preds = %if.then.i.i.i, %lor.lhs.false.i.i.i, %while.body.i.i %r.1.i.i = phi i64 [ %r.020.i.i, %while.body.i.i ], [ %sub.i.i.i, %if.then.i.i.i ], [ %add.i.i.i, %lor.lhs.false.i.i.i ] %add.i9.i.i = shl i64 %b.addr.018.i.i, 1 %cmp.i10.i.i = icmp ult i64 %add.i9.i.i, %M br i1 %cmp.i10.i.i, label %lor.lhs.false.i12.i.i, label %if.then.i14.i.i lor.lhs.false.i12.i.i: ; preds = %if.end.i.i %11 = uitofp i64 %add.i9.i.i to float %12 = uitofp i64 %b.addr.018.i.i to float %cmp2.i11.i.i = fcmp olt float %11, %12 br i1 %cmp2.i11.i.i, label %if.then.i14.i.i, label %MWC_AddMod64.exit16.i.i if.then.i14.i.i: ; preds = %lor.lhs.false.i12.i.i, %if.end.i.i %sub.i13.i.i = sub i64 %add.i9.i.i, %M br label %MWC_AddMod64.exit16.i.i MWC_AddMod64.exit16.i.i: ; preds = %if.then.i14.i.i, %lor.lhs.false.i12.i.i %v.0.i15.i.i = phi i64 [ %sub.i13.i.i, %if.then.i14.i.i ], [ %add.i9.i.i, %lor.lhs.false.i12.i.i ] %shr.i.i = lshr i64 %a.addr.019.i.i, 1 %cmp.i.i20 = icmp eq i64 %shr.i.i, 0 br i1 %cmp.i.i20, label %if.end.i21, label %while.body.i.i if.end.i21: ; preds = %MWC_AddMod64.exit16.i.i, %if.then.i18, %while.body.i17 %acc.1.i = phi i64 [ %acc.041.i, %while.body.i17 ], [ 0, %if.then.i18 ], [ %r.1.i.i, %MWC_AddMod64.exit16.i.i ] %cmp17.i10.i = icmp eq i64 %sqr.040.i, 0 br i1 %cmp17.i10.i, label %MWC_MulMod64.exit37.i, label %while.body.i16.i while.body.i16.i: ; preds = %if.end.i21, %MWC_AddMod64.exit16.i35.i %r.020.i11.i = phi i64 [ %r.1.i24.i, %MWC_AddMod64.exit16.i35.i ], [ 0, %if.end.i21 ] %a.addr.019.i12.i = phi i64 [ %shr.i33.i, %MWC_AddMod64.exit16.i35.i ], [ %sqr.040.i, %if.end.i21 ] %b.addr.018.i13.i = phi i64 [ %v.0.i15.i32.i, %MWC_AddMod64.exit16.i35.i ], [ %sqr.040.i, %if.end.i21 ] %and.i14.i = and i64 %a.addr.019.i12.i, 1 %tobool.i15.i = icmp eq i64 %and.i14.i, 0 br i1 %tobool.i15.i, label %if.end.i27.i, label %if.then.i19.i if.then.i19.i: ; preds = %while.body.i16.i %add.i.i17.i = add i64 %b.addr.018.i13.i, %r.020.i11.i %cmp.i.i18.i = icmp ult i64 %add.i.i17.i, %M br i1 %cmp.i.i18.i, label %lor.lhs.false.i.i21.i, label %if.then.i.i23.i lor.lhs.false.i.i21.i: ; preds = %if.then.i19.i %13 = uitofp i64 %add.i.i17.i to float %14 = uitofp i64 %r.020.i11.i to float %cmp2.i.i20.i = fcmp olt float %13, %14 br i1 %cmp2.i.i20.i, label %if.then.i.i23.i, label %if.end.i27.i if.then.i.i23.i: ; preds = %lor.lhs.false.i.i21.i, %if.then.i19.i %sub.i.i22.i = sub i64 %add.i.i17.i, %M br label %if.end.i27.i if.end.i27.i: ; preds = %if.then.i.i23.i, %lor.lhs.false.i.i21.i, %while.body.i16.i %r.1.i24.i = phi i64 [ %r.020.i11.i, %while.body.i16.i ], [ %sub.i.i22.i, %if.then.i.i23.i ], [ %add.i.i17.i, %lor.lhs.false.i.i21.i ] %add.i9.i25.i = shl i64 %b.addr.018.i13.i, 1 %cmp.i10.i26.i = icmp ult i64 %add.i9.i25.i, %M br i1 %cmp.i10.i26.i, label %lor.lhs.false.i12.i29.i, label %if.then.i14.i31.i lor.lhs.false.i12.i29.i: ; preds = %if.end.i27.i %15 = uitofp i64 %add.i9.i25.i to float %16 = uitofp i64 %b.addr.018.i13.i to float %cmp2.i11.i28.i = fcmp olt float %15, %16 br i1 %cmp2.i11.i28.i, label %if.then.i14.i31.i, label %MWC_AddMod64.exit16.i35.i if.then.i14.i31.i: ; preds = %lor.lhs.false.i12.i29.i, %if.end.i27.i %sub.i13.i30.i = sub i64 %add.i9.i25.i, %M br label %MWC_AddMod64.exit16.i35.i MWC_AddMod64.exit16.i35.i: ; preds = %if.then.i14.i31.i, %lor.lhs.false.i12.i29.i %v.0.i15.i32.i = phi i64 [ %sub.i13.i30.i, %if.then.i14.i31.i ], [ %add.i9.i25.i, %lor.lhs.false.i12.i29.i ] %shr.i33.i = lshr i64 %a.addr.019.i12.i, 1 %cmp.i34.i = icmp eq i64 %shr.i33.i, 0 br i1 %cmp.i34.i, label %MWC_MulMod64.exit37.i, label %while.body.i16.i MWC_MulMod64.exit37.i: ; preds = %MWC_AddMod64.exit16.i35.i, %if.end.i21 %r.0.lcssa.i36.i = phi i64 [ 0, %if.end.i21 ], [ %r.1.i24.i, %MWC_AddMod64.exit16.i35.i ] %shr.i22 = lshr i64 %e.addr.039.i, 1 %cmp.i23 = icmp eq i64 %shr.i22, 0 br i1 %cmp.i23, label %while.body.i.preheader, label %while.body.i17 while.body.i.preheader: ; preds = %MWC_MulMod64.exit37.i, %entry %b.addr.018.i.ph = phi i64 [ 1, %entry ], [ %acc.1.i, %MWC_MulMod64.exit37.i ] br label %while.body.i while.body.i: ; preds = %MWC_AddMod64.exit16.i.1, %while.body.i.preheader %r.020.i = phi i64 [ 0, %while.body.i.preheader ], [ %r.1.i.1, %MWC_AddMod64.exit16.i.1 ] %a.addr.019.i = phi i64 [ 4077358422479273989, %while.body.i.preheader ], [ %shr.i, %MWC_AddMod64.exit16.i.1 ] %b.addr.018.i = phi i64 [ %b.addr.018.i.ph, %while.body.i.preheader ], [ %v.0.i15.i.1, %MWC_AddMod64.exit16.i.1 ] %and.i = and i64 %a.addr.019.i, 1 %tobool.i = icmp eq i64 %and.i, 0 br i1 %tobool.i, label %if.end.i, label %if.then.i if.then.i: ; preds = %while.body.i %add.i.i = add i64 %b.addr.018.i, %r.020.i %cmp.i.i = icmp ult i64 %add.i.i, %M br i1 %cmp.i.i, label %lor.lhs.false.i.i, label %if.then.i.i lor.lhs.false.i.i: ; preds = %if.then.i %17 = uitofp i64 %add.i.i to float %18 = uitofp i64 %r.020.i to float %cmp2.i.i = fcmp olt float %17, %18 br i1 %cmp2.i.i, label %if.then.i.i, label %if.end.i if.then.i.i: ; preds = %lor.lhs.false.i.i, %if.then.i %sub.i.i = sub i64 %add.i.i, %M br label %if.end.i if.end.i: ; preds = %if.then.i.i, %lor.lhs.false.i.i, %while.body.i %r.1.i = phi i64 [ %r.020.i, %while.body.i ], [ %sub.i.i, %if.then.i.i ], [ %add.i.i, %lor.lhs.false.i.i ] %add.i9.i = shl i64 %b.addr.018.i, 1 %cmp.i10.i = icmp ult i64 %add.i9.i, %M br i1 %cmp.i10.i, label %lor.lhs.false.i12.i, label %if.then.i14.i lor.lhs.false.i12.i: ; preds = %if.end.i %19 = uitofp i64 %add.i9.i to float %20 = uitofp i64 %b.addr.018.i to float %cmp2.i11.i = fcmp olt float %19, %20 br i1 %cmp2.i11.i, label %if.then.i14.i, label %MWC_AddMod64.exit16.i if.then.i14.i: ; preds = %lor.lhs.false.i12.i, %if.end.i %sub.i13.i = sub i64 %add.i9.i, %M br label %MWC_AddMod64.exit16.i MWC_AddMod64.exit16.i: ; preds = %if.then.i14.i, %lor.lhs.false.i12.i %v.0.i15.i = phi i64 [ %sub.i13.i, %if.then.i14.i ], [ %add.i9.i, %lor.lhs.false.i12.i ] %shr.i = lshr i64 %a.addr.019.i, 2 %and.i.1 = and i64 %a.addr.019.i, 2 %tobool.i.1 = icmp eq i64 %and.i.1, 0 br i1 %tobool.i.1, label %if.end.i.1, label %if.then.i.1 MWC_MulMod64.exit: ; preds = %MWC_AddMod64.exit16.i.1 %div = udiv i64 %r.1.i.1, %A %conv5 = trunc i64 %div to i32 %vecinit = insertelement <2 x i32> undef, i32 %conv5, i32 0 %21 = mul i64 %div, %A %22 = sub i64 %r.1.i.1, %21 %conv6 = trunc i64 %22 to i32 %vecinit7 = insertelement <2 x i32> %vecinit, i32 %conv6, i32 1 ret <2 x i32> %vecinit7 if.then.i.1: ; preds = %MWC_AddMod64.exit16.i %add.i.i.1 = add i64 %v.0.i15.i, %r.1.i %cmp.i.i.1 = icmp ult i64 %add.i.i.1, %M br i1 %cmp.i.i.1, label %lor.lhs.false.i.i.1, label %if.then.i.i.1 lor.lhs.false.i.i.1: ; preds = %if.then.i.1 %23 = uitofp i64 %add.i.i.1 to float %24 = uitofp i64 %r.1.i to float %cmp2.i.i.1 = fcmp olt float %23, %24 br i1 %cmp2.i.i.1, label %if.then.i.i.1, label %if.end.i.1 if.then.i.i.1: ; preds = %lor.lhs.false.i.i.1, %if.then.i.1 %sub.i.i.1 = sub i64 %add.i.i.1, %M br label %if.end.i.1 if.end.i.1: ; preds = %if.then.i.i.1, %lor.lhs.false.i.i.1, %MWC_AddMod64.exit16.i %r.1.i.1 = phi i64 [ %r.1.i, %MWC_AddMod64.exit16.i ], [ %sub.i.i.1, %if.then.i.i.1 ], [ %add.i.i.1, %lor.lhs.false.i.i.1 ] %add.i9.i.1 = shl i64 %v.0.i15.i, 1 %cmp.i10.i.1 = icmp ult i64 %add.i9.i.1, %M br i1 %cmp.i10.i.1, label %lor.lhs.false.i12.i.1, label %if.then.i14.i.1 lor.lhs.false.i12.i.1: ; preds = %if.end.i.1 %25 = uitofp i64 %add.i9.i.1 to float %26 = uitofp i64 %v.0.i15.i to float %cmp2.i11.i.1 = fcmp olt float %25, %26 br i1 %cmp2.i11.i.1, label %if.then.i14.i.1, label %MWC_AddMod64.exit16.i.1 if.then.i14.i.1: ; preds = %lor.lhs.false.i12.i.1, %if.end.i.1 %sub.i13.i.1 = sub i64 %add.i9.i.1, %M br label %MWC_AddMod64.exit16.i.1 MWC_AddMod64.exit16.i.1: ; preds = %if.then.i14.i.1, %lor.lhs.false.i12.i.1 %v.0.i15.i.1 = phi i64 [ %sub.i13.i.1, %if.then.i14.i.1 ], [ %add.i9.i.1, %lor.lhs.false.i12.i.1 ] %cmp.i.1 = icmp eq i64 %shr.i, 0 br i1 %cmp.i.1, label %MWC_MulMod64.exit, label %while.body.i } ; Function Attrs: norecurse nounwind define void @MWC64X_Step(%struct.mwc64x_state_t addrspace(5)* nocapture %s) local_unnamed_addr #3 { entry: %x = getelementptr inbounds %struct.mwc64x_state_t, %struct.mwc64x_state_t addrspace(5)* %s, i32 0, i32 0 %0 = load i32, i32 addrspace(5)* %x, align 4, !tbaa !8 %c = getelementptr inbounds %struct.mwc64x_state_t, %struct.mwc64x_state_t addrspace(5)* %s, i32 0, i32 1 %1 = load i32, i32 addrspace(5)* %c, align 4, !tbaa !10 %mul = mul i32 %0, -83941 %add = add i32 %mul, %1 %cmp = icmp ult i32 %add, %1 %conv = zext i1 %cmp to i32 %2 = zext i32 %0 to i64 %3 = mul nuw i64 %2, 4294883355 %4 = lshr i64 %3, 32 %5 = trunc i64 %4 to i32 %add1 = add i32 %5, %conv store i32 %add, i32 addrspace(5)* %x, align 4, !tbaa !8 store i32 %add1, i32 addrspace(5)* %c, align 4, !tbaa !10 ret void } ; Function Attrs: norecurse nounwind define void @MWC64X_Skip(%struct.mwc64x_state_t addrspace(5)* nocapture %s, i64 %distance) local_unnamed_addr #3 { entry: %x = getelementptr inbounds %struct.mwc64x_state_t, %struct.mwc64x_state_t addrspace(5)* %s, i32 0, i32 0 %0 = load i32, i32 addrspace(5)* %x, align 4, !tbaa !8 %c = getelementptr inbounds %struct.mwc64x_state_t, %struct.mwc64x_state_t addrspace(5)* %s, i32 0, i32 1 %1 = load i32, i32 addrspace(5)* %c, align 4, !tbaa !10 %cmp38.i.i = icmp eq i64 %distance, 0 br i1 %cmp38.i.i, label %MWC_PowMod64.exit.i, label %while.body.i.i while.body.i.i: ; preds = %entry, %MWC_MulMod64.exit37.i.i %acc.041.i.i = phi i64 [ %acc.1.i.i, %MWC_MulMod64.exit37.i.i ], [ 1, %entry ] %sqr.040.i.i = phi i64 [ %r.0.lcssa.i36.i.i, %MWC_MulMod64.exit37.i.i ], [ 4294883355, %entry ] %e.addr.039.i.i = phi i64 [ %shr.i.i, %MWC_MulMod64.exit37.i.i ], [ %distance, %entry ] %and.i.i = and i64 %e.addr.039.i.i, 1 %tobool.i.i = icmp eq i64 %and.i.i, 0 br i1 %tobool.i.i, label %if.end.i.i, label %if.then.i.i if.then.i.i: ; preds = %while.body.i.i %cmp17.i.i.i = icmp eq i64 %acc.041.i.i, 0 br i1 %cmp17.i.i.i, label %if.end.i.i, label %while.body.i.i.i while.body.i.i.i: ; preds = %if.then.i.i, %MWC_AddMod64.exit16.i.i.i %r.020.i.i.i = phi i64 [ %r.1.i.i.i, %MWC_AddMod64.exit16.i.i.i ], [ 0, %if.then.i.i ] %a.addr.019.i.i.i = phi i64 [ %shr.i.i.i, %MWC_AddMod64.exit16.i.i.i ], [ %acc.041.i.i, %if.then.i.i ] %b.addr.018.i.i.i = phi i64 [ %v.0.i15.i.i.i, %MWC_AddMod64.exit16.i.i.i ], [ %sqr.040.i.i, %if.then.i.i ] %and.i.i.i = and i64 %a.addr.019.i.i.i, 1 %tobool.i.i.i = icmp eq i64 %and.i.i.i, 0 br i1 %tobool.i.i.i, label %if.end.i.i.i, label %if.then.i.i.i if.then.i.i.i: ; preds = %while.body.i.i.i %add.i.i.i.i = add i64 %b.addr.018.i.i.i, %r.020.i.i.i %cmp.i.i.i.i = icmp ult i64 %add.i.i.i.i, -360523849793537 br i1 %cmp.i.i.i.i, label %lor.lhs.false.i.i.i.i, label %if.then.i.i.i.i lor.lhs.false.i.i.i.i: ; preds = %if.then.i.i.i %2 = uitofp i64 %add.i.i.i.i to float %3 = uitofp i64 %r.020.i.i.i to float %cmp2.i.i.i.i = fcmp olt float %2, %3 br i1 %cmp2.i.i.i.i, label %if.then.i.i.i.i, label %if.end.i.i.i if.then.i.i.i.i: ; preds = %lor.lhs.false.i.i.i.i, %if.then.i.i.i %sub.i.i.i.i = add i64 %add.i.i.i.i, 360523849793537 br label %if.end.i.i.i if.end.i.i.i: ; preds = %if.then.i.i.i.i, %lor.lhs.false.i.i.i.i, %while.body.i.i.i %r.1.i.i.i = phi i64 [ %r.020.i.i.i, %while.body.i.i.i ], [ %sub.i.i.i.i, %if.then.i.i.i.i ], [ %add.i.i.i.i, %lor.lhs.false.i.i.i.i ] %add.i9.i.i.i = shl i64 %b.addr.018.i.i.i, 1 %cmp.i10.i.i.i = icmp ult i64 %add.i9.i.i.i, -360523849793537 br i1 %cmp.i10.i.i.i, label %lor.lhs.false.i12.i.i.i, label %if.then.i14.i.i.i lor.lhs.false.i12.i.i.i: ; preds = %if.end.i.i.i %4 = uitofp i64 %add.i9.i.i.i to float %5 = uitofp i64 %b.addr.018.i.i.i to float %cmp2.i11.i.i.i = fcmp olt float %4, %5 br i1 %cmp2.i11.i.i.i, label %if.then.i14.i.i.i, label %MWC_AddMod64.exit16.i.i.i if.then.i14.i.i.i: ; preds = %lor.lhs.false.i12.i.i.i, %if.end.i.i.i %sub.i13.i.i.i = add i64 %add.i9.i.i.i, 360523849793537 br label %MWC_AddMod64.exit16.i.i.i MWC_AddMod64.exit16.i.i.i: ; preds = %if.then.i14.i.i.i, %lor.lhs.false.i12.i.i.i %v.0.i15.i.i.i = phi i64 [ %sub.i13.i.i.i, %if.then.i14.i.i.i ], [ %add.i9.i.i.i, %lor.lhs.false.i12.i.i.i ] %shr.i.i.i = lshr i64 %a.addr.019.i.i.i, 1 %cmp.i.i.i = icmp eq i64 %shr.i.i.i, 0 br i1 %cmp.i.i.i, label %if.end.i.i, label %while.body.i.i.i if.end.i.i: ; preds = %MWC_AddMod64.exit16.i.i.i, %if.then.i.i, %while.body.i.i %acc.1.i.i = phi i64 [ %acc.041.i.i, %while.body.i.i ], [ 0, %if.then.i.i ], [ %r.1.i.i.i, %MWC_AddMod64.exit16.i.i.i ] %cmp17.i10.i.i = icmp eq i64 %sqr.040.i.i, 0 br i1 %cmp17.i10.i.i, label %MWC_MulMod64.exit37.i.i, label %while.body.i16.i.i while.body.i16.i.i: ; preds = %if.end.i.i, %MWC_AddMod64.exit16.i35.i.i %r.020.i11.i.i = phi i64 [ %r.1.i24.i.i, %MWC_AddMod64.exit16.i35.i.i ], [ 0, %if.end.i.i ] %a.addr.019.i12.i.i = phi i64 [ %shr.i33.i.i, %MWC_AddMod64.exit16.i35.i.i ], [ %sqr.040.i.i, %if.end.i.i ] %b.addr.018.i13.i.i = phi i64 [ %v.0.i15.i32.i.i, %MWC_AddMod64.exit16.i35.i.i ], [ %sqr.040.i.i, %if.end.i.i ] %and.i14.i.i = and i64 %a.addr.019.i12.i.i, 1 %tobool.i15.i.i = icmp eq i64 %and.i14.i.i, 0 br i1 %tobool.i15.i.i, label %if.end.i27.i.i, label %if.then.i19.i.i if.then.i19.i.i: ; preds = %while.body.i16.i.i %add.i.i17.i.i = add i64 %b.addr.018.i13.i.i, %r.020.i11.i.i %cmp.i.i18.i.i = icmp ult i64 %add.i.i17.i.i, -360523849793537 br i1 %cmp.i.i18.i.i, label %lor.lhs.false.i.i21.i.i, label %if.then.i.i23.i.i lor.lhs.false.i.i21.i.i: ; preds = %if.then.i19.i.i %6 = uitofp i64 %add.i.i17.i.i to float %7 = uitofp i64 %r.020.i11.i.i to float %cmp2.i.i20.i.i = fcmp olt float %6, %7 br i1 %cmp2.i.i20.i.i, label %if.then.i.i23.i.i, label %if.end.i27.i.i if.then.i.i23.i.i: ; preds = %lor.lhs.false.i.i21.i.i, %if.then.i19.i.i %sub.i.i22.i.i = add i64 %add.i.i17.i.i, 360523849793537 br label %if.end.i27.i.i if.end.i27.i.i: ; preds = %if.then.i.i23.i.i, %lor.lhs.false.i.i21.i.i, %while.body.i16.i.i %r.1.i24.i.i = phi i64 [ %r.020.i11.i.i, %while.body.i16.i.i ], [ %sub.i.i22.i.i, %if.then.i.i23.i.i ], [ %add.i.i17.i.i, %lor.lhs.false.i.i21.i.i ] %add.i9.i25.i.i = shl i64 %b.addr.018.i13.i.i, 1 %cmp.i10.i26.i.i = icmp ult i64 %add.i9.i25.i.i, -360523849793537 br i1 %cmp.i10.i26.i.i, label %lor.lhs.false.i12.i29.i.i, label %if.then.i14.i31.i.i lor.lhs.false.i12.i29.i.i: ; preds = %if.end.i27.i.i %8 = uitofp i64 %add.i9.i25.i.i to float %9 = uitofp i64 %b.addr.018.i13.i.i to float %cmp2.i11.i28.i.i = fcmp olt float %8, %9 br i1 %cmp2.i11.i28.i.i, label %if.then.i14.i31.i.i, label %MWC_AddMod64.exit16.i35.i.i if.then.i14.i31.i.i: ; preds = %lor.lhs.false.i12.i29.i.i, %if.end.i27.i.i %sub.i13.i30.i.i = add i64 %add.i9.i25.i.i, 360523849793537 br label %MWC_AddMod64.exit16.i35.i.i MWC_AddMod64.exit16.i35.i.i: ; preds = %if.then.i14.i31.i.i, %lor.lhs.false.i12.i29.i.i %v.0.i15.i32.i.i = phi i64 [ %sub.i13.i30.i.i, %if.then.i14.i31.i.i ], [ %add.i9.i25.i.i, %lor.lhs.false.i12.i29.i.i ] %shr.i33.i.i = lshr i64 %a.addr.019.i12.i.i, 1 %cmp.i34.i.i = icmp eq i64 %shr.i33.i.i, 0 br i1 %cmp.i34.i.i, label %MWC_MulMod64.exit37.i.i, label %while.body.i16.i.i MWC_MulMod64.exit37.i.i: ; preds = %MWC_AddMod64.exit16.i35.i.i, %if.end.i.i %r.0.lcssa.i36.i.i = phi i64 [ 0, %if.end.i.i ], [ %r.1.i24.i.i, %MWC_AddMod64.exit16.i35.i.i ] %shr.i.i = lshr i64 %e.addr.039.i.i, 1 %cmp.i.i = icmp eq i64 %shr.i.i, 0 br i1 %cmp.i.i, label %MWC_PowMod64.exit.i, label %while.body.i.i MWC_PowMod64.exit.i: ; preds = %MWC_MulMod64.exit37.i.i, %entry %acc.0.lcssa.i.i = phi i64 [ 1, %entry ], [ %acc.1.i.i, %MWC_MulMod64.exit37.i.i ] %conv.i = zext i32 %0 to i64 %mul.i = mul nuw i64 %conv.i, 4294883355 %conv1.i = zext i32 %1 to i64 %add.i = add i64 %mul.i, %conv1.i %cmp17.i.i = icmp eq i64 %add.i, 0 br i1 %cmp17.i.i, label %MWC_SkipImpl_Mod64.exit, label %while.body.i17.i while.body.i17.i: ; preds = %MWC_PowMod64.exit.i, %MWC_AddMod64.exit16.i.i %r.020.i.i = phi i64 [ %r.1.i.i, %MWC_AddMod64.exit16.i.i ], [ 0, %MWC_PowMod64.exit.i ] %a.addr.019.i.i = phi i64 [ %shr.i22.i, %MWC_AddMod64.exit16.i.i ], [ %add.i, %MWC_PowMod64.exit.i ] %b.addr.018.i.i = phi i64 [ %v.0.i15.i.i, %MWC_AddMod64.exit16.i.i ], [ %acc.0.lcssa.i.i, %MWC_PowMod64.exit.i ] %and.i15.i = and i64 %a.addr.019.i.i, 1 %tobool.i16.i = icmp eq i64 %and.i15.i, 0 br i1 %tobool.i16.i, label %if.end.i21.i, label %if.then.i19.i if.then.i19.i: ; preds = %while.body.i17.i %add.i.i.i = add i64 %b.addr.018.i.i, %r.020.i.i %cmp.i.i18.i = icmp ult i64 %add.i.i.i, -360523849793537 br i1 %cmp.i.i18.i, label %lor.lhs.false.i.i.i, label %if.then.i.i20.i lor.lhs.false.i.i.i: ; preds = %if.then.i19.i %10 = uitofp i64 %add.i.i.i to float %11 = uitofp i64 %r.020.i.i to float %cmp2.i.i.i = fcmp olt float %10, %11 br i1 %cmp2.i.i.i, label %if.then.i.i20.i, label %if.end.i21.i if.then.i.i20.i: ; preds = %lor.lhs.false.i.i.i, %if.then.i19.i %sub.i.i.i = add i64 %add.i.i.i, 360523849793537 br label %if.end.i21.i if.end.i21.i: ; preds = %if.then.i.i20.i, %lor.lhs.false.i.i.i, %while.body.i17.i %r.1.i.i = phi i64 [ %r.020.i.i, %while.body.i17.i ], [ %sub.i.i.i, %if.then.i.i20.i ], [ %add.i.i.i, %lor.lhs.false.i.i.i ] %add.i9.i.i = shl i64 %b.addr.018.i.i, 1 %cmp.i10.i.i = icmp ult i64 %add.i9.i.i, -360523849793537 br i1 %cmp.i10.i.i, label %lor.lhs.false.i12.i.i, label %if.then.i14.i.i lor.lhs.false.i12.i.i: ; preds = %if.end.i21.i %12 = uitofp i64 %add.i9.i.i to float %13 = uitofp i64 %b.addr.018.i.i to float %cmp2.i11.i.i = fcmp olt float %12, %13 br i1 %cmp2.i11.i.i, label %if.then.i14.i.i, label %MWC_AddMod64.exit16.i.i if.then.i14.i.i: ; preds = %lor.lhs.false.i12.i.i, %if.end.i21.i %sub.i13.i.i = add i64 %add.i9.i.i, 360523849793537 br label %MWC_AddMod64.exit16.i.i MWC_AddMod64.exit16.i.i: ; preds = %if.then.i14.i.i, %lor.lhs.false.i12.i.i %v.0.i15.i.i = phi i64 [ %sub.i13.i.i, %if.then.i14.i.i ], [ %add.i9.i.i, %lor.lhs.false.i12.i.i ] %shr.i22.i = lshr i64 %a.addr.019.i.i, 1 %cmp.i23.i = icmp eq i64 %shr.i22.i, 0 br i1 %cmp.i23.i, label %MWC_SkipImpl_Mod64.exit, label %while.body.i17.i MWC_SkipImpl_Mod64.exit: ; preds = %MWC_AddMod64.exit16.i.i, %MWC_PowMod64.exit.i %r.0.lcssa.i.i = phi i64 [ 0, %MWC_PowMod64.exit.i ], [ %r.1.i.i, %MWC_AddMod64.exit16.i.i ] %div.i = udiv i64 %r.0.lcssa.i.i, 4294883355 %conv3.i = trunc i64 %div.i to i32 %14 = mul i64 %div.i, 4294883355 %15 = sub i64 %r.0.lcssa.i.i, %14 %conv4.i = trunc i64 %15 to i32 store i32 %conv3.i, i32 addrspace(5)* %x, align 4, !tbaa !8 store i32 %conv4.i, i32 addrspace(5)* %c, align 4, !tbaa !10 ret void } ; Function Attrs: convergent nounwind define void @MWC64X_SeedStreams(%struct.mwc64x_state_t addrspace(5)* nocapture %s, i64 %baseOffset, i64 %perStreamOffset) local_unnamed_addr #4 { entry: %0 = tail call i32 @llvm.r600.read.tgid.x() #13 %x.i.i.i = tail call i32 @llvm.r600.read.local.size.x() #13 %1 = mul i32 %x.i.i.i, %0 %2 = tail call i32 @llvm.r600.read.tidig.x() #13, !range !3 %3 = add i32 %1, %2 %4 = tail call i8 addrspace(7)* @llvm.r600.implicitarg.ptr() #13 %5 = getelementptr inbounds i8, i8 addrspace(7)* %4, i32 4 %6 = bitcast i8 addrspace(7)* %5 to i32 addrspace(7)* %7 = load i32, i32 addrspace(7)* %6, align 4, !tbaa !4 %8 = add i32 %3, %7 %conv.i = zext i32 %8 to i64 %mul1.i = mul i64 %conv.i, %perStreamOffset %add2.i = add i64 %mul1.i, %baseOffset %cmp38.i.i = icmp eq i64 %add2.i, 0 br i1 %cmp38.i.i, label %while.body.i.i.preheader, label %while.body.i17.i while.body.i17.i: ; preds = %entry, %MWC_MulMod64.exit37.i.i %acc.041.i.i = phi i64 [ %acc.1.i.i, %MWC_MulMod64.exit37.i.i ], [ 1, %entry ] %sqr.040.i.i = phi i64 [ %r.0.lcssa.i36.i.i, %MWC_MulMod64.exit37.i.i ], [ 4294883355, %entry ] %e.addr.039.i.i = phi i64 [ %shr.i22.i, %MWC_MulMod64.exit37.i.i ], [ %add2.i, %entry ] %and.i15.i = and i64 %e.addr.039.i.i, 1 %tobool.i16.i = icmp eq i64 %and.i15.i, 0 br i1 %tobool.i16.i, label %if.end.i21.i, label %if.then.i18.i if.then.i18.i: ; preds = %while.body.i17.i %cmp17.i.i.i = icmp eq i64 %acc.041.i.i, 0 br i1 %cmp17.i.i.i, label %if.end.i21.i, label %while.body.i.i.i while.body.i.i.i: ; preds = %if.then.i18.i, %MWC_AddMod64.exit16.i.i.i %r.020.i.i.i = phi i64 [ %r.1.i.i.i, %MWC_AddMod64.exit16.i.i.i ], [ 0, %if.then.i18.i ] %a.addr.019.i.i.i = phi i64 [ %shr.i.i.i, %MWC_AddMod64.exit16.i.i.i ], [ %acc.041.i.i, %if.then.i18.i ] %b.addr.018.i.i.i = phi i64 [ %v.0.i15.i.i.i, %MWC_AddMod64.exit16.i.i.i ], [ %sqr.040.i.i, %if.then.i18.i ] %and.i.i.i = and i64 %a.addr.019.i.i.i, 1 %tobool.i.i.i = icmp eq i64 %and.i.i.i, 0 br i1 %tobool.i.i.i, label %if.end.i.i.i, label %if.then.i.i19.i if.then.i.i19.i: ; preds = %while.body.i.i.i %add.i.i.i.i = add i64 %b.addr.018.i.i.i, %r.020.i.i.i %cmp.i.i.i.i = icmp ult i64 %add.i.i.i.i, -360523849793537 br i1 %cmp.i.i.i.i, label %lor.lhs.false.i.i.i.i, label %if.then.i.i.i.i lor.lhs.false.i.i.i.i: ; preds = %if.then.i.i19.i %9 = uitofp i64 %add.i.i.i.i to float %10 = uitofp i64 %r.020.i.i.i to float %cmp2.i.i.i.i = fcmp olt float %9, %10 br i1 %cmp2.i.i.i.i, label %if.then.i.i.i.i, label %if.end.i.i.i if.then.i.i.i.i: ; preds = %lor.lhs.false.i.i.i.i, %if.then.i.i19.i %sub.i.i.i.i = add i64 %add.i.i.i.i, 360523849793537 br label %if.end.i.i.i if.end.i.i.i: ; preds = %if.then.i.i.i.i, %lor.lhs.false.i.i.i.i, %while.body.i.i.i %r.1.i.i.i = phi i64 [ %r.020.i.i.i, %while.body.i.i.i ], [ %sub.i.i.i.i, %if.then.i.i.i.i ], [ %add.i.i.i.i, %lor.lhs.false.i.i.i.i ] %add.i9.i.i.i = shl i64 %b.addr.018.i.i.i, 1 %cmp.i10.i.i.i = icmp ult i64 %add.i9.i.i.i, -360523849793537 br i1 %cmp.i10.i.i.i, label %lor.lhs.false.i12.i.i.i, label %if.then.i14.i.i.i lor.lhs.false.i12.i.i.i: ; preds = %if.end.i.i.i %11 = uitofp i64 %add.i9.i.i.i to float %12 = uitofp i64 %b.addr.018.i.i.i to float %cmp2.i11.i.i.i = fcmp olt float %11, %12 br i1 %cmp2.i11.i.i.i, label %if.then.i14.i.i.i, label %MWC_AddMod64.exit16.i.i.i if.then.i14.i.i.i: ; preds = %lor.lhs.false.i12.i.i.i, %if.end.i.i.i %sub.i13.i.i.i = add i64 %add.i9.i.i.i, 360523849793537 br label %MWC_AddMod64.exit16.i.i.i MWC_AddMod64.exit16.i.i.i: ; preds = %if.then.i14.i.i.i, %lor.lhs.false.i12.i.i.i %v.0.i15.i.i.i = phi i64 [ %sub.i13.i.i.i, %if.then.i14.i.i.i ], [ %add.i9.i.i.i, %lor.lhs.false.i12.i.i.i ] %shr.i.i.i = lshr i64 %a.addr.019.i.i.i, 1 %cmp.i.i20.i = icmp eq i64 %shr.i.i.i, 0 br i1 %cmp.i.i20.i, label %if.end.i21.i, label %while.body.i.i.i if.end.i21.i: ; preds = %MWC_AddMod64.exit16.i.i.i, %if.then.i18.i, %while.body.i17.i %acc.1.i.i = phi i64 [ %acc.041.i.i, %while.body.i17.i ], [ 0, %if.then.i18.i ], [ %r.1.i.i.i, %MWC_AddMod64.exit16.i.i.i ] %cmp17.i10.i.i = icmp eq i64 %sqr.040.i.i, 0 br i1 %cmp17.i10.i.i, label %MWC_MulMod64.exit37.i.i, label %while.body.i16.i.i while.body.i16.i.i: ; preds = %if.end.i21.i, %MWC_AddMod64.exit16.i35.i.i %r.020.i11.i.i = phi i64 [ %r.1.i24.i.i, %MWC_AddMod64.exit16.i35.i.i ], [ 0, %if.end.i21.i ] %a.addr.019.i12.i.i = phi i64 [ %shr.i33.i.i, %MWC_AddMod64.exit16.i35.i.i ], [ %sqr.040.i.i, %if.end.i21.i ] %b.addr.018.i13.i.i = phi i64 [ %v.0.i15.i32.i.i, %MWC_AddMod64.exit16.i35.i.i ], [ %sqr.040.i.i, %if.end.i21.i ] %and.i14.i.i = and i64 %a.addr.019.i12.i.i, 1 %tobool.i15.i.i = icmp eq i64 %and.i14.i.i, 0 br i1 %tobool.i15.i.i, label %if.end.i27.i.i, label %if.then.i19.i.i if.then.i19.i.i: ; preds = %while.body.i16.i.i %add.i.i17.i.i = add i64 %b.addr.018.i13.i.i, %r.020.i11.i.i %cmp.i.i18.i.i = icmp ult i64 %add.i.i17.i.i, -360523849793537 br i1 %cmp.i.i18.i.i, label %lor.lhs.false.i.i21.i.i, label %if.then.i.i23.i.i lor.lhs.false.i.i21.i.i: ; preds = %if.then.i19.i.i %13 = uitofp i64 %add.i.i17.i.i to float %14 = uitofp i64 %r.020.i11.i.i to float %cmp2.i.i20.i.i = fcmp olt float %13, %14 br i1 %cmp2.i.i20.i.i, label %if.then.i.i23.i.i, label %if.end.i27.i.i if.then.i.i23.i.i: ; preds = %lor.lhs.false.i.i21.i.i, %if.then.i19.i.i %sub.i.i22.i.i = add i64 %add.i.i17.i.i, 360523849793537 br label %if.end.i27.i.i if.end.i27.i.i: ; preds = %if.then.i.i23.i.i, %lor.lhs.false.i.i21.i.i, %while.body.i16.i.i %r.1.i24.i.i = phi i64 [ %r.020.i11.i.i, %while.body.i16.i.i ], [ %sub.i.i22.i.i, %if.then.i.i23.i.i ], [ %add.i.i17.i.i, %lor.lhs.false.i.i21.i.i ] %add.i9.i25.i.i = shl i64 %b.addr.018.i13.i.i, 1 %cmp.i10.i26.i.i = icmp ult i64 %add.i9.i25.i.i, -360523849793537 br i1 %cmp.i10.i26.i.i, label %lor.lhs.false.i12.i29.i.i, label %if.then.i14.i31.i.i lor.lhs.false.i12.i29.i.i: ; preds = %if.end.i27.i.i %15 = uitofp i64 %add.i9.i25.i.i to float %16 = uitofp i64 %b.addr.018.i13.i.i to float %cmp2.i11.i28.i.i = fcmp olt float %15, %16 br i1 %cmp2.i11.i28.i.i, label %if.then.i14.i31.i.i, label %MWC_AddMod64.exit16.i35.i.i if.then.i14.i31.i.i: ; preds = %lor.lhs.false.i12.i29.i.i, %if.end.i27.i.i %sub.i13.i30.i.i = add i64 %add.i9.i25.i.i, 360523849793537 br label %MWC_AddMod64.exit16.i35.i.i MWC_AddMod64.exit16.i35.i.i: ; preds = %if.then.i14.i31.i.i, %lor.lhs.false.i12.i29.i.i %v.0.i15.i32.i.i = phi i64 [ %sub.i13.i30.i.i, %if.then.i14.i31.i.i ], [ %add.i9.i25.i.i, %lor.lhs.false.i12.i29.i.i ] %shr.i33.i.i = lshr i64 %a.addr.019.i12.i.i, 1 %cmp.i34.i.i = icmp eq i64 %shr.i33.i.i, 0 br i1 %cmp.i34.i.i, label %MWC_MulMod64.exit37.i.i, label %while.body.i16.i.i MWC_MulMod64.exit37.i.i: ; preds = %MWC_AddMod64.exit16.i35.i.i, %if.end.i21.i %r.0.lcssa.i36.i.i = phi i64 [ 0, %if.end.i21.i ], [ %r.1.i24.i.i, %MWC_AddMod64.exit16.i35.i.i ] %shr.i22.i = lshr i64 %e.addr.039.i.i, 1 %cmp.i23.i = icmp eq i64 %shr.i22.i, 0 br i1 %cmp.i23.i, label %while.body.i.i.preheader, label %while.body.i17.i while.body.i.i.preheader: ; preds = %MWC_MulMod64.exit37.i.i, %entry %b.addr.018.i.i.ph = phi i64 [ 1, %entry ], [ %acc.1.i.i, %MWC_MulMod64.exit37.i.i ] br label %while.body.i.i while.body.i.i: ; preds = %MWC_AddMod64.exit16.i.i.1, %while.body.i.i.preheader %r.020.i.i = phi i64 [ 0, %while.body.i.i.preheader ], [ %r.1.i.i.1, %MWC_AddMod64.exit16.i.i.1 ] %a.addr.019.i.i = phi i64 [ 4077358422479273989, %while.body.i.i.preheader ], [ %shr.i.i, %MWC_AddMod64.exit16.i.i.1 ] %b.addr.018.i.i = phi i64 [ %b.addr.018.i.i.ph, %while.body.i.i.preheader ], [ %v.0.i15.i.i.1, %MWC_AddMod64.exit16.i.i.1 ] %and.i.i = and i64 %a.addr.019.i.i, 1 %tobool.i.i = icmp eq i64 %and.i.i, 0 br i1 %tobool.i.i, label %if.end.i.i, label %if.then.i.i if.then.i.i: ; preds = %while.body.i.i %add.i.i.i = add i64 %b.addr.018.i.i, %r.020.i.i %cmp.i.i.i = icmp ult i64 %add.i.i.i, -360523849793537 br i1 %cmp.i.i.i, label %lor.lhs.false.i.i.i, label %if.then.i.i.i lor.lhs.false.i.i.i: ; preds = %if.then.i.i %17 = uitofp i64 %add.i.i.i to float %18 = uitofp i64 %r.020.i.i to float %cmp2.i.i.i = fcmp olt float %17, %18 br i1 %cmp2.i.i.i, label %if.then.i.i.i, label %if.end.i.i if.then.i.i.i: ; preds = %lor.lhs.false.i.i.i, %if.then.i.i %sub.i.i.i = add i64 %add.i.i.i, 360523849793537 br label %if.end.i.i if.end.i.i: ; preds = %if.then.i.i.i, %lor.lhs.false.i.i.i, %while.body.i.i %r.1.i.i = phi i64 [ %r.020.i.i, %while.body.i.i ], [ %sub.i.i.i, %if.then.i.i.i ], [ %add.i.i.i, %lor.lhs.false.i.i.i ] %add.i9.i.i = shl i64 %b.addr.018.i.i, 1 %cmp.i10.i.i = icmp ult i64 %add.i9.i.i, -360523849793537 br i1 %cmp.i10.i.i, label %lor.lhs.false.i12.i.i, label %if.then.i14.i.i lor.lhs.false.i12.i.i: ; preds = %if.end.i.i %19 = uitofp i64 %add.i9.i.i to float %20 = uitofp i64 %b.addr.018.i.i to float %cmp2.i11.i.i = fcmp olt float %19, %20 br i1 %cmp2.i11.i.i, label %if.then.i14.i.i, label %MWC_AddMod64.exit16.i.i if.then.i14.i.i: ; preds = %lor.lhs.false.i12.i.i, %if.end.i.i %sub.i13.i.i = add i64 %add.i9.i.i, 360523849793537 br label %MWC_AddMod64.exit16.i.i MWC_AddMod64.exit16.i.i: ; preds = %if.then.i14.i.i, %lor.lhs.false.i12.i.i %v.0.i15.i.i = phi i64 [ %sub.i13.i.i, %if.then.i14.i.i ], [ %add.i9.i.i, %lor.lhs.false.i12.i.i ] %shr.i.i = lshr i64 %a.addr.019.i.i, 2 %and.i.i.1 = and i64 %a.addr.019.i.i, 2 %tobool.i.i.1 = icmp eq i64 %and.i.i.1, 0 br i1 %tobool.i.i.1, label %if.end.i.i.1, label %if.then.i.i.1 MWC_SeedImpl_Mod64.exit: ; preds = %MWC_AddMod64.exit16.i.i.1 %div.i = udiv i64 %r.1.i.i.1, 4294883355 %conv5.i = trunc i64 %div.i to i32 %21 = mul i64 %div.i, 4294883355 %22 = sub i64 %r.1.i.i.1, %21 %conv6.i = trunc i64 %22 to i32 %x = getelementptr inbounds %struct.mwc64x_state_t, %struct.mwc64x_state_t addrspace(5)* %s, i32 0, i32 0 store i32 %conv5.i, i32 addrspace(5)* %x, align 4, !tbaa !8 %c = getelementptr inbounds %struct.mwc64x_state_t, %struct.mwc64x_state_t addrspace(5)* %s, i32 0, i32 1 store i32 %conv6.i, i32 addrspace(5)* %c, align 4, !tbaa !10 ret void if.then.i.i.1: ; preds = %MWC_AddMod64.exit16.i.i %add.i.i.i.1 = add i64 %v.0.i15.i.i, %r.1.i.i %cmp.i.i.i.1 = icmp ult i64 %add.i.i.i.1, -360523849793537 br i1 %cmp.i.i.i.1, label %lor.lhs.false.i.i.i.1, label %if.then.i.i.i.1 lor.lhs.false.i.i.i.1: ; preds = %if.then.i.i.1 %23 = uitofp i64 %add.i.i.i.1 to float %24 = uitofp i64 %r.1.i.i to float %cmp2.i.i.i.1 = fcmp olt float %23, %24 br i1 %cmp2.i.i.i.1, label %if.then.i.i.i.1, label %if.end.i.i.1 if.then.i.i.i.1: ; preds = %lor.lhs.false.i.i.i.1, %if.then.i.i.1 %sub.i.i.i.1 = add i64 %add.i.i.i.1, 360523849793537 br label %if.end.i.i.1 if.end.i.i.1: ; preds = %if.then.i.i.i.1, %lor.lhs.false.i.i.i.1, %MWC_AddMod64.exit16.i.i %r.1.i.i.1 = phi i64 [ %r.1.i.i, %MWC_AddMod64.exit16.i.i ], [ %sub.i.i.i.1, %if.then.i.i.i.1 ], [ %add.i.i.i.1, %lor.lhs.false.i.i.i.1 ] %add.i9.i.i.1 = shl i64 %v.0.i15.i.i, 1 %cmp.i10.i.i.1 = icmp ult i64 %add.i9.i.i.1, -360523849793537 br i1 %cmp.i10.i.i.1, label %lor.lhs.false.i12.i.i.1, label %if.then.i14.i.i.1 lor.lhs.false.i12.i.i.1: ; preds = %if.end.i.i.1 %25 = uitofp i64 %add.i9.i.i.1 to float %26 = uitofp i64 %v.0.i15.i.i to float %cmp2.i11.i.i.1 = fcmp olt float %25, %26 br i1 %cmp2.i11.i.i.1, label %if.then.i14.i.i.1, label %MWC_AddMod64.exit16.i.i.1 if.then.i14.i.i.1: ; preds = %lor.lhs.false.i12.i.i.1, %if.end.i.i.1 %sub.i13.i.i.1 = add i64 %add.i9.i.i.1, 360523849793537 br label %MWC_AddMod64.exit16.i.i.1 MWC_AddMod64.exit16.i.i.1: ; preds = %if.then.i14.i.i.1, %lor.lhs.false.i12.i.i.1 %v.0.i15.i.i.1 = phi i64 [ %sub.i13.i.i.1, %if.then.i14.i.i.1 ], [ %add.i9.i.i.1, %lor.lhs.false.i12.i.i.1 ] %cmp.i.i.1 = icmp eq i64 %shr.i.i, 0 br i1 %cmp.i.i.1, label %MWC_SeedImpl_Mod64.exit, label %while.body.i.i } ; Function Attrs: norecurse nounwind define i32 @MWC64X_NextUint(%struct.mwc64x_state_t addrspace(5)* nocapture %s) local_unnamed_addr #3 { entry: %x = getelementptr inbounds %struct.mwc64x_state_t, %struct.mwc64x_state_t addrspace(5)* %s, i32 0, i32 0 %0 = load i32, i32 addrspace(5)* %x, align 4, !tbaa !8 %c = getelementptr inbounds %struct.mwc64x_state_t, %struct.mwc64x_state_t addrspace(5)* %s, i32 0, i32 1 %1 = load i32, i32 addrspace(5)* %c, align 4, !tbaa !10 %xor = xor i32 %1, %0 %mul.i = mul i32 %0, -83941 %add.i = add i32 %mul.i, %1 %cmp.i = icmp ult i32 %add.i, %1 %conv.i = zext i1 %cmp.i to i32 %2 = zext i32 %0 to i64 %3 = mul nuw i64 %2, 4294883355 %4 = lshr i64 %3, 32 %5 = trunc i64 %4 to i32 %add1.i = add i32 %5, %conv.i store i32 %add.i, i32 addrspace(5)* %x, align 4, !tbaa !8 store i32 %add1.i, i32 addrspace(5)* %c, align 4, !tbaa !10 ret i32 %xor } ; Function Attrs: norecurse nounwind define float @mwcReadPseudoRandomValue(%struct.mwc64x_state_t addrspace(5)* nocapture %rng) local_unnamed_addr #3 { entry: %x.i = getelementptr inbounds %struct.mwc64x_state_t, %struct.mwc64x_state_t addrspace(5)* %rng, i32 0, i32 0 %0 = load i32, i32 addrspace(5)* %x.i, align 4, !tbaa !8 %c.i = getelementptr inbounds %struct.mwc64x_state_t, %struct.mwc64x_state_t addrspace(5)* %rng, i32 0, i32 1 %1 = load i32, i32 addrspace(5)* %c.i, align 4, !tbaa !10 %xor.i = xor i32 %1, %0 %mul.i.i = mul i32 %0, -83941 %add.i.i = add i32 %mul.i.i, %1 %cmp.i.i = icmp ult i32 %add.i.i, %1 %conv.i.i = zext i1 %cmp.i.i to i32 %2 = zext i32 %0 to i64 %3 = mul nuw i64 %2, 4294883355 %4 = lshr i64 %3, 32 %5 = trunc i64 %4 to i32 %add1.i.i = add i32 %5, %conv.i.i store i32 %add.i.i, i32 addrspace(5)* %x.i, align 4, !tbaa !8 store i32 %add1.i.i, i32 addrspace(5)* %c.i, align 4, !tbaa !10 %conv = uitofp i32 %xor.i to float %div = fmul float %conv, 0x3DF0000000000000 ret float %div } ; Function Attrs: convergent nounwind define float @mwcGenerateDifferentialNoise(%struct.mwc64x_state_t addrspace(5)* nocapture %r, float %pixel, i32 %noise_type, float %attenuate) local_unnamed_addr #4 { entry: %x.i.i = getelementptr inbounds %struct.mwc64x_state_t, %struct.mwc64x_state_t addrspace(5)* %r, i32 0, i32 0 %0 = load i32, i32 addrspace(5)* %x.i.i, align 4, !tbaa !8 %c.i.i = getelementptr inbounds %struct.mwc64x_state_t, %struct.mwc64x_state_t addrspace(5)* %r, i32 0, i32 1 %1 = load i32, i32 addrspace(5)* %c.i.i, align 4, !tbaa !10 %xor.i.i = xor i32 %1, %0 %mul.i.i.i = mul i32 %0, -83941 %add.i.i.i = add i32 %mul.i.i.i, %1 %cmp.i.i.i = icmp ult i32 %add.i.i.i, %1 %conv.i.i.i = zext i1 %cmp.i.i.i to i32 %2 = zext i32 %0 to i64 %3 = mul nuw i64 %2, 4294883355 %4 = lshr i64 %3, 32 %5 = trunc i64 %4 to i32 %add1.i.i.i = add i32 %5, %conv.i.i.i store i32 %add.i.i.i, i32 addrspace(5)* %x.i.i, align 4, !tbaa !8 store i32 %add1.i.i.i, i32 addrspace(5)* %c.i.i, align 4, !tbaa !10 %conv.i = uitofp i32 %xor.i.i to float %div.i = fmul float %conv.i, 0x3DF0000000000000 switch i32 %noise_type, label %sw.default [ i32 7, label %sw.bb87 i32 2, label %sw.bb3 i32 4, label %sw.bb21 i32 5, label %sw.bb33 i32 3, label %sw.bb59 i32 6, label %sw.bb75 ] sw.default: ; preds = %entry %mul = fmul float %attenuate, 1.562500e-02 %mul1 = fmul float %mul, 6.553500e+04 %sub = fadd float %div.i, -5.000000e-01 %6 = tail call float @llvm.fmuladd.f32(float %mul1, float %sub, float %pixel) br label %sw.epilog sw.bb3: ; preds = %entry %cmp = fcmp oeq float %div.i, 0.000000e+00 %alpha.0 = select i1 %cmp, float 1.000000e+00, float %div.i %xor.i.i167 = xor i32 %add1.i.i.i, %add.i.i.i %mul.i.i.i168 = mul i32 %add.i.i.i, -83941 %add.i.i.i169 = add i32 %add1.i.i.i, %mul.i.i.i168 %cmp.i.i.i170 = icmp ult i32 %add.i.i.i169, %add1.i.i.i %conv.i.i.i171 = zext i1 %cmp.i.i.i170 to i32 %7 = zext i32 %add.i.i.i to i64 %8 = mul nuw i64 %7, 4294883355 %9 = lshr i64 %8, 32 %10 = trunc i64 %9 to i32 %add1.i.i.i172 = add i32 %conv.i.i.i171, %10 store i32 %add.i.i.i169, i32 addrspace(5)* %x.i.i, align 4, !tbaa !8 store i32 %add1.i.i.i172, i32 addrspace(5)* %c.i.i, align 4, !tbaa !10 %conv.i173 = uitofp i32 %xor.i.i167 to float %div.i174 = fmul float %conv.i173, 0x3DF0000000000000 %11 = bitcast float %alpha.0 to i32 %12 = and i32 %11, 2147483647 %13 = fadd float %alpha.0, -1.000000e+00 %14 = tail call float @llvm.fabs.f32(float %13) #14 %15 = fcmp olt float %14, 6.250000e-02 %16 = fadd float %13, 2.000000e+00 %17 = fdiv float %13, %16, !fpmath !11 %18 = fmul float %13, %17 %19 = fadd float %17, %17 %20 = fmul float %19, %19 %21 = tail call float @llvm.fmuladd.f32(float %20, float 0x3F899999A0000000, float 0x3FB5555560000000) #13 %22 = fmul float %20, %21 %23 = fsub float -0.000000e+00, %18 %24 = tail call float @llvm.fmuladd.f32(float %19, float %22, float %23) #13 %25 = bitcast float %13 to i32 %26 = and i32 %25, -65536 %27 = bitcast i32 %26 to float %28 = fsub float %13, %27 %29 = fadd float %28, %24 %30 = fmul float %29, 0x3F75476520000000 %31 = tail call float @llvm.fmuladd.f32(float %27, float 0x3F75476520000000, float %30) #13 %32 = tail call float @llvm.fmuladd.f32(float %29, float 1.437500e+00, float %31) #13 %33 = tail call float @llvm.fmuladd.f32(float %27, float 1.437500e+00, float %32) #13 %34 = lshr i32 %11, 23 %35 = add nsw i32 %34, -127 %36 = or i32 %11, 1065353216 %37 = bitcast i32 %36 to float %38 = fadd float %37, -1.000000e+00 %39 = bitcast float %38 to i32 %40 = lshr i32 %39, 23 %41 = add nsw i32 %40, -253 %42 = icmp eq i32 %34, 0 %43 = select i1 %42, i32 %41, i32 %35 %44 = select i1 %42, i32 %39, i32 %11 %45 = sitofp i32 %43 to float %46 = and i32 %44, 8323072 %47 = shl i32 %44, 1 %48 = and i32 %47, 65536 %49 = add nuw nsw i32 %48, %46 %50 = or i32 %49, 1056964608 %51 = bitcast i32 %50 to float %52 = and i32 %44, 8388607 %53 = or i32 %52, 1056964608 %54 = bitcast i32 %53 to float %55 = fsub float %51, %54 %56 = lshr exact i32 %49, 16 %57 = getelementptr inbounds [129 x float], [129 x float] addrspace(4)* @LOG_INV_TBL, i32 0, i32 %56 %58 = load float, float addrspace(4)* %57, align 4, !tbaa !12 %59 = fmul float %55, %58 %60 = tail call float @llvm.fmuladd.f32(float %59, float 0x3FD5555560000000, float 5.000000e-01) #13 %61 = fmul float %59, %59 %62 = tail call float @llvm.fmuladd.f32(float %60, float %61, float %59) #13 %63 = getelementptr inbounds [129 x <2 x float>], [129 x <2 x float>] addrspace(4)* @LOG2_TBL, i32 0, i32 %56 %64 = load <2 x float>, <2 x float> addrspace(4)* %63, align 8, !tbaa !14 %65 = extractelement <2 x float> %64, i32 0 %66 = fadd float %65, %45 %67 = extractelement <2 x float> %64, i32 1 %68 = tail call float @llvm.fmuladd.f32(float %62, float 0xBFF7154760000000, float %67) #13 %69 = fadd float %66, %68 %70 = select i1 %15, float %33, float %69 %71 = icmp ugt i32 %12, 2139095039 %72 = select i1 %71, float %alpha.0, float %70 %73 = icmp eq i32 %12, %11 %74 = icmp eq i32 %12, 0 %.op1.i163 = fmul float %72, 0x3FE62E4300000000 %.op1.i163.op = fmul float %.op1.i163, -2.000000e+00 %.op.i164.op = select i1 %73, float %.op1.i163.op, float 0x7FF8000000000000 %mul6 = select i1 %74, float 0x7FF0000000000000, float %.op.i164.op %75 = fcmp olt float %mul6, 0.000000e+00 %76 = tail call float @llvm.sqrt.f32(float %mul6) #14 %77 = select i1 %75, float 0x7FF8000000000000, float %76 %mul8 = fmul float %div.i174, 2.000000e+00 %78 = bitcast float %mul8 to i32 %79 = and i32 %78, 2147483647 %80 = bitcast i32 %79 to float %81 = fptosi float %80 to i32 %82 = sitofp i32 %81 to float %83 = fsub float %80, %82 %84 = shl i32 %81, 31 %85 = icmp ult i32 %79, 2139095040 %86 = select i1 %85, i32 1065353216, i32 2143289344 %87 = icmp ult i32 %79, 1266679808 %88 = or i32 %84, 1065353216 %89 = select i1 %87, i32 %88, i32 %86 %90 = fsub float 1.000000e+00, %83 %91 = xor i32 %84, -2147483648 %92 = fcmp ole float %83, 7.500000e-01 %93 = fadd float %83, -5.000000e-01 %94 = select i1 %92, float %93, float %90 %95 = xor i1 %92, true %96 = fcmp olt float %83, 5.000000e-01 %97 = fsub float 5.000000e-01, %83 %98 = select i1 %96, float %97, float %94 %99 = select i1 %96, i32 %84, i32 %91 %100 = fcmp ole float %83, 2.500000e-01 %101 = select i1 %100, float %83, float %98 %102 = or i1 %100, %95 %103 = fmul float %101, 0x400921FB60000000 %104 = fmul float %103, %103 %105 = fmul float %103, %104 %106 = tail call float @llvm.fmuladd.f32(float %104, float 0x3EC6DBE4A0000000, float 0xBF2A013A80000000) #13 %107 = tail call float @llvm.fmuladd.f32(float %104, float %106, float 0x3F811110E0000000) #13 %108 = tail call float @llvm.fmuladd.f32(float %104, float %107, float 0xBFC5555560000000) #13 %109 = tail call float @llvm.fmuladd.f32(float %105, float %108, float %103) #13 %110 = fmul float %104, %104 %111 = tail call float @llvm.fmuladd.f32(float %104, float 0xBE92524740000000, float 0x3EFA015C60000000) #13 %112 = tail call float @llvm.fmuladd.f32(float %104, float %111, float 0xBF56C16C00000000) #13 %113 = tail call float @llvm.fmuladd.f32(float %104, float %112, float 0x3FA5555560000000) #13 %114 = tail call float @llvm.fmuladd.f32(float %104, float -5.000000e-01, float 1.000000e+00) #13 %115 = tail call float @llvm.fmuladd.f32(float %110, float %113, float %114) #13 %116 = select i1 %102, float %115, float %109 %117 = bitcast float %116 to i32 %118 = xor i32 %99, %117 %119 = icmp ult i32 %79, 1258291200 %120 = select i1 %119, i32 %118, i32 %89 %121 = bitcast i32 %120 to float %mul10 = fmul float %77, %121 %122 = and i32 %78, -2147483648 %123 = xor i32 %84, %122 %124 = select i1 %85, i32 %122, i32 2143289344 %125 = xor i1 %100, true %126 = and i1 %92, %125 %127 = select i1 %126, float %115, float %109 %128 = bitcast float %127 to i32 %129 = xor i32 %123, %128 %130 = select i1 %119, i32 %129, i32 %124 %131 = bitcast i32 %130 to float %mul13 = fmul float %77, %131 %132 = fcmp olt float %pixel, 0.000000e+00 %133 = tail call float @llvm.sqrt.f32(float %pixel) #14 %134 = select i1 %132, float 0x7FF8000000000000, float %133 %mul15 = fmul float %attenuate, 1.562500e-02 %mul16 = fmul float %134, %mul15 %135 = tail call float @llvm.fmuladd.f32(float %mul16, float %mul10, float %pixel) %mul18 = fmul float %attenuate, 7.812500e-02 %mul19 = fmul float %mul18, 6.553500e+04 %136 = tail call float @llvm.fmuladd.f32(float %mul19, float %mul13, float %135) br label %sw.epilog sw.bb21: ; preds = %entry %mul22 = fmul float %attenuate, 0x3FB99999A0000000 %div = fmul float %mul22, 5.000000e-01 %cmp23 = fcmp olt float %div.i, %div br i1 %cmp23, label %sw.epilog, label %if.else if.else: ; preds = %sw.bb21 %sub27 = fsub float 1.000000e+00, %div %cmp28 = fcmp ult float %div.i, %sub27 %pixel. = select i1 %cmp28, float %pixel, float 6.553500e+04 br label %sw.epilog sw.bb33: ; preds = %entry %cmp34 = fcmp ugt float %div.i, 5.000000e-01 br i1 %cmp34, label %if.end46, label %if.then35 if.then35: ; preds = %sw.bb33 %cmp36 = fcmp ugt float %div.i, 0.000000e+00 br i1 %cmp36, label %if.else39, label %if.then37 if.then37: ; preds = %if.then35 %sub38 = fadd float %pixel, -6.553500e+04 br label %sw.epilog if.else39: ; preds = %if.then35 %mul40 = fmul float %attenuate, 3.906250e-02 %mul41 = fmul float %mul40, 6.553500e+04 %mul42 = fmul float %div.i, 2.000000e+00 %137 = bitcast float %mul42 to i32 %138 = and i32 %137, 2147483647 %139 = fadd float %mul42, -1.000000e+00 %140 = tail call float @llvm.fabs.f32(float %139) #14 %141 = fcmp olt float %140, 6.250000e-02 %142 = fadd float %139, 2.000000e+00 %143 = fdiv float %139, %142, !fpmath !11 %144 = fmul float %139, %143 %145 = fadd float %143, %143 %146 = fmul float %145, %145 %147 = tail call float @llvm.fmuladd.f32(float %146, float 0x3F899999A0000000, float 0x3FB5555560000000) #13 %148 = fmul float %146, %147 %149 = fsub float -0.000000e+00, %144 %150 = tail call float @llvm.fmuladd.f32(float %145, float %148, float %149) #13 %151 = bitcast float %139 to i32 %152 = and i32 %151, -65536 %153 = bitcast i32 %152 to float %154 = fsub float %139, %153 %155 = fadd float %154, %150 %156 = fmul float %155, 0x3F75476520000000 %157 = tail call float @llvm.fmuladd.f32(float %153, float 0x3F75476520000000, float %156) #13 %158 = tail call float @llvm.fmuladd.f32(float %155, float 1.437500e+00, float %157) #13 %159 = tail call float @llvm.fmuladd.f32(float %153, float 1.437500e+00, float %158) #13 %160 = lshr i32 %137, 23 %161 = add nsw i32 %160, -127 %162 = or i32 %137, 1065353216 %163 = bitcast i32 %162 to float %164 = fadd float %163, -1.000000e+00 %165 = bitcast float %164 to i32 %166 = lshr i32 %165, 23 %167 = add nsw i32 %166, -253 %168 = icmp eq i32 %160, 0 %169 = select i1 %168, i32 %167, i32 %161 %170 = select i1 %168, i32 %165, i32 %137 %171 = sitofp i32 %169 to float %172 = and i32 %170, 8323072 %173 = shl i32 %170, 1 %174 = and i32 %173, 65536 %175 = add nuw nsw i32 %174, %172 %176 = or i32 %175, 1056964608 %177 = bitcast i32 %176 to float %178 = and i32 %170, 8388607 %179 = or i32 %178, 1056964608 %180 = bitcast i32 %179 to float %181 = fsub float %177, %180 %182 = lshr exact i32 %175, 16 %183 = getelementptr inbounds [129 x float], [129 x float] addrspace(4)* @LOG_INV_TBL, i32 0, i32 %182 %184 = load float, float addrspace(4)* %183, align 4, !tbaa !12 %185 = fmul float %181, %184 %186 = tail call float @llvm.fmuladd.f32(float %185, float 0x3FD5555560000000, float 5.000000e-01) #13 %187 = fmul float %185, %185 %188 = tail call float @llvm.fmuladd.f32(float %186, float %187, float %185) #13 %189 = getelementptr inbounds [129 x <2 x float>], [129 x <2 x float>] addrspace(4)* @LOG2_TBL, i32 0, i32 %182 %190 = load <2 x float>, <2 x float> addrspace(4)* %189, align 8, !tbaa !14 %191 = extractelement <2 x float> %190, i32 0 %192 = fadd float %191, %171 %193 = extractelement <2 x float> %190, i32 1 %194 = tail call float @llvm.fmuladd.f32(float %188, float 0xBFF7154760000000, float %193) #13 %195 = fadd float %192, %194 %196 = select i1 %141, float %159, float %195 %197 = icmp ugt i32 %138, 2139095039 %198 = select i1 %197, float %mul42, float %196 %199 = icmp eq i32 %138, %137 %200 = icmp eq i32 %138, 0 %.op1.i161 = fmul float %198, 0x3FE62E4300000000 %.op.i162 = select i1 %199, float %.op1.i161, float 0x7FF8000000000000 %201 = select i1 %200, float 0xFFF0000000000000, float %.op.i162 %202 = tail call float @llvm.fmuladd.f32(float %mul41, float %201, float %pixel) %add = fadd float %202, 5.000000e-01 br label %sw.epilog if.end46: ; preds = %sw.bb33 %sub47 = fsub float 1.000000e+00, %div.i %cmp48 = fcmp ugt float %sub47, 0.000000e+00 br i1 %cmp48, label %if.else51, label %if.then49 if.then49: ; preds = %if.end46 %add50 = fadd float %pixel, 6.553500e+04 br label %sw.epilog if.else51: ; preds = %if.end46 %mul52 = fmul float %attenuate, 3.906250e-02 %mul53 = fmul float %mul52, 6.553500e+04 %mul54 = fmul float %sub47, 2.000000e+00 %203 = bitcast float %mul54 to i32 %204 = and i32 %203, 2147483647 %205 = fadd float %mul54, -1.000000e+00 %206 = tail call float @llvm.fabs.f32(float %205) #14 %207 = fcmp olt float %206, 6.250000e-02 %208 = fadd float %205, 2.000000e+00 %209 = fdiv float %205, %208, !fpmath !11 %210 = fmul float %205, %209 %211 = fadd float %209, %209 %212 = fmul float %211, %211 %213 = tail call float @llvm.fmuladd.f32(float %212, float 0x3F899999A0000000, float 0x3FB5555560000000) #13 %214 = fmul float %212, %213 %215 = fsub float -0.000000e+00, %210 %216 = tail call float @llvm.fmuladd.f32(float %211, float %214, float %215) #13 %217 = bitcast float %205 to i32 %218 = and i32 %217, -65536 %219 = bitcast i32 %218 to float %220 = fsub float %205, %219 %221 = fadd float %220, %216 %222 = fmul float %221, 0x3F75476520000000 %223 = tail call float @llvm.fmuladd.f32(float %219, float 0x3F75476520000000, float %222) #13 %224 = tail call float @llvm.fmuladd.f32(float %221, float 1.437500e+00, float %223) #13 %225 = tail call float @llvm.fmuladd.f32(float %219, float 1.437500e+00, float %224) #13 %226 = lshr i32 %203, 23 %227 = add nsw i32 %226, -127 %228 = or i32 %203, 1065353216 %229 = bitcast i32 %228 to float %230 = fadd float %229, -1.000000e+00 %231 = bitcast float %230 to i32 %232 = lshr i32 %231, 23 %233 = add nsw i32 %232, -253 %234 = icmp eq i32 %226, 0 %235 = select i1 %234, i32 %233, i32 %227 %236 = select i1 %234, i32 %231, i32 %203 %237 = sitofp i32 %235 to float %238 = and i32 %236, 8323072 %239 = shl i32 %236, 1 %240 = and i32 %239, 65536 %241 = add nuw nsw i32 %240, %238 %242 = or i32 %241, 1056964608 %243 = bitcast i32 %242 to float %244 = and i32 %236, 8388607 %245 = or i32 %244, 1056964608 %246 = bitcast i32 %245 to float %247 = fsub float %243, %246 %248 = lshr exact i32 %241, 16 %249 = getelementptr inbounds [129 x float], [129 x float] addrspace(4)* @LOG_INV_TBL, i32 0, i32 %248 %250 = load float, float addrspace(4)* %249, align 4, !tbaa !12 %251 = fmul float %247, %250 %252 = tail call float @llvm.fmuladd.f32(float %251, float 0x3FD5555560000000, float 5.000000e-01) #13 %253 = fmul float %251, %251 %254 = tail call float @llvm.fmuladd.f32(float %252, float %253, float %251) #13 %255 = getelementptr inbounds [129 x <2 x float>], [129 x <2 x float>] addrspace(4)* @LOG2_TBL, i32 0, i32 %248 %256 = load <2 x float>, <2 x float> addrspace(4)* %255, align 8, !tbaa !14 %257 = extractelement <2 x float> %256, i32 0 %258 = fadd float %257, %237 %259 = extractelement <2 x float> %256, i32 1 %260 = tail call float @llvm.fmuladd.f32(float %254, float 0xBFF7154760000000, float %259) #13 %261 = fadd float %258, %260 %262 = select i1 %207, float %225, float %261 %263 = icmp ugt i32 %204, 2139095039 %264 = select i1 %263, float %mul54, float %262 %265 = icmp eq i32 %204, %203 %266 = icmp eq i32 %204, 0 %.op1.i159 = fmul float %264, 0x3FE62E4300000000 %.op.i160 = select i1 %265, float %.op1.i159, float 0x7FF8000000000000 %267 = select i1 %266, float 0xFFF0000000000000, float %.op.i160 %neg = fsub float -0.000000e+00, %mul53 %268 = tail call float @llvm.fmuladd.f32(float %neg, float %267, float %pixel) %add57 = fadd float %268, 5.000000e-01 br label %sw.epilog sw.bb59: ; preds = %entry %cmp60 = fcmp ogt float %div.i, 0.000000e+00 br i1 %cmp60, label %if.then61, label %if.end65 if.then61: ; preds = %sw.bb59 %269 = bitcast float %div.i to i32 %270 = and i32 %269, 2147483647 %271 = fadd float %div.i, -1.000000e+00 %272 = tail call float @llvm.fabs.f32(float %271) #14 %273 = fcmp olt float %272, 6.250000e-02 %274 = fadd float %271, 2.000000e+00 %275 = fdiv float %271, %274, !fpmath !11 %276 = fmul float %271, %275 %277 = fadd float %275, %275 %278 = fmul float %277, %277 %279 = tail call float @llvm.fmuladd.f32(float %278, float 0x3F899999A0000000, float 0x3FB5555560000000) #13 %280 = fmul float %278, %279 %281 = fsub float -0.000000e+00, %276 %282 = tail call float @llvm.fmuladd.f32(float %277, float %280, float %281) #13 %283 = bitcast float %271 to i32 %284 = and i32 %283, -65536 %285 = bitcast i32 %284 to float %286 = fsub float %271, %285 %287 = fadd float %286, %282 %288 = fmul float %287, 0x3F75476520000000 %289 = tail call float @llvm.fmuladd.f32(float %285, float 0x3F75476520000000, float %288) #13 %290 = tail call float @llvm.fmuladd.f32(float %287, float 1.437500e+00, float %289) #13 %291 = tail call float @llvm.fmuladd.f32(float %285, float 1.437500e+00, float %290) #13 %292 = lshr i32 %269, 23 %293 = add nsw i32 %292, -127 %294 = or i32 %269, 1065353216 %295 = bitcast i32 %294 to float %296 = fadd float %295, -1.000000e+00 %297 = bitcast float %296 to i32 %298 = lshr i32 %297, 23 %299 = add nsw i32 %298, -253 %300 = icmp eq i32 %292, 0 %301 = select i1 %300, i32 %299, i32 %293 %302 = select i1 %300, i32 %297, i32 %269 %303 = sitofp i32 %301 to float %304 = and i32 %302, 8323072 %305 = shl i32 %302, 1 %306 = and i32 %305, 65536 %307 = add nuw nsw i32 %306, %304 %308 = or i32 %307, 1056964608 %309 = bitcast i32 %308 to float %310 = and i32 %302, 8388607 %311 = or i32 %310, 1056964608 %312 = bitcast i32 %311 to float %313 = fsub float %309, %312 %314 = lshr exact i32 %307, 16 %315 = getelementptr inbounds [129 x float], [129 x float] addrspace(4)* @LOG_INV_TBL, i32 0, i32 %314 %316 = load float, float addrspace(4)* %315, align 4, !tbaa !12 %317 = fmul float %313, %316 %318 = tail call float @llvm.fmuladd.f32(float %317, float 0x3FD5555560000000, float 5.000000e-01) #13 %319 = fmul float %317, %317 %320 = tail call float @llvm.fmuladd.f32(float %318, float %319, float %317) #13 %321 = getelementptr inbounds [129 x <2 x float>], [129 x <2 x float>] addrspace(4)* @LOG2_TBL, i32 0, i32 %314 %322 = load <2 x float>, <2 x float> addrspace(4)* %321, align 8, !tbaa !14 %323 = extractelement <2 x float> %322, i32 0 %324 = fadd float %323, %303 %325 = extractelement <2 x float> %322, i32 1 %326 = tail call float @llvm.fmuladd.f32(float %320, float 0xBFF7154760000000, float %325) #13 %327 = fadd float %324, %326 %328 = select i1 %273, float %291, float %327 %329 = icmp ugt i32 %270, 2139095039 %330 = select i1 %329, float %div.i, float %328 %331 = icmp eq i32 %270, %269 %332 = icmp eq i32 %270, 0 %.op1.i = fmul float %330, 0x3FE62E4300000000 %.op1.i.op = fmul float %.op1.i, -2.000000e+00 %.op.i.op = select i1 %331, float %.op1.i.op, float 0x7FF8000000000000 %mul63 = select i1 %332, float 0x7FF0000000000000, float %.op.i.op %333 = fcmp olt float %mul63, 0.000000e+00 %334 = tail call float @llvm.sqrt.f32(float %mul63) #14 %335 = select i1 %333, float 0x7FF8000000000000, float %334 br label %if.end65 if.end65: ; preds = %if.then61, %sw.bb59 %sigma.0 = phi float [ %335, %if.then61 ], [ 1.000000e+00, %sw.bb59 ] %xor.i.i151 = xor i32 %add1.i.i.i, %add.i.i.i %mul.i.i.i152 = mul i32 %add.i.i.i, -83941 %add.i.i.i153 = add i32 %add1.i.i.i, %mul.i.i.i152 %cmp.i.i.i154 = icmp ult i32 %add.i.i.i153, %add1.i.i.i %conv.i.i.i155 = zext i1 %cmp.i.i.i154 to i32 %336 = zext i32 %add.i.i.i to i64 %337 = mul nuw i64 %336, 4294883355 %338 = lshr i64 %337, 32 %339 = trunc i64 %338 to i32 %add1.i.i.i156 = add i32 %conv.i.i.i155, %339 store i32 %add.i.i.i153, i32 addrspace(5)* %x.i.i, align 4, !tbaa !8 store i32 %add1.i.i.i156, i32 addrspace(5)* %c.i.i, align 4, !tbaa !10 %conv.i157 = uitofp i32 %xor.i.i151 to float %div.i158 = fmul float %conv.i157, 0x3DF0000000000000 %mul67 = fmul float %attenuate, 5.000000e-01 %mul68 = fmul float %mul67, %pixel %mul69 = fmul float %mul68, %sigma.0 %mul70 = fmul float %div.i158, 2.000000e+00 %340 = bitcast float %mul70 to i32 %341 = and i32 %340, 2147483647 %342 = bitcast i32 %341 to float %343 = fptosi float %342 to i32 %344 = sitofp i32 %343 to float %345 = fsub float %342, %344 %346 = shl i32 %343, 31 %347 = icmp ult i32 %341, 2139095040 %348 = select i1 %347, i32 1065353216, i32 2143289344 %349 = icmp ult i32 %341, 1266679808 %350 = or i32 %346, 1065353216 %351 = select i1 %349, i32 %350, i32 %348 %352 = fsub float 1.000000e+00, %345 %353 = xor i32 %346, -2147483648 %354 = fcmp ole float %345, 7.500000e-01 %355 = fadd float %345, -5.000000e-01 %356 = select i1 %354, float %355, float %352 %357 = xor i1 %354, true %358 = fcmp olt float %345, 5.000000e-01 %359 = fsub float 5.000000e-01, %345 %360 = select i1 %358, float %359, float %356 %361 = select i1 %358, i32 %346, i32 %353 %362 = fcmp ole float %345, 2.500000e-01 %363 = select i1 %362, float %345, float %360 %364 = or i1 %362, %357 %365 = fmul float %363, 0x400921FB60000000 %366 = fmul float %365, %365 %367 = fmul float %365, %366 %368 = tail call float @llvm.fmuladd.f32(float %366, float 0x3EC6DBE4A0000000, float 0xBF2A013A80000000) #13 %369 = tail call float @llvm.fmuladd.f32(float %366, float %368, float 0x3F811110E0000000) #13 %370 = tail call float @llvm.fmuladd.f32(float %366, float %369, float 0xBFC5555560000000) #13 %371 = tail call float @llvm.fmuladd.f32(float %367, float %370, float %365) #13 %372 = fmul float %366, %366 %373 = tail call float @llvm.fmuladd.f32(float %366, float 0xBE92524740000000, float 0x3EFA015C60000000) #13 %374 = tail call float @llvm.fmuladd.f32(float %366, float %373, float 0xBF56C16C00000000) #13 %375 = tail call float @llvm.fmuladd.f32(float %366, float %374, float 0x3FA5555560000000) #13 %376 = tail call float @llvm.fmuladd.f32(float %366, float -5.000000e-01, float 1.000000e+00) #13 %377 = tail call float @llvm.fmuladd.f32(float %372, float %375, float %376) #13 %378 = select i1 %364, float %377, float %371 %379 = bitcast float %378 to i32 %380 = xor i32 %361, %379 %381 = icmp ult i32 %341, 1258291200 %382 = select i1 %381, i32 %380, i32 %351 %383 = bitcast i32 %382 to float %mul72 = fmul float %mul69, %383 %div73 = fmul float %mul72, 5.000000e-01 %add74 = fadd float %div73, %pixel br label %sw.epilog sw.bb75: ; preds = %entry %mul76 = fmul float %attenuate, 1.250000e+01 %mul78 = fmul float %mul76, 0xBEEF751040000000 %mul79 = fmul float %mul78, %pixel %384 = fcmp olt float %mul79, 0.000000e+00 %385 = select i1 %384, float -5.000000e-01, float 5.000000e-01 %386 = tail call float @llvm.fmuladd.f32(float %mul79, float 0x3FF7154760000000, float %385) #13 %387 = fptosi float %386 to i32 %388 = sitofp i32 %387 to float %389 = tail call float @llvm.fmuladd.f32(float %388, float 0xBFE62E3000000000, float %mul79) #13 %390 = fmul float %388, 0xBEE2FEFA20000000 %391 = fadd float %389, %390 %392 = fmul float %391, %391 %393 = tail call float @llvm.fmuladd.f32(float %392, float 0x3E66376980000000, float 0xBEBBBD41C0000000) #13 %394 = tail call float @llvm.fmuladd.f32(float %392, float %393, float 0x3F11566AA0000000) #13 %395 = tail call float @llvm.fmuladd.f32(float %392, float %394, float 0xBF66C16C20000000) #13 %396 = tail call float @llvm.fmuladd.f32(float %392, float %395, float 0x3FC5555560000000) #13 %397 = fsub float -0.000000e+00, %396 %398 = tail call float @llvm.fmuladd.f32(float %392, float %397, float %391) #13 %399 = fsub float -0.000000e+00, %390 %400 = fmul float %391, %398 %401 = fsub float 2.000000e+00, %398 %402 = fdiv float %400, %401, !fpmath !11 %403 = fsub float %399, %402 %404 = fsub float %403, %389 %405 = fsub float 1.000000e+00, %404 %406 = bitcast float %405 to i32 %407 = shl i32 %387, 23 %408 = add nsw i32 %407, %406 %409 = bitcast i32 %408 to float %410 = fcmp olt float %mul79, 0xC055D589E0000000 %411 = select i1 %410, float 0.000000e+00, float %409 %412 = fcmp olt float %mul79, 0x40562E4300000000 %413 = select i1 %412, float %411, float 0x7FF0000000000000 %414 = fcmp ord float %mul79, 0.000000e+00 %415 = select i1 %414, float %413, float %mul79 %cmp81175 = fcmp ogt float %div.i, %415 br i1 %cmp81175, label %for.body, label %for.end for.body: ; preds = %sw.bb75, %for.body %416 = phi i32 [ %add1.i.i.i146, %for.body ], [ %add1.i.i.i, %sw.bb75 ] %417 = phi i32 [ %add.i.i.i143, %for.body ], [ %add.i.i.i, %sw.bb75 ] %i.0177 = phi i32 [ %inc, %for.body ], [ 0, %sw.bb75 ] %alpha.1176 = phi float [ %mul83, %for.body ], [ %div.i, %sw.bb75 ] %xor.i.i141 = xor i32 %416, %417 %mul.i.i.i142 = mul i32 %417, -83941 %add.i.i.i143 = add i32 %mul.i.i.i142, %416 %cmp.i.i.i144 = icmp ult i32 %add.i.i.i143, %416 %conv.i.i.i145 = zext i1 %cmp.i.i.i144 to i32 %418 = zext i32 %417 to i64 %419 = mul nuw i64 %418, 4294883355 %420 = lshr i64 %419, 32 %421 = trunc i64 %420 to i32 %add1.i.i.i146 = add i32 %421, %conv.i.i.i145 %conv.i147 = uitofp i32 %xor.i.i141 to float %div.i148 = fmul float %conv.i147, 0x3DF0000000000000 %mul83 = fmul float %alpha.1176, %div.i148 %inc = add i32 %i.0177, 1 %cmp81 = fcmp ogt float %mul83, %415 br i1 %cmp81, label %for.body, label %for.cond.for.end_crit_edge for.cond.for.end_crit_edge: ; preds = %for.body store i32 %add.i.i.i143, i32 addrspace(5)* %x.i.i, align 4, !tbaa !8 store i32 %add1.i.i.i146, i32 addrspace(5)* %c.i.i, align 4, !tbaa !10 %phitmp = uitofp i32 %inc to float %phitmp178 = fmul float %phitmp, 6.553500e+04 br label %for.end for.end: ; preds = %for.cond.for.end_crit_edge, %sw.bb75 %i.0.lcssa = phi float [ %phitmp178, %for.cond.for.end_crit_edge ], [ 0.000000e+00, %sw.bb75 ] %div86 = fdiv float %i.0.lcssa, %mul76, !fpmath !11 br label %sw.epilog sw.bb87: ; preds = %entry %mul88 = fmul float %attenuate, 6.553500e+04 %mul89 = fmul float %mul88, %div.i br label %sw.epilog sw.epilog: ; preds = %if.else, %sw.bb21, %if.then49, %if.else51, %if.then37, %if.else39, %sw.bb87, %for.end, %if.end65, %sw.bb3, %sw.default %noise.0 = phi float [ %6, %sw.default ], [ %div86, %for.end ], [ %add74, %if.end65 ], [ %sub38, %if.then37 ], [ %add, %if.else39 ], [ %add50, %if.then49 ], [ %add57, %if.else51 ], [ %136, %sw.bb3 ], [ %mul89, %sw.bb87 ], [ 0.000000e+00, %sw.bb21 ], [ %pixel., %if.else ] ret float %noise.0 } ; Function Attrs: nounwind readnone speculatable declare float @llvm.fmuladd.f32(float, float, float) #5 ; Function Attrs: convergent nounwind define amdgpu_kernel void @AddNoise(float addrspace(1)* nocapture readonly %image, i32 %number_channels, i32 %channel, i32 %length, i32 %pixelsPerWorkItem, i32 %noise_type, float %attenuate, i32 %seed0, i32 %seed1, i32 %numRandomNumbersPerPixel, float addrspace(1)* nocapture %filteredImage) local_unnamed_addr #4 !kernel_arg_addr_space !15 !kernel_arg_access_qual !16 !kernel_arg_type !17 !kernel_arg_base_type !17 !kernel_arg_type_qual !18 { entry: %rng = alloca %struct.mwc64x_state_t, align 4, addrspace(5) %0 = bitcast %struct.mwc64x_state_t addrspace(5)* %rng to i8 addrspace(5)* call void @llvm.lifetime.start.p5i8(i64 8, i8 addrspace(5)* %0) #13 %x = getelementptr inbounds %struct.mwc64x_state_t, %struct.mwc64x_state_t addrspace(5)* %rng, i32 0, i32 0 store i32 %seed0, i32 addrspace(5)* %x, align 4, !tbaa !8 %c = getelementptr inbounds %struct.mwc64x_state_t, %struct.mwc64x_state_t addrspace(5)* %rng, i32 0, i32 1 store i32 %seed1, i32 addrspace(5)* %c, align 4, !tbaa !10 %mul = mul i32 %numRandomNumbersPerPixel, %pixelsPerWorkItem %x.i = tail call i32 @llvm.r600.read.local.size.x() #13 %1 = tail call i32 @llvm.r600.read.tgid.x() #13 %mul1 = mul i32 %1, %x.i %mul3 = mul i32 %mul1, %mul %conv = zext i32 %mul3 to i64 %conv4 = zext i32 %mul to i64 %2 = tail call i32 @llvm.r600.read.tidig.x() #13, !range !3 %3 = add i32 %mul1, %2 %4 = tail call i8 addrspace(7)* @llvm.r600.implicitarg.ptr() #13 %5 = getelementptr inbounds i8, i8 addrspace(7)* %4, i32 4 %6 = bitcast i8 addrspace(7)* %5 to i32 addrspace(7)* %7 = load i32, i32 addrspace(7)* %6, align 4, !tbaa !4 %8 = add i32 %3, %7 %conv.i.i = zext i32 %8 to i64 %mul1.i.i = mul nuw i64 %conv.i.i, %conv4 %add2.i.i = add i64 %mul1.i.i, %conv %cmp38.i.i.i = icmp eq i64 %add2.i.i, 0 br i1 %cmp38.i.i.i, label %while.body.i.i.i.preheader, label %while.body.i17.i.i while.body.i17.i.i: ; preds = %entry, %MWC_MulMod64.exit37.i.i.i %acc.041.i.i.i = phi i64 [ %acc.1.i.i.i, %MWC_MulMod64.exit37.i.i.i ], [ 1, %entry ] %sqr.040.i.i.i = phi i64 [ %r.0.lcssa.i36.i.i.i, %MWC_MulMod64.exit37.i.i.i ], [ 4294883355, %entry ] %e.addr.039.i.i.i = phi i64 [ %shr.i22.i.i, %MWC_MulMod64.exit37.i.i.i ], [ %add2.i.i, %entry ] %and.i15.i.i = and i64 %e.addr.039.i.i.i, 1 %tobool.i16.i.i = icmp eq i64 %and.i15.i.i, 0 br i1 %tobool.i16.i.i, label %if.end.i21.i.i, label %if.then.i18.i.i if.then.i18.i.i: ; preds = %while.body.i17.i.i %cmp17.i.i.i.i = icmp eq i64 %acc.041.i.i.i, 0 br i1 %cmp17.i.i.i.i, label %if.end.i21.i.i, label %while.body.i.i.i.i while.body.i.i.i.i: ; preds = %if.then.i18.i.i, %MWC_AddMod64.exit16.i.i.i.i %r.020.i.i.i.i = phi i64 [ %r.1.i.i.i.i, %MWC_AddMod64.exit16.i.i.i.i ], [ 0, %if.then.i18.i.i ] %a.addr.019.i.i.i.i = phi i64 [ %shr.i.i.i.i, %MWC_AddMod64.exit16.i.i.i.i ], [ %acc.041.i.i.i, %if.then.i18.i.i ] %b.addr.018.i.i.i.i = phi i64 [ %v.0.i15.i.i.i.i, %MWC_AddMod64.exit16.i.i.i.i ], [ %sqr.040.i.i.i, %if.then.i18.i.i ] %and.i.i.i.i = and i64 %a.addr.019.i.i.i.i, 1 %tobool.i.i.i.i = icmp eq i64 %and.i.i.i.i, 0 br i1 %tobool.i.i.i.i, label %if.end.i.i.i.i, label %if.then.i.i19.i.i if.then.i.i19.i.i: ; preds = %while.body.i.i.i.i %add.i.i.i.i.i = add i64 %b.addr.018.i.i.i.i, %r.020.i.i.i.i %cmp.i.i.i.i.i = icmp ult i64 %add.i.i.i.i.i, -360523849793537 br i1 %cmp.i.i.i.i.i, label %lor.lhs.false.i.i.i.i.i, label %if.then.i.i.i.i.i lor.lhs.false.i.i.i.i.i: ; preds = %if.then.i.i19.i.i %9 = uitofp i64 %add.i.i.i.i.i to float %10 = uitofp i64 %r.020.i.i.i.i to float %cmp2.i.i.i.i.i = fcmp olt float %9, %10 br i1 %cmp2.i.i.i.i.i, label %if.then.i.i.i.i.i, label %if.end.i.i.i.i if.then.i.i.i.i.i: ; preds = %lor.lhs.false.i.i.i.i.i, %if.then.i.i19.i.i %sub.i.i.i.i.i = add i64 %add.i.i.i.i.i, 360523849793537 br label %if.end.i.i.i.i if.end.i.i.i.i: ; preds = %if.then.i.i.i.i.i, %lor.lhs.false.i.i.i.i.i, %while.body.i.i.i.i %r.1.i.i.i.i = phi i64 [ %r.020.i.i.i.i, %while.body.i.i.i.i ], [ %sub.i.i.i.i.i, %if.then.i.i.i.i.i ], [ %add.i.i.i.i.i, %lor.lhs.false.i.i.i.i.i ] %add.i9.i.i.i.i = shl i64 %b.addr.018.i.i.i.i, 1 %cmp.i10.i.i.i.i = icmp ult i64 %add.i9.i.i.i.i, -360523849793537 br i1 %cmp.i10.i.i.i.i, label %lor.lhs.false.i12.i.i.i.i, label %if.then.i14.i.i.i.i lor.lhs.false.i12.i.i.i.i: ; preds = %if.end.i.i.i.i %11 = uitofp i64 %add.i9.i.i.i.i to float %12 = uitofp i64 %b.addr.018.i.i.i.i to float %cmp2.i11.i.i.i.i = fcmp olt float %11, %12 br i1 %cmp2.i11.i.i.i.i, label %if.then.i14.i.i.i.i, label %MWC_AddMod64.exit16.i.i.i.i if.then.i14.i.i.i.i: ; preds = %lor.lhs.false.i12.i.i.i.i, %if.end.i.i.i.i %sub.i13.i.i.i.i = add i64 %add.i9.i.i.i.i, 360523849793537 br label %MWC_AddMod64.exit16.i.i.i.i MWC_AddMod64.exit16.i.i.i.i: ; preds = %if.then.i14.i.i.i.i, %lor.lhs.false.i12.i.i.i.i %v.0.i15.i.i.i.i = phi i64 [ %sub.i13.i.i.i.i, %if.then.i14.i.i.i.i ], [ %add.i9.i.i.i.i, %lor.lhs.false.i12.i.i.i.i ] %shr.i.i.i.i = lshr i64 %a.addr.019.i.i.i.i, 1 %cmp.i.i20.i.i = icmp eq i64 %shr.i.i.i.i, 0 br i1 %cmp.i.i20.i.i, label %if.end.i21.i.i, label %while.body.i.i.i.i if.end.i21.i.i: ; preds = %MWC_AddMod64.exit16.i.i.i.i, %if.then.i18.i.i, %while.body.i17.i.i %acc.1.i.i.i = phi i64 [ %acc.041.i.i.i, %while.body.i17.i.i ], [ 0, %if.then.i18.i.i ], [ %r.1.i.i.i.i, %MWC_AddMod64.exit16.i.i.i.i ] %cmp17.i10.i.i.i = icmp eq i64 %sqr.040.i.i.i, 0 br i1 %cmp17.i10.i.i.i, label %MWC_MulMod64.exit37.i.i.i, label %while.body.i16.i.i.i while.body.i16.i.i.i: ; preds = %if.end.i21.i.i, %MWC_AddMod64.exit16.i35.i.i.i %r.020.i11.i.i.i = phi i64 [ %r.1.i24.i.i.i, %MWC_AddMod64.exit16.i35.i.i.i ], [ 0, %if.end.i21.i.i ] %a.addr.019.i12.i.i.i = phi i64 [ %shr.i33.i.i.i, %MWC_AddMod64.exit16.i35.i.i.i ], [ %sqr.040.i.i.i, %if.end.i21.i.i ] %b.addr.018.i13.i.i.i = phi i64 [ %v.0.i15.i32.i.i.i, %MWC_AddMod64.exit16.i35.i.i.i ], [ %sqr.040.i.i.i, %if.end.i21.i.i ] %and.i14.i.i.i = and i64 %a.addr.019.i12.i.i.i, 1 %tobool.i15.i.i.i = icmp eq i64 %and.i14.i.i.i, 0 br i1 %tobool.i15.i.i.i, label %if.end.i27.i.i.i, label %if.then.i19.i.i.i if.then.i19.i.i.i: ; preds = %while.body.i16.i.i.i %add.i.i17.i.i.i = add i64 %b.addr.018.i13.i.i.i, %r.020.i11.i.i.i %cmp.i.i18.i.i.i = icmp ult i64 %add.i.i17.i.i.i, -360523849793537 br i1 %cmp.i.i18.i.i.i, label %lor.lhs.false.i.i21.i.i.i, label %if.then.i.i23.i.i.i lor.lhs.false.i.i21.i.i.i: ; preds = %if.then.i19.i.i.i %13 = uitofp i64 %add.i.i17.i.i.i to float %14 = uitofp i64 %r.020.i11.i.i.i to float %cmp2.i.i20.i.i.i = fcmp olt float %13, %14 br i1 %cmp2.i.i20.i.i.i, label %if.then.i.i23.i.i.i, label %if.end.i27.i.i.i if.then.i.i23.i.i.i: ; preds = %lor.lhs.false.i.i21.i.i.i, %if.then.i19.i.i.i %sub.i.i22.i.i.i = add i64 %add.i.i17.i.i.i, 360523849793537 br label %if.end.i27.i.i.i if.end.i27.i.i.i: ; preds = %if.then.i.i23.i.i.i, %lor.lhs.false.i.i21.i.i.i, %while.body.i16.i.i.i %r.1.i24.i.i.i = phi i64 [ %r.020.i11.i.i.i, %while.body.i16.i.i.i ], [ %sub.i.i22.i.i.i, %if.then.i.i23.i.i.i ], [ %add.i.i17.i.i.i, %lor.lhs.false.i.i21.i.i.i ] %add.i9.i25.i.i.i = shl i64 %b.addr.018.i13.i.i.i, 1 %cmp.i10.i26.i.i.i = icmp ult i64 %add.i9.i25.i.i.i, -360523849793537 br i1 %cmp.i10.i26.i.i.i, label %lor.lhs.false.i12.i29.i.i.i, label %if.then.i14.i31.i.i.i lor.lhs.false.i12.i29.i.i.i: ; preds = %if.end.i27.i.i.i %15 = uitofp i64 %add.i9.i25.i.i.i to float %16 = uitofp i64 %b.addr.018.i13.i.i.i to float %cmp2.i11.i28.i.i.i = fcmp olt float %15, %16 br i1 %cmp2.i11.i28.i.i.i, label %if.then.i14.i31.i.i.i, label %MWC_AddMod64.exit16.i35.i.i.i if.then.i14.i31.i.i.i: ; preds = %lor.lhs.false.i12.i29.i.i.i, %if.end.i27.i.i.i %sub.i13.i30.i.i.i = add i64 %add.i9.i25.i.i.i, 360523849793537 br label %MWC_AddMod64.exit16.i35.i.i.i MWC_AddMod64.exit16.i35.i.i.i: ; preds = %if.then.i14.i31.i.i.i, %lor.lhs.false.i12.i29.i.i.i %v.0.i15.i32.i.i.i = phi i64 [ %sub.i13.i30.i.i.i, %if.then.i14.i31.i.i.i ], [ %add.i9.i25.i.i.i, %lor.lhs.false.i12.i29.i.i.i ] %shr.i33.i.i.i = lshr i64 %a.addr.019.i12.i.i.i, 1 %cmp.i34.i.i.i = icmp eq i64 %shr.i33.i.i.i, 0 br i1 %cmp.i34.i.i.i, label %MWC_MulMod64.exit37.i.i.i, label %while.body.i16.i.i.i MWC_MulMod64.exit37.i.i.i: ; preds = %MWC_AddMod64.exit16.i35.i.i.i, %if.end.i21.i.i %r.0.lcssa.i36.i.i.i = phi i64 [ 0, %if.end.i21.i.i ], [ %r.1.i24.i.i.i, %MWC_AddMod64.exit16.i35.i.i.i ] %shr.i22.i.i = lshr i64 %e.addr.039.i.i.i, 1 %cmp.i23.i.i = icmp eq i64 %shr.i22.i.i, 0 br i1 %cmp.i23.i.i, label %while.body.i.i.i.preheader, label %while.body.i17.i.i while.body.i.i.i.preheader: ; preds = %MWC_MulMod64.exit37.i.i.i, %entry %b.addr.018.i.i.i.ph = phi i64 [ 1, %entry ], [ %acc.1.i.i.i, %MWC_MulMod64.exit37.i.i.i ] br label %while.body.i.i.i while.body.i.i.i: ; preds = %MWC_AddMod64.exit16.i.i.i.1, %while.body.i.i.i.preheader %r.020.i.i.i = phi i64 [ 0, %while.body.i.i.i.preheader ], [ %r.1.i.i.i.1, %MWC_AddMod64.exit16.i.i.i.1 ] %a.addr.019.i.i.i = phi i64 [ 4077358422479273989, %while.body.i.i.i.preheader ], [ %shr.i.i.i, %MWC_AddMod64.exit16.i.i.i.1 ] %b.addr.018.i.i.i = phi i64 [ %b.addr.018.i.i.i.ph, %while.body.i.i.i.preheader ], [ %v.0.i15.i.i.i.1, %MWC_AddMod64.exit16.i.i.i.1 ] %and.i.i.i = and i64 %a.addr.019.i.i.i, 1 %tobool.i.i.i = icmp eq i64 %and.i.i.i, 0 br i1 %tobool.i.i.i, label %if.end.i.i.i, label %if.then.i.i.i if.then.i.i.i: ; preds = %while.body.i.i.i %add.i.i.i.i = add i64 %b.addr.018.i.i.i, %r.020.i.i.i %cmp.i.i.i.i = icmp ult i64 %add.i.i.i.i, -360523849793537 br i1 %cmp.i.i.i.i, label %lor.lhs.false.i.i.i.i, label %if.then.i.i.i.i lor.lhs.false.i.i.i.i: ; preds = %if.then.i.i.i %17 = uitofp i64 %add.i.i.i.i to float %18 = uitofp i64 %r.020.i.i.i to float %cmp2.i.i.i.i = fcmp olt float %17, %18 br i1 %cmp2.i.i.i.i, label %if.then.i.i.i.i, label %if.end.i.i.i if.then.i.i.i.i: ; preds = %lor.lhs.false.i.i.i.i, %if.then.i.i.i %sub.i.i.i.i = add i64 %add.i.i.i.i, 360523849793537 br label %if.end.i.i.i if.end.i.i.i: ; preds = %if.then.i.i.i.i, %lor.lhs.false.i.i.i.i, %while.body.i.i.i %r.1.i.i.i = phi i64 [ %r.020.i.i.i, %while.body.i.i.i ], [ %sub.i.i.i.i, %if.then.i.i.i.i ], [ %add.i.i.i.i, %lor.lhs.false.i.i.i.i ] %add.i9.i.i.i = shl i64 %b.addr.018.i.i.i, 1 %cmp.i10.i.i.i = icmp ult i64 %add.i9.i.i.i, -360523849793537 br i1 %cmp.i10.i.i.i, label %lor.lhs.false.i12.i.i.i, label %if.then.i14.i.i.i lor.lhs.false.i12.i.i.i: ; preds = %if.end.i.i.i %19 = uitofp i64 %add.i9.i.i.i to float %20 = uitofp i64 %b.addr.018.i.i.i to float %cmp2.i11.i.i.i = fcmp olt float %19, %20 br i1 %cmp2.i11.i.i.i, label %if.then.i14.i.i.i, label %MWC_AddMod64.exit16.i.i.i if.then.i14.i.i.i: ; preds = %lor.lhs.false.i12.i.i.i, %if.end.i.i.i %sub.i13.i.i.i = add i64 %add.i9.i.i.i, 360523849793537 br label %MWC_AddMod64.exit16.i.i.i MWC_AddMod64.exit16.i.i.i: ; preds = %if.then.i14.i.i.i, %lor.lhs.false.i12.i.i.i %v.0.i15.i.i.i = phi i64 [ %sub.i13.i.i.i, %if.then.i14.i.i.i ], [ %add.i9.i.i.i, %lor.lhs.false.i12.i.i.i ] %shr.i.i.i = lshr i64 %a.addr.019.i.i.i, 2 %and.i.i.i.1 = and i64 %a.addr.019.i.i.i, 2 %tobool.i.i.i.1 = icmp eq i64 %and.i.i.i.1, 0 br i1 %tobool.i.i.i.1, label %if.end.i.i.i.1, label %if.then.i.i.i.1 MWC64X_SeedStreams.exit: ; preds = %MWC_AddMod64.exit16.i.i.i.1 %div.i.i = udiv i64 %r.1.i.i.i.1, 4294883355 %conv5.i.i = trunc i64 %div.i.i to i32 %21 = mul i64 %div.i.i, 4294883355 %22 = sub i64 %r.1.i.i.i.1, %21 %conv6.i.i = trunc i64 %22 to i32 store i32 %conv5.i.i, i32 addrspace(5)* %x, align 4, !tbaa !8 store i32 %conv6.i.i, i32 addrspace(5)* %c, align 4, !tbaa !10 %mul8 = mul i32 %mul1, %pixelsPerWorkItem %mul979 = add i32 %mul8, %2 %add = mul i32 %mul979, %number_channels %cmp110 = icmp ne i32 %pixelsPerWorkItem, 0 %cmp13111 = icmp ult i32 %add, %length %or.cond80112 = and i1 %cmp110, %cmp13111 br i1 %or.cond80112, label %while.body.lr.ph, label %while.end while.body.lr.ph: ; preds = %MWC64X_SeedStreams.exit %and.i82 = and i32 %channel, 1 %cmp.i83 = icmp eq i32 %and.i82, 0 %cmp1.i85 = icmp ugt i32 %number_channels, 2 %and3.i87 = and i32 %channel, 2 %cmp4.i88 = icmp eq i32 %and3.i87, 0 %and8.i91 = and i32 %channel, 4 %cmp9.i92 = icmp eq i32 %and8.i91, 0 %and16.i96 = and i32 %channel, 16 %cmp17.i97 = icmp eq i32 %and16.i96, 0 %mul46 = mul i32 %x.i, %number_channels br label %while.body while.body: ; preds = %while.body.lr.ph, %WriteChannels.exit %pos.0118 = phi i32 [ %add, %while.body.lr.ph ], [ %add47, %WriteChannels.exit ] %count.0117 = phi i32 [ %pixelsPerWorkItem, %while.body.lr.ph ], [ %dec, %WriteChannels.exit ] %alpha.sroa.0.0116 = phi i32 [ undef, %while.body.lr.ph ], [ %alpha.sroa.0.2, %WriteChannels.exit ] %23 = phi float [ undef, %while.body.lr.ph ], [ %54, %WriteChannels.exit ] %blue.sroa.0.0115 = phi i32 [ undef, %while.body.lr.ph ], [ %blue.sroa.0.2, %WriteChannels.exit ] %24 = phi float [ undef, %while.body.lr.ph ], [ %52, %WriteChannels.exit ] %green.sroa.0.0114 = phi i32 [ undef, %while.body.lr.ph ], [ %green.sroa.0.4, %WriteChannels.exit ] %25 = phi float [ undef, %while.body.lr.ph ], [ %51, %WriteChannels.exit ] %red.sroa.0.0113 = phi i32 [ undef, %while.body.lr.ph ], [ %red.sroa.0.2, %WriteChannels.exit ] %26 = phi float [ undef, %while.body.lr.ph ], [ %45, %WriteChannels.exit ] %add.ptr = getelementptr inbounds float, float addrspace(1)* %image, i32 %pos.0118 %add.ptr15 = getelementptr inbounds float, float addrspace(1)* %filteredImage, i32 %pos.0118 br i1 %cmp.i83, label %if.end.i86, label %if.then.i84 if.then.i84: ; preds = %while.body %27 = bitcast float addrspace(1)* %add.ptr to i32 addrspace(1)* %28 = load i32, i32 addrspace(1)* %27, align 4, !tbaa !12 %29 = bitcast i32 %28 to float br label %if.end.i86 if.end.i86: ; preds = %if.then.i84, %while.body %30 = phi float [ %26, %while.body ], [ %29, %if.then.i84 ] %red.sroa.0.1 = phi i32 [ %red.sroa.0.0113, %while.body ], [ %28, %if.then.i84 ] br i1 %cmp1.i85, label %if.then2.i89, label %if.end13.i95 if.then2.i89: ; preds = %if.end.i86 br i1 %cmp4.i88, label %if.end7.i93, label %if.then5.i90 if.then5.i90: ; preds = %if.then2.i89 %add.ptr.i31.i = getelementptr inbounds float, float addrspace(1)* %add.ptr, i32 1 %31 = bitcast float addrspace(1)* %add.ptr.i31.i to i32 addrspace(1)* %32 = load i32, i32 addrspace(1)* %31, align 4, !tbaa !12 %33 = bitcast i32 %32 to float br label %if.end7.i93 if.end7.i93: ; preds = %if.then5.i90, %if.then2.i89 %34 = phi float [ %25, %if.then2.i89 ], [ %33, %if.then5.i90 ] %green.sroa.0.1 = phi i32 [ %green.sroa.0.0114, %if.then2.i89 ], [ %32, %if.then5.i90 ] br i1 %cmp9.i92, label %if.end13.i95, label %if.then10.i94 if.then10.i94: ; preds = %if.end7.i93 %add.ptr.i30.i = getelementptr inbounds float, float addrspace(1)* %add.ptr, i32 2 %35 = bitcast float addrspace(1)* %add.ptr.i30.i to i32 addrspace(1)* %36 = load i32, i32 addrspace(1)* %35, align 4, !tbaa !12 %37 = bitcast i32 %36 to float br label %if.end13.i95 if.end13.i95: ; preds = %if.then10.i94, %if.end7.i93, %if.end.i86 %38 = phi float [ %34, %if.end7.i93 ], [ %34, %if.then10.i94 ], [ %25, %if.end.i86 ] %green.sroa.0.2 = phi i32 [ %green.sroa.0.1, %if.end7.i93 ], [ %green.sroa.0.1, %if.then10.i94 ], [ %green.sroa.0.0114, %if.end.i86 ] %39 = phi float [ %24, %if.end7.i93 ], [ %37, %if.then10.i94 ], [ %24, %if.end.i86 ] %blue.sroa.0.1 = phi i32 [ %blue.sroa.0.0115, %if.end7.i93 ], [ %36, %if.then10.i94 ], [ %blue.sroa.0.0115, %if.end.i86 ] switch i32 %number_channels, label %ReadChannels.exit [ i32 4, label %land.lhs.true.i98 i32 2, label %land.lhs.true.i98 ] land.lhs.true.i98: ; preds = %if.end13.i95, %if.end13.i95 br i1 %cmp17.i97, label %ReadChannels.exit, label %if.then18.i101 if.then18.i101: ; preds = %land.lhs.true.i98 %add.ptr.i.i99 = getelementptr inbounds float, float addrspace(1)* %add.ptr, i32 %number_channels %add.ptr1.i.i100 = getelementptr inbounds float, float addrspace(1)* %add.ptr.i.i99, i32 -1 %40 = bitcast float addrspace(1)* %add.ptr1.i.i100 to i32 addrspace(1)* %41 = load i32, i32 addrspace(1)* %40, align 4, !tbaa !12 %42 = bitcast i32 %41 to float br label %ReadChannels.exit ReadChannels.exit: ; preds = %if.end13.i95, %land.lhs.true.i98, %if.then18.i101 %43 = phi float [ %23, %if.end13.i95 ], [ %23, %land.lhs.true.i98 ], [ %42, %if.then18.i101 ] %alpha.sroa.0.1 = phi i32 [ %alpha.sroa.0.0116, %if.end13.i95 ], [ %alpha.sroa.0.0116, %land.lhs.true.i98 ], [ %41, %if.then18.i101 ] br i1 %cmp.i83, label %if.end, label %if.then if.then: ; preds = %ReadChannels.exit %call18 = call float @mwcGenerateDifferentialNoise(%struct.mwc64x_state_t addrspace(5)* %rng, float %30, i32 %noise_type, float %attenuate) #15 %44 = bitcast float %call18 to i32 br label %if.end if.end: ; preds = %ReadChannels.exit, %if.then %45 = phi float [ %30, %ReadChannels.exit ], [ %call18, %if.then ] %red.sroa.0.2 = phi i32 [ %red.sroa.0.1, %ReadChannels.exit ], [ %44, %if.then ] br i1 %cmp1.i85, label %if.then21, label %if.end34 if.then21: ; preds = %if.end br i1 %cmp4.i88, label %if.end27, label %if.then25 if.then25: ; preds = %if.then21 %46 = bitcast i32 %green.sroa.0.2 to float %call26 = call float @mwcGenerateDifferentialNoise(%struct.mwc64x_state_t addrspace(5)* %rng, float %46, i32 %noise_type, float %attenuate) #15 %47 = bitcast float %call26 to i32 br label %if.end27 if.end27: ; preds = %if.then21, %if.then25 %48 = phi float [ %38, %if.then21 ], [ %call26, %if.then25 ] %green.sroa.0.3 = phi i32 [ %green.sroa.0.2, %if.then21 ], [ %47, %if.then25 ] br i1 %cmp9.i92, label %if.end34, label %if.then31 if.then31: ; preds = %if.end27 %49 = bitcast i32 %blue.sroa.0.1 to float %call32 = call float @mwcGenerateDifferentialNoise(%struct.mwc64x_state_t addrspace(5)* %rng, float %49, i32 %noise_type, float %attenuate) #15 %50 = bitcast float %call32 to i32 br label %if.end34 if.end34: ; preds = %if.end27, %if.then31, %if.end %51 = phi float [ %48, %if.end27 ], [ %48, %if.then31 ], [ %38, %if.end ] %green.sroa.0.4 = phi i32 [ %green.sroa.0.3, %if.end27 ], [ %green.sroa.0.3, %if.then31 ], [ %green.sroa.0.2, %if.end ] %52 = phi float [ %39, %if.end27 ], [ %call32, %if.then31 ], [ %39, %if.end ] %blue.sroa.0.2 = phi i32 [ %blue.sroa.0.1, %if.end27 ], [ %50, %if.then31 ], [ %blue.sroa.0.1, %if.end ] switch i32 %number_channels, label %if.end44 [ i32 4, label %land.lhs.true i32 2, label %land.lhs.true ] land.lhs.true: ; preds = %if.end34, %if.end34 br i1 %cmp17.i97, label %if.end44, label %if.then42 if.then42: ; preds = %land.lhs.true %call43 = call float @mwcGenerateDifferentialNoise(%struct.mwc64x_state_t addrspace(5)* %rng, float %43, i32 %noise_type, float %attenuate) #15 %53 = bitcast float %call43 to i32 br label %if.end44 if.end44: ; preds = %if.end34, %land.lhs.true, %if.then42 %54 = phi float [ %43, %if.end34 ], [ %43, %land.lhs.true ], [ %call43, %if.then42 ] %alpha.sroa.0.2 = phi i32 [ %alpha.sroa.0.1, %if.end34 ], [ %alpha.sroa.0.1, %land.lhs.true ], [ %53, %if.then42 ] %55 = bitcast i32 %red.sroa.0.2 to float %56 = bitcast i32 %alpha.sroa.0.2 to float br i1 %cmp.i83, label %if.end.i, label %if.then.i if.then.i: ; preds = %if.end44 %57 = fcmp ogt float %55, 6.553500e+04 %58 = fcmp olt float %55, 0.000000e+00 %59 = select i1 %58, float 0.000000e+00, float %55 %.op.i.i = fadd float %59, 5.000000e-01 %add.i.i = select i1 %57, float 6.553550e+04, float %.op.i.i store float %add.i.i, float addrspace(1)* %add.ptr15, align 4, !tbaa !12 br label %if.end.i if.end.i: ; preds = %if.then.i, %if.end44 br i1 %cmp1.i85, label %if.then2.i, label %if.end13.i if.then2.i: ; preds = %if.end.i br i1 %cmp4.i88, label %if.end7.i, label %if.then5.i if.then5.i: ; preds = %if.then2.i %60 = fcmp ogt float %51, 6.553500e+04 %61 = fcmp olt float %51, 0.000000e+00 %62 = select i1 %61, float 0.000000e+00, float %51 %.op.i36.i = fadd float %62, 5.000000e-01 %add.i37.i = select i1 %60, float 6.553550e+04, float %.op.i36.i %add.ptr.i35.i = getelementptr inbounds float, float addrspace(1)* %add.ptr15, i32 1 store float %add.i37.i, float addrspace(1)* %add.ptr.i35.i, align 4, !tbaa !12 br label %if.end7.i if.end7.i: ; preds = %if.then5.i, %if.then2.i br i1 %cmp9.i92, label %if.end13.i, label %if.then10.i if.then10.i: ; preds = %if.end7.i %63 = fcmp ogt float %52, 6.553500e+04 %64 = fcmp olt float %52, 0.000000e+00 %65 = select i1 %64, float 0.000000e+00, float %52 %.op.i33.i = fadd float %65, 5.000000e-01 %add.i34.i = select i1 %63, float 6.553550e+04, float %.op.i33.i %add.ptr.i32.i = getelementptr inbounds float, float addrspace(1)* %add.ptr15, i32 2 store float %add.i34.i, float addrspace(1)* %add.ptr.i32.i, align 4, !tbaa !12 br label %if.end13.i if.end13.i: ; preds = %if.then10.i, %if.end7.i, %if.end.i switch i32 %number_channels, label %WriteChannels.exit [ i32 4, label %land.lhs.true.i i32 2, label %land.lhs.true.i ] land.lhs.true.i: ; preds = %if.end13.i, %if.end13.i br i1 %cmp17.i97, label %WriteChannels.exit, label %if.then18.i if.then18.i: ; preds = %land.lhs.true.i %66 = fcmp ogt float %56, 6.553500e+04 %67 = fcmp olt float %56, 0.000000e+00 %68 = select i1 %67, float 0.000000e+00, float %56 %.op.i30.i = fadd float %68, 5.000000e-01 %add.i31.i = select i1 %66, float 6.553550e+04, float %.op.i30.i %add.ptr.i.i = getelementptr inbounds float, float addrspace(1)* %add.ptr15, i32 %number_channels %add.ptr1.i.i = getelementptr inbounds float, float addrspace(1)* %add.ptr.i.i, i32 -1 store float %add.i31.i, float addrspace(1)* %add.ptr1.i.i, align 4, !tbaa !12 br label %WriteChannels.exit WriteChannels.exit: ; preds = %if.end13.i, %land.lhs.true.i, %if.then18.i %add47 = add i32 %pos.0118, %mul46 %dec = add i32 %count.0117, -1 %cmp = icmp ne i32 %dec, 0 %cmp13 = icmp ult i32 %add47, %length %or.cond80 = and i1 %cmp, %cmp13 br i1 %or.cond80, label %while.body, label %while.end while.end: ; preds = %WriteChannels.exit, %MWC64X_SeedStreams.exit call void @llvm.lifetime.end.p5i8(i64 8, i8 addrspace(5)* %0) #13 ret void if.then.i.i.i.1: ; preds = %MWC_AddMod64.exit16.i.i.i %add.i.i.i.i.1 = add i64 %v.0.i15.i.i.i, %r.1.i.i.i %cmp.i.i.i.i.1 = icmp ult i64 %add.i.i.i.i.1, -360523849793537 br i1 %cmp.i.i.i.i.1, label %lor.lhs.false.i.i.i.i.1, label %if.then.i.i.i.i.1 lor.lhs.false.i.i.i.i.1: ; preds = %if.then.i.i.i.1 %69 = uitofp i64 %add.i.i.i.i.1 to float %70 = uitofp i64 %r.1.i.i.i to float %cmp2.i.i.i.i.1 = fcmp olt float %69, %70 br i1 %cmp2.i.i.i.i.1, label %if.then.i.i.i.i.1, label %if.end.i.i.i.1 if.then.i.i.i.i.1: ; preds = %lor.lhs.false.i.i.i.i.1, %if.then.i.i.i.1 %sub.i.i.i.i.1 = add i64 %add.i.i.i.i.1, 360523849793537 br label %if.end.i.i.i.1 if.end.i.i.i.1: ; preds = %if.then.i.i.i.i.1, %lor.lhs.false.i.i.i.i.1, %MWC_AddMod64.exit16.i.i.i %r.1.i.i.i.1 = phi i64 [ %r.1.i.i.i, %MWC_AddMod64.exit16.i.i.i ], [ %sub.i.i.i.i.1, %if.then.i.i.i.i.1 ], [ %add.i.i.i.i.1, %lor.lhs.false.i.i.i.i.1 ] %add.i9.i.i.i.1 = shl i64 %v.0.i15.i.i.i, 1 %cmp.i10.i.i.i.1 = icmp ult i64 %add.i9.i.i.i.1, -360523849793537 br i1 %cmp.i10.i.i.i.1, label %lor.lhs.false.i12.i.i.i.1, label %if.then.i14.i.i.i.1 lor.lhs.false.i12.i.i.i.1: ; preds = %if.end.i.i.i.1 %71 = uitofp i64 %add.i9.i.i.i.1 to float %72 = uitofp i64 %v.0.i15.i.i.i to float %cmp2.i11.i.i.i.1 = fcmp olt float %71, %72 br i1 %cmp2.i11.i.i.i.1, label %if.then.i14.i.i.i.1, label %MWC_AddMod64.exit16.i.i.i.1 if.then.i14.i.i.i.1: ; preds = %lor.lhs.false.i12.i.i.i.1, %if.end.i.i.i.1 %sub.i13.i.i.i.1 = add i64 %add.i9.i.i.i.1, 360523849793537 br label %MWC_AddMod64.exit16.i.i.i.1 MWC_AddMod64.exit16.i.i.i.1: ; preds = %if.then.i14.i.i.i.1, %lor.lhs.false.i12.i.i.i.1 %v.0.i15.i.i.i.1 = phi i64 [ %sub.i13.i.i.i.1, %if.then.i14.i.i.i.1 ], [ %add.i9.i.i.i.1, %lor.lhs.false.i12.i.i.i.1 ] %cmp.i.i.i.1 = icmp eq i64 %shr.i.i.i, 0 br i1 %cmp.i.i.i.1, label %MWC64X_SeedStreams.exit, label %while.body.i.i.i } ; Function Attrs: convergent nounwind define amdgpu_kernel void @BlurRow(float addrspace(1)* nocapture readonly %image, i32 %number_channels, i32 %channel, float addrspace(4)* nocapture readonly %filter, i32 %width, i32 %imageColumns, i32 %imageRows, <4 x float> addrspace(3)* nocapture %temp, <4 x float> addrspace(1)* nocapture %tempImage) local_unnamed_addr #4 !kernel_arg_addr_space !19 !kernel_arg_access_qual !20 !kernel_arg_type !21 !kernel_arg_base_type !22 !kernel_arg_type_qual !23 { entry: %0 = tail call i32 @llvm.r600.read.tgid.x() #13 %x.i.i = tail call i32 @llvm.r600.read.local.size.x() #13 %1 = mul i32 %x.i.i, %0 %2 = tail call i32 @llvm.r600.read.tidig.x() #13, !range !3 %3 = add i32 %1, %2 %4 = tail call i8 addrspace(7)* @llvm.r600.implicitarg.ptr() #13 %5 = getelementptr inbounds i8, i8 addrspace(7)* %4, i32 4 %6 = bitcast i8 addrspace(7)* %5 to i32 addrspace(7)* %7 = load i32, i32 addrspace(7)* %6, align 4, !tbaa !4 %8 = add i32 %7, %3 %9 = tail call i32 @llvm.r600.read.tgid.y() #13 %y.i.i = tail call i32 @llvm.r600.read.local.size.y() #13 %10 = mul i32 %y.i.i, %9 %11 = tail call i32 @llvm.r600.read.tidig.y() #13, !range !3 %12 = add i32 %10, %11 %13 = getelementptr inbounds i8, i8 addrspace(7)* %4, i32 8 %14 = bitcast i8 addrspace(7)* %13 to i32 addrspace(7)* %15 = load i32, i32 addrspace(7)* %14, align 4, !tbaa !4 %16 = add i32 %12, %15 %add = add i32 %x.i.i, %width %cmp98 = icmp ult i32 %2, %add br i1 %cmp98, label %for.body.lr.ph, label %for.cond.cleanup for.body.lr.ph: ; preds = %entry %sub = add i32 %width, -1 %div = lshr i32 %sub, 1 %add6 = sub i32 %1, %div %sub.i = add nsw i32 %imageColumns, -1 %mul1.i.i = mul i32 %16, %imageColumns %and.i.i = and i32 %channel, 1 %cmp.i.i = icmp eq i32 %and.i.i, 0 %cmp1.i.i = icmp ugt i32 %number_channels, 2 %and3.i.i = and i32 %channel, 2 %cmp4.i.i = icmp eq i32 %and3.i.i, 0 %and8.i.i = and i32 %channel, 4 %cmp9.i.i = icmp eq i32 %and8.i.i, 0 %and16.i.i = and i32 %channel, 16 %cmp17.i.i = icmp eq i32 %and16.i.i, 0 br label %for.body for.cond.cleanup: ; preds = %ReadFloat4.exit, %entry tail call void @llvm.r600.group.barrier() #13 %17 = load i32, i32 addrspace(7)* %6, align 4, !tbaa !4 %18 = add i32 %17, %3 %cmp13 = icmp ult i32 %18, %imageColumns br i1 %cmp13, label %for.cond15.preheader, label %if.end for.cond15.preheader: ; preds = %for.cond.cleanup %cmp1793 = icmp ugt i32 %width, 7 br i1 %cmp1793, label %for.cond19.preheader, label %for.cond34.preheader for.body: ; preds = %for.body.lr.ph, %ReadFloat4.exit %i.099 = phi i32 [ %2, %for.body.lr.ph ], [ %add11, %ReadFloat4.exit ] %sub7 = add i32 %add6, %i.099 %19 = icmp slt i32 %sub7, %imageColumns %20 = icmp sgt i32 %sub7, 0 %21 = select i1 %20, i32 %sub7, i32 0 %22 = select i1 %19, i32 %21, i32 %sub.i %mul4.i.i = add i32 %22, %mul1.i.i %add.i.i = mul i32 %mul4.i.i, %number_channels %add.ptr.i = getelementptr inbounds float, float addrspace(1)* %image, i32 %add.i.i br i1 %cmp.i.i, label %if.end.i.i, label %if.then.i.i if.then.i.i: ; preds = %for.body %23 = load float, float addrspace(1)* %add.ptr.i, align 4, !tbaa !12 br label %if.end.i.i if.end.i.i: ; preds = %if.then.i.i, %for.body %24 = phi float [ 0.000000e+00, %for.body ], [ %23, %if.then.i.i ] br i1 %cmp1.i.i, label %if.then2.i.i, label %if.end13.i.i if.then2.i.i: ; preds = %if.end.i.i br i1 %cmp4.i.i, label %if.end7.i.i, label %if.then5.i.i if.then5.i.i: ; preds = %if.then2.i.i %add.ptr.i31.i.i = getelementptr inbounds float, float addrspace(1)* %add.ptr.i, i32 1 %25 = load float, float addrspace(1)* %add.ptr.i31.i.i, align 4, !tbaa !12 br label %if.end7.i.i if.end7.i.i: ; preds = %if.then5.i.i, %if.then2.i.i %26 = phi float [ 0.000000e+00, %if.then2.i.i ], [ %25, %if.then5.i.i ] br i1 %cmp9.i.i, label %if.end13.i.i, label %if.then10.i.i if.then10.i.i: ; preds = %if.end7.i.i %add.ptr.i30.i.i = getelementptr inbounds float, float addrspace(1)* %add.ptr.i, i32 2 %27 = load float, float addrspace(1)* %add.ptr.i30.i.i, align 4, !tbaa !12 br label %if.end13.i.i if.end13.i.i: ; preds = %if.then10.i.i, %if.end7.i.i, %if.end.i.i %28 = phi float [ %26, %if.end7.i.i ], [ %26, %if.then10.i.i ], [ 0.000000e+00, %if.end.i.i ] %29 = phi float [ 0.000000e+00, %if.end7.i.i ], [ %27, %if.then10.i.i ], [ 0.000000e+00, %if.end.i.i ] switch i32 %number_channels, label %ReadFloat4.exit [ i32 4, label %land.lhs.true.i.i i32 2, label %land.lhs.true.i.i ] land.lhs.true.i.i: ; preds = %if.end13.i.i, %if.end13.i.i br i1 %cmp17.i.i, label %ReadFloat4.exit, label %if.then18.i.i if.then18.i.i: ; preds = %land.lhs.true.i.i %add.ptr.i.i.i = getelementptr inbounds float, float addrspace(1)* %add.ptr.i, i32 %number_channels %add.ptr1.i.i.i = getelementptr inbounds float, float addrspace(1)* %add.ptr.i.i.i, i32 -1 %30 = load float, float addrspace(1)* %add.ptr1.i.i.i, align 4, !tbaa !12 br label %ReadFloat4.exit ReadFloat4.exit: ; preds = %if.end13.i.i, %land.lhs.true.i.i, %if.then18.i.i %31 = phi float [ 0.000000e+00, %if.end13.i.i ], [ 0.000000e+00, %land.lhs.true.i.i ], [ %30, %if.then18.i.i ] %vecinit.i = insertelement <4 x float> undef, float %24, i32 0 %vecinit1.i = insertelement <4 x float> %vecinit.i, float %28, i32 1 %vecinit2.i = insertelement <4 x float> %vecinit1.i, float %29, i32 2 %vecinit3.i = insertelement <4 x float> %vecinit2.i, float %31, i32 3 %arrayidx = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %temp, i32 %i.099 store <4 x float> %vecinit3.i, <4 x float> addrspace(3)* %arrayidx, align 16, !tbaa !14 %add11 = add i32 %i.099, %x.i.i %cmp = icmp ult i32 %add11, %add br i1 %cmp, label %for.body, label %for.cond.cleanup for.cond19.preheader: ; preds = %for.cond15.preheader, %for.cond19.preheader %i14.095 = phi i32 [ %add32, %for.cond19.preheader ], [ 0, %for.cond15.preheader ] %result.094 = phi <4 x float> [ %55, %for.cond19.preheader ], [ zeroinitializer, %for.cond15.preheader ] %arrayidx24 = getelementptr inbounds float, float addrspace(4)* %filter, i32 %i14.095 %32 = load float, float addrspace(4)* %arrayidx24, align 4, !tbaa !12 %splat.splatinsert = insertelement <4 x float> undef, float %32, i32 0 %splat.splat = shufflevector <4 x float> %splat.splatinsert, <4 x float> undef, <4 x i32> zeroinitializer %add27 = add nuw i32 %i14.095, %2 %arrayidx28 = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %temp, i32 %add27 %33 = load <4 x float>, <4 x float> addrspace(3)* %arrayidx28, align 16, !tbaa !14 %34 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %splat.splat, <4 x float> %33, <4 x float> %result.094) %add23.1 = or i32 %i14.095, 1 %arrayidx24.1 = getelementptr inbounds float, float addrspace(4)* %filter, i32 %add23.1 %35 = load float, float addrspace(4)* %arrayidx24.1, align 4, !tbaa !12 %splat.splatinsert.1 = insertelement <4 x float> undef, float %35, i32 0 %splat.splat.1 = shufflevector <4 x float> %splat.splatinsert.1, <4 x float> undef, <4 x i32> zeroinitializer %add27.1 = add nuw i32 %add23.1, %2 %arrayidx28.1 = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %temp, i32 %add27.1 %36 = load <4 x float>, <4 x float> addrspace(3)* %arrayidx28.1, align 16, !tbaa !14 %37 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %splat.splat.1, <4 x float> %36, <4 x float> %34) %add23.2 = or i32 %i14.095, 2 %arrayidx24.2 = getelementptr inbounds float, float addrspace(4)* %filter, i32 %add23.2 %38 = load float, float addrspace(4)* %arrayidx24.2, align 4, !tbaa !12 %splat.splatinsert.2 = insertelement <4 x float> undef, float %38, i32 0 %splat.splat.2 = shufflevector <4 x float> %splat.splatinsert.2, <4 x float> undef, <4 x i32> zeroinitializer %add27.2 = add nuw i32 %add23.2, %2 %arrayidx28.2 = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %temp, i32 %add27.2 %39 = load <4 x float>, <4 x float> addrspace(3)* %arrayidx28.2, align 16, !tbaa !14 %40 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %splat.splat.2, <4 x float> %39, <4 x float> %37) %add23.3 = or i32 %i14.095, 3 %arrayidx24.3 = getelementptr inbounds float, float addrspace(4)* %filter, i32 %add23.3 %41 = load float, float addrspace(4)* %arrayidx24.3, align 4, !tbaa !12 %splat.splatinsert.3 = insertelement <4 x float> undef, float %41, i32 0 %splat.splat.3 = shufflevector <4 x float> %splat.splatinsert.3, <4 x float> undef, <4 x i32> zeroinitializer %add27.3 = add nuw i32 %add23.3, %2 %arrayidx28.3 = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %temp, i32 %add27.3 %42 = load <4 x float>, <4 x float> addrspace(3)* %arrayidx28.3, align 16, !tbaa !14 %43 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %splat.splat.3, <4 x float> %42, <4 x float> %40) %add23.4 = or i32 %i14.095, 4 %arrayidx24.4 = getelementptr inbounds float, float addrspace(4)* %filter, i32 %add23.4 %44 = load float, float addrspace(4)* %arrayidx24.4, align 4, !tbaa !12 %splat.splatinsert.4 = insertelement <4 x float> undef, float %44, i32 0 %splat.splat.4 = shufflevector <4 x float> %splat.splatinsert.4, <4 x float> undef, <4 x i32> zeroinitializer %add27.4 = add nuw i32 %add23.4, %2 %arrayidx28.4 = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %temp, i32 %add27.4 %45 = load <4 x float>, <4 x float> addrspace(3)* %arrayidx28.4, align 16, !tbaa !14 %46 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %splat.splat.4, <4 x float> %45, <4 x float> %43) %add23.5 = or i32 %i14.095, 5 %arrayidx24.5 = getelementptr inbounds float, float addrspace(4)* %filter, i32 %add23.5 %47 = load float, float addrspace(4)* %arrayidx24.5, align 4, !tbaa !12 %splat.splatinsert.5 = insertelement <4 x float> undef, float %47, i32 0 %splat.splat.5 = shufflevector <4 x float> %splat.splatinsert.5, <4 x float> undef, <4 x i32> zeroinitializer %add27.5 = add nuw i32 %add23.5, %2 %arrayidx28.5 = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %temp, i32 %add27.5 %48 = load <4 x float>, <4 x float> addrspace(3)* %arrayidx28.5, align 16, !tbaa !14 %49 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %splat.splat.5, <4 x float> %48, <4 x float> %46) %add23.6 = or i32 %i14.095, 6 %arrayidx24.6 = getelementptr inbounds float, float addrspace(4)* %filter, i32 %add23.6 %50 = load float, float addrspace(4)* %arrayidx24.6, align 4, !tbaa !12 %splat.splatinsert.6 = insertelement <4 x float> undef, float %50, i32 0 %splat.splat.6 = shufflevector <4 x float> %splat.splatinsert.6, <4 x float> undef, <4 x i32> zeroinitializer %add27.6 = add nuw i32 %add23.6, %2 %arrayidx28.6 = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %temp, i32 %add27.6 %51 = load <4 x float>, <4 x float> addrspace(3)* %arrayidx28.6, align 16, !tbaa !14 %52 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %splat.splat.6, <4 x float> %51, <4 x float> %49) %add23.7 = or i32 %i14.095, 7 %arrayidx24.7 = getelementptr inbounds float, float addrspace(4)* %filter, i32 %add23.7 %53 = load float, float addrspace(4)* %arrayidx24.7, align 4, !tbaa !12 %splat.splatinsert.7 = insertelement <4 x float> undef, float %53, i32 0 %splat.splat.7 = shufflevector <4 x float> %splat.splatinsert.7, <4 x float> undef, <4 x i32> zeroinitializer %add27.7 = add nuw i32 %add23.7, %2 %arrayidx28.7 = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %temp, i32 %add27.7 %54 = load <4 x float>, <4 x float> addrspace(3)* %arrayidx28.7, align 16, !tbaa !14 %55 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %splat.splat.7, <4 x float> %54, <4 x float> %52) %add32 = add nuw nsw i32 %i14.095, 8 %add16 = or i32 %add32, 7 %cmp17 = icmp ult i32 %add16, %width br i1 %cmp17, label %for.cond19.preheader, label %for.cond34.preheader.loopexit for.cond34.preheader.loopexit: ; preds = %for.cond19.preheader %56 = and i32 %width, -8 br label %for.cond34.preheader for.cond34.preheader: ; preds = %for.cond34.preheader.loopexit, %for.cond15.preheader %result.0.lcssa = phi <4 x float> [ zeroinitializer, %for.cond15.preheader ], [ %55, %for.cond34.preheader.loopexit ] %i14.0.lcssa = phi i32 [ 0, %for.cond15.preheader ], [ %56, %for.cond34.preheader.loopexit ] %cmp3588 = icmp ult i32 %i14.0.lcssa, %width br i1 %cmp3588, label %for.body36, label %for.end46 for.body36: ; preds = %for.cond34.preheader, %for.body36 %i14.190 = phi i32 [ %inc45, %for.body36 ], [ %i14.0.lcssa, %for.cond34.preheader ] %result.289 = phi <4 x float> [ %59, %for.body36 ], [ %result.0.lcssa, %for.cond34.preheader ] %arrayidx37 = getelementptr inbounds float, float addrspace(4)* %filter, i32 %i14.190 %57 = load float, float addrspace(4)* %arrayidx37, align 4, !tbaa !12 %splat.splatinsert38 = insertelement <4 x float> undef, float %57, i32 0 %splat.splat39 = shufflevector <4 x float> %splat.splatinsert38, <4 x float> undef, <4 x i32> zeroinitializer %add41 = add nuw i32 %i14.190, %2 %arrayidx42 = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %temp, i32 %add41 %58 = load <4 x float>, <4 x float> addrspace(3)* %arrayidx42, align 16, !tbaa !14 %59 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %splat.splat39, <4 x float> %58, <4 x float> %result.289) %inc45 = add nuw nsw i32 %i14.190, 1 %exitcond = icmp eq i32 %inc45, %width br i1 %exitcond, label %for.end46, label %for.body36 for.end46: ; preds = %for.body36, %for.cond34.preheader %result.2.lcssa = phi <4 x float> [ %result.0.lcssa, %for.cond34.preheader ], [ %59, %for.body36 ] %mul47 = mul nsw i32 %16, %imageColumns %add48 = add nsw i32 %8, %mul47 %arrayidx49 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %tempImage, i32 %add48 store <4 x float> %result.2.lcssa, <4 x float> addrspace(1)* %arrayidx49, align 16, !tbaa !14 br label %if.end if.end: ; preds = %for.end46, %for.cond.cleanup ret void } ; Function Attrs: nounwind readnone speculatable declare <4 x float> @llvm.fmuladd.v4f32(<4 x float>, <4 x float>, <4 x float>) #5 ; Function Attrs: convergent nounwind define amdgpu_kernel void @BlurColumn(<4 x float> addrspace(1)* nocapture readonly %blurRowData, i32 %number_channels, i32 %channel, float addrspace(4)* nocapture readonly %filter, i32 %width, i32 %imageColumns, i32 %imageRows, <4 x float> addrspace(3)* nocapture %temp, float addrspace(1)* nocapture %filteredImage) local_unnamed_addr #4 !kernel_arg_addr_space !19 !kernel_arg_access_qual !20 !kernel_arg_type !24 !kernel_arg_base_type !25 !kernel_arg_type_qual !23 { entry: %0 = tail call i32 @llvm.r600.read.tgid.x() #13 %x.i.i = tail call i32 @llvm.r600.read.local.size.x() #13 %1 = mul i32 %x.i.i, %0 %2 = tail call i32 @llvm.r600.read.tidig.x() #13, !range !3 %3 = add i32 %1, %2 %4 = tail call i8 addrspace(7)* @llvm.r600.implicitarg.ptr() #13 %5 = getelementptr inbounds i8, i8 addrspace(7)* %4, i32 4 %6 = bitcast i8 addrspace(7)* %5 to i32 addrspace(7)* %7 = load i32, i32 addrspace(7)* %6, align 4, !tbaa !4 %8 = add i32 %3, %7 %9 = tail call i32 @llvm.r600.read.tgid.y() #13 %y.i.i88 = tail call i32 @llvm.r600.read.local.size.y() #13 %10 = mul i32 %y.i.i88, %9 %11 = tail call i32 @llvm.r600.read.tidig.y() #13, !range !3 %12 = add i32 %10, %11 %13 = getelementptr inbounds i8, i8 addrspace(7)* %4, i32 8 %14 = bitcast i8 addrspace(7)* %13 to i32 addrspace(7)* %15 = load i32, i32 addrspace(7)* %14, align 4, !tbaa !4 %16 = add i32 %15, %12 %add = add i32 %y.i.i88, %width %cmp99 = icmp ult i32 %11, %add br i1 %cmp99, label %for.body.lr.ph, label %for.cond.cleanup for.body.lr.ph: ; preds = %entry %sub = add i32 %width, -1 %div = lshr i32 %sub, 1 %add9 = sub i32 %10, %div %sub.i = add nsw i32 %imageRows, -1 br label %for.body for.cond.cleanup: ; preds = %for.body, %entry tail call void @llvm.r600.group.barrier() #13 %17 = load i32, i32 addrspace(7)* %14, align 4, !tbaa !4 %18 = add i32 %17, %12 %cmp18 = icmp ult i32 %18, %imageRows br i1 %cmp18, label %for.cond20.preheader, label %if.end for.cond20.preheader: ; preds = %for.cond.cleanup %cmp2294 = icmp ugt i32 %width, 7 br i1 %cmp2294, label %for.cond24.preheader, label %for.cond39.preheader for.body: ; preds = %for.body.lr.ph, %for.body %i.0100 = phi i32 [ %11, %for.body.lr.ph ], [ %add16, %for.body ] %sub10 = add i32 %add9, %i.0100 %19 = icmp slt i32 %sub10, %imageRows %20 = icmp sgt i32 %sub10, 0 %21 = select i1 %20, i32 %sub10, i32 0 %22 = select i1 %19, i32 %21, i32 %sub.i %mul12 = mul nsw i32 %22, %imageColumns %add13 = add nsw i32 %mul12, %1 %arrayidx = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %blurRowData, i32 %add13 %23 = load <4 x float>, <4 x float> addrspace(1)* %arrayidx, align 16, !tbaa !14 %arrayidx14 = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %temp, i32 %i.0100 store <4 x float> %23, <4 x float> addrspace(3)* %arrayidx14, align 16, !tbaa !14 %add16 = add i32 %i.0100, %y.i.i88 %cmp = icmp ult i32 %add16, %add br i1 %cmp, label %for.body, label %for.cond.cleanup for.cond24.preheader: ; preds = %for.cond20.preheader, %for.cond24.preheader %i19.096 = phi i32 [ %add37, %for.cond24.preheader ], [ 0, %for.cond20.preheader ] %result.095 = phi <4 x float> [ %47, %for.cond24.preheader ], [ zeroinitializer, %for.cond20.preheader ] %arrayidx29 = getelementptr inbounds float, float addrspace(4)* %filter, i32 %i19.096 %24 = load float, float addrspace(4)* %arrayidx29, align 4, !tbaa !12 %splat.splatinsert = insertelement <4 x float> undef, float %24, i32 0 %splat.splat = shufflevector <4 x float> %splat.splatinsert, <4 x float> undef, <4 x i32> zeroinitializer %add32 = add nuw i32 %i19.096, %11 %arrayidx33 = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %temp, i32 %add32 %25 = load <4 x float>, <4 x float> addrspace(3)* %arrayidx33, align 16, !tbaa !14 %26 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %splat.splat, <4 x float> %25, <4 x float> %result.095) %add28.1 = or i32 %i19.096, 1 %arrayidx29.1 = getelementptr inbounds float, float addrspace(4)* %filter, i32 %add28.1 %27 = load float, float addrspace(4)* %arrayidx29.1, align 4, !tbaa !12 %splat.splatinsert.1 = insertelement <4 x float> undef, float %27, i32 0 %splat.splat.1 = shufflevector <4 x float> %splat.splatinsert.1, <4 x float> undef, <4 x i32> zeroinitializer %add32.1 = add nuw i32 %add28.1, %11 %arrayidx33.1 = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %temp, i32 %add32.1 %28 = load <4 x float>, <4 x float> addrspace(3)* %arrayidx33.1, align 16, !tbaa !14 %29 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %splat.splat.1, <4 x float> %28, <4 x float> %26) %add28.2 = or i32 %i19.096, 2 %arrayidx29.2 = getelementptr inbounds float, float addrspace(4)* %filter, i32 %add28.2 %30 = load float, float addrspace(4)* %arrayidx29.2, align 4, !tbaa !12 %splat.splatinsert.2 = insertelement <4 x float> undef, float %30, i32 0 %splat.splat.2 = shufflevector <4 x float> %splat.splatinsert.2, <4 x float> undef, <4 x i32> zeroinitializer %add32.2 = add nuw i32 %add28.2, %11 %arrayidx33.2 = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %temp, i32 %add32.2 %31 = load <4 x float>, <4 x float> addrspace(3)* %arrayidx33.2, align 16, !tbaa !14 %32 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %splat.splat.2, <4 x float> %31, <4 x float> %29) %add28.3 = or i32 %i19.096, 3 %arrayidx29.3 = getelementptr inbounds float, float addrspace(4)* %filter, i32 %add28.3 %33 = load float, float addrspace(4)* %arrayidx29.3, align 4, !tbaa !12 %splat.splatinsert.3 = insertelement <4 x float> undef, float %33, i32 0 %splat.splat.3 = shufflevector <4 x float> %splat.splatinsert.3, <4 x float> undef, <4 x i32> zeroinitializer %add32.3 = add nuw i32 %add28.3, %11 %arrayidx33.3 = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %temp, i32 %add32.3 %34 = load <4 x float>, <4 x float> addrspace(3)* %arrayidx33.3, align 16, !tbaa !14 %35 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %splat.splat.3, <4 x float> %34, <4 x float> %32) %add28.4 = or i32 %i19.096, 4 %arrayidx29.4 = getelementptr inbounds float, float addrspace(4)* %filter, i32 %add28.4 %36 = load float, float addrspace(4)* %arrayidx29.4, align 4, !tbaa !12 %splat.splatinsert.4 = insertelement <4 x float> undef, float %36, i32 0 %splat.splat.4 = shufflevector <4 x float> %splat.splatinsert.4, <4 x float> undef, <4 x i32> zeroinitializer %add32.4 = add nuw i32 %add28.4, %11 %arrayidx33.4 = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %temp, i32 %add32.4 %37 = load <4 x float>, <4 x float> addrspace(3)* %arrayidx33.4, align 16, !tbaa !14 %38 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %splat.splat.4, <4 x float> %37, <4 x float> %35) %add28.5 = or i32 %i19.096, 5 %arrayidx29.5 = getelementptr inbounds float, float addrspace(4)* %filter, i32 %add28.5 %39 = load float, float addrspace(4)* %arrayidx29.5, align 4, !tbaa !12 %splat.splatinsert.5 = insertelement <4 x float> undef, float %39, i32 0 %splat.splat.5 = shufflevector <4 x float> %splat.splatinsert.5, <4 x float> undef, <4 x i32> zeroinitializer %add32.5 = add nuw i32 %add28.5, %11 %arrayidx33.5 = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %temp, i32 %add32.5 %40 = load <4 x float>, <4 x float> addrspace(3)* %arrayidx33.5, align 16, !tbaa !14 %41 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %splat.splat.5, <4 x float> %40, <4 x float> %38) %add28.6 = or i32 %i19.096, 6 %arrayidx29.6 = getelementptr inbounds float, float addrspace(4)* %filter, i32 %add28.6 %42 = load float, float addrspace(4)* %arrayidx29.6, align 4, !tbaa !12 %splat.splatinsert.6 = insertelement <4 x float> undef, float %42, i32 0 %splat.splat.6 = shufflevector <4 x float> %splat.splatinsert.6, <4 x float> undef, <4 x i32> zeroinitializer %add32.6 = add nuw i32 %add28.6, %11 %arrayidx33.6 = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %temp, i32 %add32.6 %43 = load <4 x float>, <4 x float> addrspace(3)* %arrayidx33.6, align 16, !tbaa !14 %44 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %splat.splat.6, <4 x float> %43, <4 x float> %41) %add28.7 = or i32 %i19.096, 7 %arrayidx29.7 = getelementptr inbounds float, float addrspace(4)* %filter, i32 %add28.7 %45 = load float, float addrspace(4)* %arrayidx29.7, align 4, !tbaa !12 %splat.splatinsert.7 = insertelement <4 x float> undef, float %45, i32 0 %splat.splat.7 = shufflevector <4 x float> %splat.splatinsert.7, <4 x float> undef, <4 x i32> zeroinitializer %add32.7 = add nuw i32 %add28.7, %11 %arrayidx33.7 = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %temp, i32 %add32.7 %46 = load <4 x float>, <4 x float> addrspace(3)* %arrayidx33.7, align 16, !tbaa !14 %47 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %splat.splat.7, <4 x float> %46, <4 x float> %44) %add37 = add nuw nsw i32 %i19.096, 8 %add21 = or i32 %add37, 7 %cmp22 = icmp ult i32 %add21, %width br i1 %cmp22, label %for.cond24.preheader, label %for.cond39.preheader.loopexit for.cond39.preheader.loopexit: ; preds = %for.cond24.preheader %48 = and i32 %width, -8 br label %for.cond39.preheader for.cond39.preheader: ; preds = %for.cond39.preheader.loopexit, %for.cond20.preheader %result.0.lcssa = phi <4 x float> [ zeroinitializer, %for.cond20.preheader ], [ %47, %for.cond39.preheader.loopexit ] %i19.0.lcssa = phi i32 [ 0, %for.cond20.preheader ], [ %48, %for.cond39.preheader.loopexit ] %cmp4089 = icmp ult i32 %i19.0.lcssa, %width br i1 %cmp4089, label %for.body41, label %for.end51 for.body41: ; preds = %for.cond39.preheader, %for.body41 %i19.191 = phi i32 [ %inc50, %for.body41 ], [ %i19.0.lcssa, %for.cond39.preheader ] %result.290 = phi <4 x float> [ %51, %for.body41 ], [ %result.0.lcssa, %for.cond39.preheader ] %arrayidx42 = getelementptr inbounds float, float addrspace(4)* %filter, i32 %i19.191 %49 = load float, float addrspace(4)* %arrayidx42, align 4, !tbaa !12 %splat.splatinsert43 = insertelement <4 x float> undef, float %49, i32 0 %splat.splat44 = shufflevector <4 x float> %splat.splatinsert43, <4 x float> undef, <4 x i32> zeroinitializer %add46 = add nuw i32 %i19.191, %11 %arrayidx47 = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %temp, i32 %add46 %50 = load <4 x float>, <4 x float> addrspace(3)* %arrayidx47, align 16, !tbaa !14 %51 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %splat.splat44, <4 x float> %50, <4 x float> %result.290) %inc50 = add nuw nsw i32 %i19.191, 1 %exitcond = icmp eq i32 %inc50, %width br i1 %exitcond, label %for.end51, label %for.body41 for.end51: ; preds = %for.body41, %for.cond39.preheader %result.2.lcssa = phi <4 x float> [ %result.0.lcssa, %for.cond39.preheader ], [ %51, %for.body41 ] %mul1.i.i = mul i32 %16, %imageColumns %mul4.i.i = add i32 %8, %mul1.i.i %add.i.i = mul i32 %mul4.i.i, %number_channels %add.ptr.i = getelementptr inbounds float, float addrspace(1)* %filteredImage, i32 %add.i.i %52 = extractelement <4 x float> %result.2.lcssa, i32 0 %53 = extractelement <4 x float> %result.2.lcssa, i32 1 %54 = extractelement <4 x float> %result.2.lcssa, i32 2 %55 = extractelement <4 x float> %result.2.lcssa, i32 3 %and.i.i = and i32 %channel, 1 %cmp.i.i = icmp eq i32 %and.i.i, 0 br i1 %cmp.i.i, label %if.end.i.i, label %if.then.i.i if.then.i.i: ; preds = %for.end51 %56 = fcmp ogt float %52, 6.553500e+04 %57 = fcmp olt float %52, 0.000000e+00 %58 = select i1 %57, float 0.000000e+00, float %52 %.op.i.i.i = fadd float %58, 5.000000e-01 %add.i.i.i = select i1 %56, float 6.553550e+04, float %.op.i.i.i store float %add.i.i.i, float addrspace(1)* %add.ptr.i, align 4, !tbaa !12 br label %if.end.i.i if.end.i.i: ; preds = %if.then.i.i, %for.end51 %cmp1.i.i = icmp ugt i32 %number_channels, 2 br i1 %cmp1.i.i, label %if.then2.i.i, label %if.end13.i.i if.then2.i.i: ; preds = %if.end.i.i %and3.i.i = and i32 %channel, 2 %cmp4.i.i = icmp eq i32 %and3.i.i, 0 br i1 %cmp4.i.i, label %if.end7.i.i, label %if.then5.i.i if.then5.i.i: ; preds = %if.then2.i.i %add.ptr.i35.i.i = getelementptr inbounds float, float addrspace(1)* %add.ptr.i, i32 1 %59 = fcmp ogt float %53, 6.553500e+04 %60 = fcmp olt float %53, 0.000000e+00 %61 = select i1 %60, float 0.000000e+00, float %53 %.op.i36.i.i = fadd float %61, 5.000000e-01 %add.i37.i.i = select i1 %59, float 6.553550e+04, float %.op.i36.i.i store float %add.i37.i.i, float addrspace(1)* %add.ptr.i35.i.i, align 4, !tbaa !12 br label %if.end7.i.i if.end7.i.i: ; preds = %if.then5.i.i, %if.then2.i.i %and8.i.i = and i32 %channel, 4 %cmp9.i.i = icmp eq i32 %and8.i.i, 0 br i1 %cmp9.i.i, label %if.end13.i.i, label %if.then10.i.i if.then10.i.i: ; preds = %if.end7.i.i %add.ptr.i32.i.i = getelementptr inbounds float, float addrspace(1)* %add.ptr.i, i32 2 %62 = fcmp ogt float %54, 6.553500e+04 %63 = fcmp olt float %54, 0.000000e+00 %64 = select i1 %63, float 0.000000e+00, float %54 %.op.i33.i.i = fadd float %64, 5.000000e-01 %add.i34.i.i = select i1 %62, float 6.553550e+04, float %.op.i33.i.i store float %add.i34.i.i, float addrspace(1)* %add.ptr.i32.i.i, align 4, !tbaa !12 br label %if.end13.i.i if.end13.i.i: ; preds = %if.then10.i.i, %if.end7.i.i, %if.end.i.i switch i32 %number_channels, label %if.end [ i32 4, label %land.lhs.true.i.i i32 2, label %land.lhs.true.i.i ] land.lhs.true.i.i: ; preds = %if.end13.i.i, %if.end13.i.i %and16.i.i = and i32 %channel, 16 %cmp17.i.i = icmp eq i32 %and16.i.i, 0 br i1 %cmp17.i.i, label %if.end, label %if.then18.i.i if.then18.i.i: ; preds = %land.lhs.true.i.i %add.ptr.i.i.i = getelementptr inbounds float, float addrspace(1)* %add.ptr.i, i32 %number_channels %add.ptr1.i.i.i = getelementptr inbounds float, float addrspace(1)* %add.ptr.i.i.i, i32 -1 %65 = fcmp ogt float %55, 6.553500e+04 %66 = fcmp olt float %55, 0.000000e+00 %67 = select i1 %66, float 0.000000e+00, float %55 %.op.i30.i.i = fadd float %67, 5.000000e-01 %add.i31.i.i = select i1 %65, float 6.553550e+04, float %.op.i30.i.i store float %add.i31.i.i, float addrspace(1)* %add.ptr1.i.i.i, align 4, !tbaa !12 br label %if.end if.end: ; preds = %if.then18.i.i, %land.lhs.true.i.i, %if.end13.i.i, %for.cond.cleanup ret void } ; Function Attrs: convergent nounwind define amdgpu_kernel void @Contrast(float addrspace(1)* nocapture %image, i32 %number_channels, i32 %sign) local_unnamed_addr #4 !kernel_arg_addr_space !26 !kernel_arg_access_qual !27 !kernel_arg_type !28 !kernel_arg_base_type !28 !kernel_arg_type_qual !29 { entry: %0 = tail call i32 @llvm.r600.read.tgid.x() #13 %x.i.i = tail call i32 @llvm.r600.read.local.size.x() #13 %1 = mul i32 %x.i.i, %0 %2 = tail call i32 @llvm.r600.read.tidig.x() #13, !range !3 %3 = add i32 %1, %2 %4 = tail call i8 addrspace(7)* @llvm.r600.implicitarg.ptr() #13 %5 = getelementptr inbounds i8, i8 addrspace(7)* %4, i32 4 %6 = bitcast i8 addrspace(7)* %5 to i32 addrspace(7)* %7 = load i32, i32 addrspace(7)* %6, align 4, !tbaa !4 %8 = add i32 %3, %7 %9 = tail call i32 @llvm.r600.read.tgid.y() #13 %y.i.i = tail call i32 @llvm.r600.read.local.size.y() #13 %10 = mul i32 %y.i.i, %9 %11 = tail call i32 @llvm.r600.read.tidig.y() #13, !range !3 %12 = add i32 %10, %11 %13 = getelementptr inbounds i8, i8 addrspace(7)* %4, i32 8 %14 = bitcast i8 addrspace(7)* %13 to i32 addrspace(7)* %15 = load i32, i32 addrspace(7)* %14, align 4, !tbaa !4 %16 = add i32 %12, %15 %x.i = tail call i32 @llvm.r600.read.global.size.x() #16 %mul1.i.i41 = mul i32 %16, %x.i %mul4.i.i42 = add i32 %8, %mul1.i.i41 %add.i.i43 = mul i32 %mul4.i.i42, %number_channels %add.ptr.i44 = getelementptr inbounds float, float addrspace(1)* %image, i32 %add.i.i43 %17 = load float, float addrspace(1)* %add.ptr.i44, align 4, !tbaa !12 %18 = insertelement <4 x float> undef, float %17, i32 0 %cmp.i45 = icmp ugt i32 %number_channels, 2 br i1 %cmp.i45, label %if.then.i46, label %if.end.i47 if.then.i46: ; preds = %entry %add.ptr.i23.i = getelementptr inbounds float, float addrspace(1)* %add.ptr.i44, i32 1 %19 = load float, float addrspace(1)* %add.ptr.i23.i, align 4, !tbaa !12 %20 = insertelement <4 x float> %18, float %19, i32 1 %add.ptr.i22.i = getelementptr inbounds float, float addrspace(1)* %add.ptr.i44, i32 2 %21 = load float, float addrspace(1)* %add.ptr.i22.i, align 4, !tbaa !12 %22 = insertelement <4 x float> %20, float %21, i32 2 br label %if.end.i47 if.end.i47: ; preds = %if.then.i46, %entry %pixel.0.i = phi <4 x float> [ %22, %if.then.i46 ], [ %18, %entry ] switch i32 %number_channels, label %ReadAllChannels.exit [ i32 4, label %if.then6.i50 i32 2, label %if.then6.i50 ] if.then6.i50: ; preds = %if.end.i47, %if.end.i47 %add.ptr.i.i48 = getelementptr inbounds float, float addrspace(1)* %add.ptr.i44, i32 %number_channels %add.ptr1.i.i49 = getelementptr inbounds float, float addrspace(1)* %add.ptr.i.i48, i32 -1 %23 = load float, float addrspace(1)* %add.ptr1.i.i49, align 4, !tbaa !12 %24 = insertelement <4 x float> %pixel.0.i, float %23, i32 3 br label %ReadAllChannels.exit ReadAllChannels.exit: ; preds = %if.end.i47, %if.then6.i50 %pixel.1.i = phi <4 x float> [ %24, %if.then6.i50 ], [ %pixel.0.i, %if.end.i47 ] %cmp = icmp ult i32 %number_channels, 3 %25 = shufflevector <4 x float> %pixel.1.i, <4 x float> undef, <4 x i32> %spec.select = select i1 %cmp, <4 x float> %25, <4 x float> %pixel.1.i %26 = shufflevector <4 x float> , <4 x float> %spec.select, <4 x i32> %27 = extractelement <4 x float> %spec.select, i32 0 %28 = extractelement <4 x float> %spec.select, i32 1 %cmp.i36 = fcmp ogt float %27, %28 %cond.i = select i1 %cmp.i36, float %27, float %28 %29 = extractelement <4 x float> %spec.select, i32 2 %cmp1.i = fcmp ogt float %cond.i, %29 %cond..i = select i1 %cmp1.i, float %cond.i, float %29 %cmp11.i = fcmp une float %cond..i, 0.000000e+00 br i1 %cmp11.i, label %if.then.i39, label %ConvertRGBToHSB.exit if.then.i39: ; preds = %ReadAllChannels.exit %cmp12.i = fcmp olt float %27, %28 %cond16.i = select i1 %cmp12.i, float %27, float %28 %cmp17.i = fcmp olt float %cond16.i, %29 %cond16..i = select i1 %cmp17.i, float %cond16.i, float %29 %sub.i37 = fsub float %cond..i, %cond16..i %div.i = fdiv float %sub.i37, %cond..i, !fpmath !11 %30 = insertelement <4 x float> %26, float %div.i, i32 1 %mul.i38 = fmul float %cond..i, 0x3EEF751040000000 %31 = insertelement <4 x float> %30, float %mul.i38, i32 2 %cmp27.i = fcmp une float %sub.i37, 0.000000e+00 br i1 %cmp27.i, label %if.then28.i, label %ConvertRGBToHSB.exit if.then28.i: ; preds = %if.then.i39 %cmp29.i = fcmp oeq float %27, %cond..i %cmp32.i = fcmp oeq float %28, %cond..i %cond33.i = select i1 %cmp32.i, float 2.000000e+00, float 4.000000e+00 %cond35.i = select i1 %cmp29.i, float 0.000000e+00, float %cond33.i br i1 %cmp29.i, label %cond.true37.i, label %cond.false39.i cond.true37.i: ; preds = %if.then28.i %sub38.i = fsub float %28, %29 br label %cond.end47.i cond.false39.i: ; preds = %if.then28.i br i1 %cmp32.i, label %cond.true41.i, label %cond.false43.i cond.true41.i: ; preds = %cond.false39.i %sub42.i = fsub float %29, %27 br label %cond.end47.i cond.false43.i: ; preds = %cond.false39.i %sub44.i = fsub float %27, %28 br label %cond.end47.i cond.end47.i: ; preds = %cond.false43.i, %cond.true41.i, %cond.true37.i %cond48.i = phi float [ %sub38.i, %cond.true37.i ], [ %sub42.i, %cond.true41.i ], [ %sub44.i, %cond.false43.i ] %div49.i = fdiv float %cond48.i, %sub.i37, !fpmath !11 %add.i = fadd float %cond35.i, %div49.i %div50.i = fdiv float %add.i, 6.000000e+00, !fpmath !11 %cmp51.i = fcmp olt float %div50.i, 0.000000e+00 %cond52.i = select i1 %cmp51.i, float 0.000000e+00, float 1.000000e+00 %add53.i = fadd float %div50.i, %cond52.i %32 = insertelement <4 x float> %31, float %add53.i, i32 0 br label %ConvertRGBToHSB.exit ConvertRGBToHSB.exit: ; preds = %ReadAllChannels.exit, %if.then.i39, %cond.end47.i %result.1.i40 = phi <4 x float> [ %26, %ReadAllChannels.exit ], [ %32, %cond.end47.i ], [ %31, %if.then.i39 ] %33 = extractelement <4 x float> %result.1.i40, i32 2 %conv = sitofp i32 %sign to float %mul = fmul float %conv, 5.000000e-01 %sub = fadd float %33, -5.000000e-01 %34 = bitcast float %sub to i32 %35 = and i32 %34, -2147483648 %36 = and i32 %34, 2147483647 %37 = bitcast i32 %36 to float %38 = fptosi float %37 to i32 %39 = sitofp i32 %38 to float %40 = fsub float %37, %39 %41 = shl i32 %38, 31 %42 = xor i32 %41, %35 %43 = icmp ult i32 %36, 2139095040 %44 = select i1 %43, i32 %35, i32 2143289344 %45 = fsub float 1.000000e+00, %40 %46 = fcmp ole float %40, 7.500000e-01 %47 = fadd float %40, -5.000000e-01 %48 = select i1 %46, float %47, float %45 %49 = fcmp olt float %40, 5.000000e-01 %50 = fsub float 5.000000e-01, %40 %51 = select i1 %49, float %50, float %48 %52 = fcmp ole float %40, 2.500000e-01 %53 = select i1 %52, float %40, float %51 %54 = xor i1 %52, true %55 = and i1 %46, %54 %56 = fmul float %53, 0x400921FB60000000 %57 = fmul float %56, %56 %58 = fmul float %56, %57 %59 = tail call float @llvm.fmuladd.f32(float %57, float 0x3EC6DBE4A0000000, float 0xBF2A013A80000000) #13 %60 = tail call float @llvm.fmuladd.f32(float %57, float %59, float 0x3F811110E0000000) #13 %61 = tail call float @llvm.fmuladd.f32(float %57, float %60, float 0xBFC5555560000000) #13 %62 = tail call float @llvm.fmuladd.f32(float %58, float %61, float %56) #13 %63 = fmul float %57, %57 %64 = tail call float @llvm.fmuladd.f32(float %57, float 0xBE92524740000000, float 0x3EFA015C60000000) #13 %65 = tail call float @llvm.fmuladd.f32(float %57, float %64, float 0xBF56C16C00000000) #13 %66 = tail call float @llvm.fmuladd.f32(float %57, float %65, float 0x3FA5555560000000) #13 %67 = tail call float @llvm.fmuladd.f32(float %57, float -5.000000e-01, float 1.000000e+00) #13 %68 = tail call float @llvm.fmuladd.f32(float %63, float %66, float %67) #13 %69 = select i1 %55, float %68, float %62 %70 = bitcast float %69 to i32 %71 = xor i32 %42, %70 %72 = icmp ult i32 %36, 1258291200 %73 = select i1 %72, i32 %71, i32 %44 %74 = bitcast i32 %73 to float %add = fadd float %74, 1.000000e+00 %neg = fsub float -0.000000e+00, %33 %75 = tail call float @llvm.fmuladd.f32(float %add, float 5.000000e-01, float %neg) %76 = tail call float @llvm.fmuladd.f32(float %mul, float %75, float %33) %77 = fcmp ogt float %76, 1.000000e+00 %78 = fcmp olt float %76, 0.000000e+00 %79 = select i1 %78, float 0.000000e+00, float %76 %80 = select i1 %77, float 1.000000e+00, float %79 %81 = insertelement <4 x float> %result.1.i40, float %80, i32 2 %82 = extractelement <4 x float> %result.1.i40, i32 0 %83 = extractelement <4 x float> %result.1.i40, i32 1 %cmp.i32 = fcmp oeq float %83, 0.000000e+00 br i1 %cmp.i32, label %if.then.i35, label %if.else.i if.then.i35: ; preds = %ConvertRGBToHSB.exit %mul.i = fmul float %80, 6.553500e+04 %84 = fcmp ogt float %mul.i, 6.553500e+04 %85 = fcmp olt float %mul.i, 0.000000e+00 %86 = select i1 %85, float 0.000000e+00, float %mul.i %.op.i.i33 = fadd float %86, 5.000000e-01 %add.i.i34 = select i1 %84, float 6.553550e+04, float %.op.i.i33 %87 = insertelement <4 x float> %81, float %add.i.i34, i32 2 %88 = insertelement <4 x float> %87, float %add.i.i34, i32 1 %89 = insertelement <4 x float> %88, float %add.i.i34, i32 0 br label %ConvertHSBToRGB.exit if.else.i: ; preds = %ConvertRGBToHSB.exit %call1.i = tail call float @llvm.floor.f32(float %82) #17 %sub.i = fsub float %82, %call1.i %mul2.i = fmul float %sub.i, 6.000000e+00 %call3.i = tail call float @llvm.floor.f32(float %mul2.i) #17 %sub4.i = fsub float %mul2.i, %call3.i %sub5.i = fsub float 1.000000e+00, %83 %mul6.i = fmul float %sub5.i, %80 %neg.i = fsub float -0.000000e+00, %83 %90 = tail call float @llvm.fmuladd.f32(float %neg.i, float %sub4.i, float 1.000000e+00) #13 %mul8.i = fmul float %90, %80 %sub9.i = fsub float 1.000000e+00, %sub4.i %91 = tail call float @llvm.fmuladd.f32(float %neg.i, float %sub9.i, float 1.000000e+00) #13 %mul12.i = fmul float %91, %80 %conv.i = fptosi float %mul2.i to i32 switch i32 %conv.i, label %if.else52.i [ i32 1, label %if.then15.i i32 2, label %if.then25.i i32 3, label %if.then35.i i32 4, label %if.then45.i ] if.then15.i: ; preds = %if.else.i %mul16.i = fmul float %mul8.i, 6.553500e+04 %92 = fcmp ogt float %mul16.i, 6.553500e+04 %93 = fcmp olt float %mul16.i, 0.000000e+00 %94 = select i1 %93, float 0.000000e+00, float %mul16.i %.op.i167.i = fadd float %94, 5.000000e-01 %add.i168.i = select i1 %92, float 6.553550e+04, float %.op.i167.i %95 = insertelement <4 x float> %81, float %add.i168.i, i32 0 %mul18.i = fmul float %80, 6.553500e+04 %96 = fcmp ogt float %mul18.i, 6.553500e+04 %97 = fcmp olt float %mul18.i, 0.000000e+00 %98 = select i1 %97, float 0.000000e+00, float %mul18.i %.op.i165.i = fadd float %98, 5.000000e-01 %add.i166.i = select i1 %96, float 6.553550e+04, float %.op.i165.i %99 = insertelement <4 x float> %95, float %add.i166.i, i32 1 %mul20.i = fmul float %mul6.i, 6.553500e+04 %100 = fcmp ogt float %mul20.i, 6.553500e+04 %101 = fcmp olt float %mul20.i, 0.000000e+00 %102 = select i1 %101, float 0.000000e+00, float %mul20.i %.op.i163.i = fadd float %102, 5.000000e-01 %add.i164.i = select i1 %100, float 6.553550e+04, float %.op.i163.i %103 = insertelement <4 x float> %99, float %add.i164.i, i32 2 br label %ConvertHSBToRGB.exit if.then25.i: ; preds = %if.else.i %mul26.i = fmul float %mul6.i, 6.553500e+04 %104 = fcmp ogt float %mul26.i, 6.553500e+04 %105 = fcmp olt float %mul26.i, 0.000000e+00 %106 = select i1 %105, float 0.000000e+00, float %mul26.i %.op.i161.i = fadd float %106, 5.000000e-01 %add.i162.i = select i1 %104, float 6.553550e+04, float %.op.i161.i %107 = insertelement <4 x float> %81, float %add.i162.i, i32 0 %mul28.i = fmul float %80, 6.553500e+04 %108 = fcmp ogt float %mul28.i, 6.553500e+04 %109 = fcmp olt float %mul28.i, 0.000000e+00 %110 = select i1 %109, float 0.000000e+00, float %mul28.i %.op.i159.i = fadd float %110, 5.000000e-01 %add.i160.i = select i1 %108, float 6.553550e+04, float %.op.i159.i %111 = insertelement <4 x float> %107, float %add.i160.i, i32 1 %mul30.i = fmul float %mul12.i, 6.553500e+04 %112 = fcmp ogt float %mul30.i, 6.553500e+04 %113 = fcmp olt float %mul30.i, 0.000000e+00 %114 = select i1 %113, float 0.000000e+00, float %mul30.i %.op.i157.i = fadd float %114, 5.000000e-01 %add.i158.i = select i1 %112, float 6.553550e+04, float %.op.i157.i %115 = insertelement <4 x float> %111, float %add.i158.i, i32 2 br label %ConvertHSBToRGB.exit if.then35.i: ; preds = %if.else.i %mul36.i = fmul float %mul6.i, 6.553500e+04 %116 = fcmp ogt float %mul36.i, 6.553500e+04 %117 = fcmp olt float %mul36.i, 0.000000e+00 %118 = select i1 %117, float 0.000000e+00, float %mul36.i %.op.i155.i = fadd float %118, 5.000000e-01 %add.i156.i = select i1 %116, float 6.553550e+04, float %.op.i155.i %119 = insertelement <4 x float> %81, float %add.i156.i, i32 0 %mul38.i = fmul float %mul8.i, 6.553500e+04 %120 = fcmp ogt float %mul38.i, 6.553500e+04 %121 = fcmp olt float %mul38.i, 0.000000e+00 %122 = select i1 %121, float 0.000000e+00, float %mul38.i %.op.i153.i = fadd float %122, 5.000000e-01 %add.i154.i = select i1 %120, float 6.553550e+04, float %.op.i153.i %123 = insertelement <4 x float> %119, float %add.i154.i, i32 1 %mul40.i = fmul float %80, 6.553500e+04 %124 = fcmp ogt float %mul40.i, 6.553500e+04 %125 = fcmp olt float %mul40.i, 0.000000e+00 %126 = select i1 %125, float 0.000000e+00, float %mul40.i %.op.i151.i = fadd float %126, 5.000000e-01 %add.i152.i = select i1 %124, float 6.553550e+04, float %.op.i151.i %127 = insertelement <4 x float> %123, float %add.i152.i, i32 2 br label %ConvertHSBToRGB.exit if.then45.i: ; preds = %if.else.i %mul46.i = fmul float %mul12.i, 6.553500e+04 %128 = fcmp ogt float %mul46.i, 6.553500e+04 %129 = fcmp olt float %mul46.i, 0.000000e+00 %130 = select i1 %129, float 0.000000e+00, float %mul46.i %.op.i149.i = fadd float %130, 5.000000e-01 %add.i150.i = select i1 %128, float 6.553550e+04, float %.op.i149.i %131 = insertelement <4 x float> %81, float %add.i150.i, i32 0 %mul48.i = fmul float %mul6.i, 6.553500e+04 %132 = fcmp ogt float %mul48.i, 6.553500e+04 %133 = fcmp olt float %mul48.i, 0.000000e+00 %134 = select i1 %133, float 0.000000e+00, float %mul48.i %.op.i147.i = fadd float %134, 5.000000e-01 %add.i148.i = select i1 %132, float 6.553550e+04, float %.op.i147.i %135 = insertelement <4 x float> %131, float %add.i148.i, i32 1 %mul50.i = fmul float %80, 6.553500e+04 %136 = fcmp ogt float %mul50.i, 6.553500e+04 %137 = fcmp olt float %mul50.i, 0.000000e+00 %138 = select i1 %137, float 0.000000e+00, float %mul50.i %.op.i145.i = fadd float %138, 5.000000e-01 %add.i146.i = select i1 %136, float 6.553550e+04, float %.op.i145.i %139 = insertelement <4 x float> %135, float %add.i146.i, i32 2 br label %ConvertHSBToRGB.exit if.else52.i: ; preds = %if.else.i %cmp53.i = icmp eq i32 %conv.i, 5 %mul56.i = fmul float %80, 6.553500e+04 %140 = fcmp ogt float %mul56.i, 6.553500e+04 %141 = fcmp olt float %mul56.i, 0.000000e+00 %142 = select i1 %141, float 0.000000e+00, float %mul56.i %.op.i143.i = fadd float %142, 5.000000e-01 %add.i144.i = select i1 %140, float 6.553550e+04, float %.op.i143.i %143 = insertelement <4 x float> %81, float %add.i144.i, i32 0 br i1 %cmp53.i, label %if.then55.i, label %if.else62.i if.then55.i: ; preds = %if.else52.i %mul58.i = fmul float %mul6.i, 6.553500e+04 %144 = fcmp ogt float %mul58.i, 6.553500e+04 %145 = fcmp olt float %mul58.i, 0.000000e+00 %146 = select i1 %145, float 0.000000e+00, float %mul58.i %.op.i141.i = fadd float %146, 5.000000e-01 %add.i142.i = select i1 %144, float 6.553550e+04, float %.op.i141.i %147 = insertelement <4 x float> %143, float %add.i142.i, i32 1 %mul60.i = fmul float %mul8.i, 6.553500e+04 %148 = fcmp ogt float %mul60.i, 6.553500e+04 %149 = fcmp olt float %mul60.i, 0.000000e+00 %150 = select i1 %149, float 0.000000e+00, float %mul60.i %.op.i139.i = fadd float %150, 5.000000e-01 %add.i140.i = select i1 %148, float 6.553550e+04, float %.op.i139.i %151 = insertelement <4 x float> %147, float %add.i140.i, i32 2 br label %ConvertHSBToRGB.exit if.else62.i: ; preds = %if.else52.i %mul65.i = fmul float %mul12.i, 6.553500e+04 %152 = fcmp ogt float %mul65.i, 6.553500e+04 %153 = fcmp olt float %mul65.i, 0.000000e+00 %154 = select i1 %153, float 0.000000e+00, float %mul65.i %.op.i137.i = fadd float %154, 5.000000e-01 %add.i138.i = select i1 %152, float 6.553550e+04, float %.op.i137.i %155 = insertelement <4 x float> %143, float %add.i138.i, i32 1 %mul67.i = fmul float %mul6.i, 6.553500e+04 %156 = fcmp ogt float %mul67.i, 6.553500e+04 %157 = fcmp olt float %mul67.i, 0.000000e+00 %158 = select i1 %157, float 0.000000e+00, float %mul67.i %.op.i135.i = fadd float %158, 5.000000e-01 %add.i136.i = select i1 %156, float 6.553550e+04, float %.op.i135.i %159 = insertelement <4 x float> %155, float %add.i136.i, i32 2 br label %ConvertHSBToRGB.exit ConvertHSBToRGB.exit: ; preds = %if.then.i35, %if.then15.i, %if.then25.i, %if.then35.i, %if.then45.i, %if.then55.i, %if.else62.i %result.1.i = phi <4 x float> [ %89, %if.then.i35 ], [ %103, %if.then15.i ], [ %115, %if.then25.i ], [ %127, %if.then35.i ], [ %139, %if.then45.i ], [ %151, %if.then55.i ], [ %159, %if.else62.i ] %160 = extractelement <4 x float> %result.1.i, i32 0 %161 = fcmp ogt float %160, 6.553500e+04 %162 = fcmp olt float %160, 0.000000e+00 %163 = select i1 %162, float 0.000000e+00, float %160 %.op.i27.i = fadd float %163, 5.000000e-01 %add.i28.i = select i1 %161, float 6.553550e+04, float %.op.i27.i store float %add.i28.i, float addrspace(1)* %add.ptr.i44, align 4, !tbaa !12 br i1 %cmp.i45, label %if.then.i, label %if.end.i if.then.i: ; preds = %ConvertHSBToRGB.exit %164 = extractelement <4 x float> %result.1.i, i32 1 %165 = fcmp ogt float %164, 6.553500e+04 %166 = fcmp olt float %164, 0.000000e+00 %167 = select i1 %166, float 0.000000e+00, float %164 %.op.i25.i = fadd float %167, 5.000000e-01 %add.i26.i = select i1 %165, float 6.553550e+04, float %.op.i25.i %add.ptr.i24.i = getelementptr inbounds float, float addrspace(1)* %add.ptr.i44, i32 1 store float %add.i26.i, float addrspace(1)* %add.ptr.i24.i, align 4, !tbaa !12 %168 = extractelement <4 x float> %result.1.i, i32 2 %169 = fcmp ogt float %168, 6.553500e+04 %170 = fcmp olt float %168, 0.000000e+00 %171 = select i1 %170, float 0.000000e+00, float %168 %.op.i22.i = fadd float %171, 5.000000e-01 %add.i23.i = select i1 %169, float 6.553550e+04, float %.op.i22.i %add.ptr.i21.i = getelementptr inbounds float, float addrspace(1)* %add.ptr.i44, i32 2 store float %add.i23.i, float addrspace(1)* %add.ptr.i21.i, align 4, !tbaa !12 br label %if.end.i if.end.i: ; preds = %if.then.i, %ConvertHSBToRGB.exit switch i32 %number_channels, label %WriteAllChannels.exit [ i32 4, label %if.then6.i i32 2, label %if.then6.i ] if.then6.i: ; preds = %if.end.i, %if.end.i %172 = extractelement <4 x float> %result.1.i, i32 3 %173 = fcmp ogt float %172, 6.553500e+04 %174 = fcmp olt float %172, 0.000000e+00 %175 = select i1 %174, float 0.000000e+00, float %172 %.op.i.i = fadd float %175, 5.000000e-01 %add.i20.i = select i1 %173, float 6.553550e+04, float %.op.i.i %add.ptr.i.i = getelementptr inbounds float, float addrspace(1)* %add.ptr.i44, i32 %number_channels %add.ptr1.i.i = getelementptr inbounds float, float addrspace(1)* %add.ptr.i.i, i32 -1 store float %add.i20.i, float addrspace(1)* %add.ptr1.i.i, align 4, !tbaa !12 br label %WriteAllChannels.exit WriteAllChannels.exit: ; preds = %if.end.i, %if.then6.i ret void } ; Function Attrs: convergent nounwind define amdgpu_kernel void @Histogram(<4 x float> addrspace(1)* noalias nocapture readonly %im, i32 %channel, i32 %colorspace, i32 %method, <4 x i32> addrspace(1)* noalias nocapture %histogram) local_unnamed_addr #4 !kernel_arg_addr_space !30 !kernel_arg_access_qual !31 !kernel_arg_type !32 !kernel_arg_base_type !33 !kernel_arg_type_qual !34 { entry: %0 = tail call i32 @llvm.r600.read.tgid.x() #13 %x.i.i = tail call i32 @llvm.r600.read.local.size.x() #13 %1 = tail call i32 @llvm.r600.read.tidig.x() #13, !range !3 %2 = tail call i8 addrspace(7)* @llvm.r600.implicitarg.ptr() #13 %3 = tail call i32 @llvm.r600.read.tgid.y() #13 %y.i.i = tail call i32 @llvm.r600.read.local.size.y() #13 %4 = tail call i32 @llvm.r600.read.tidig.y() #13, !range !3 %x.i = tail call i32 @llvm.r600.read.global.size.x() #16 %and = and i32 %channel, 131072 %cmp = icmp eq i32 %and, 0 br i1 %cmp, label %if.end, label %if.then if.then: ; preds = %entry %5 = getelementptr inbounds i8, i8 addrspace(7)* %2, i32 8 %6 = bitcast i8 addrspace(7)* %5 to i32 addrspace(7)* %7 = load i32, i32 addrspace(7)* %6, align 4, !tbaa !4 %8 = mul i32 %y.i.i, %3 %9 = add i32 %8, %4 %10 = add i32 %9, %7 %11 = getelementptr inbounds i8, i8 addrspace(7)* %2, i32 4 %12 = bitcast i8 addrspace(7)* %11 to i32 addrspace(7)* %13 = load i32, i32 addrspace(7)* %12, align 4, !tbaa !4 %14 = mul i32 %x.i.i, %0 %15 = add i32 %14, %1 %16 = add i32 %15, %13 %mul = mul nsw i32 %10, %x.i %add = add nsw i32 %16, %mul %arrayidx = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %im, i32 %add %17 = load <4 x float>, <4 x float> addrspace(1)* %arrayidx, align 16, !tbaa !14 %18 = extractelement <4 x float> %17, i32 2 %19 = extractelement <4 x float> %17, i32 1 %20 = extractelement <4 x float> %17, i32 0 switch i32 %colorspace, label %if.end.i [ i32 33, label %GetPixelIntensity.exit i32 3, label %GetPixelIntensity.exit ] if.end.i: ; preds = %if.then switch i32 %method, label %sw.default.i [ i32 1, label %sw.bb.i i32 2, label %sw.bb3.i i32 3, label %sw.bb15.i i32 4, label %sw.bb48.i i32 5, label %sw.bb51.i i32 6, label %sw.bb53.i i32 9, label %sw.bb59.i i32 8, label %sw.bb57.i ] sw.bb.i: ; preds = %if.end.i %add.i26 = fadd float %18, %19 %add2.i = fadd float %20, %add.i26 %div.i = fdiv float %add2.i, 3.000000e+00, !fpmath !11 br label %GetPixelIntensity.exit sw.bb3.i: ; preds = %if.end.i %cmp4.i = fcmp ogt float %18, %19 %cond.i = select i1 %cmp4.i, float %18, float %19 %cmp5.i = fcmp ogt float %cond.i, %20 %cond.blue.i = select i1 %cmp5.i, float %cond.i, float %20 br label %GetPixelIntensity.exit sw.bb15.i: ; preds = %if.end.i %cmp16.i = fcmp olt float %18, %19 %cond20.i = select i1 %cmp16.i, float %18, float %19 %cmp21.i = fcmp olt float %cond20.i, %20 %cond20.blue.i = select i1 %cmp21.i, float %cond20.i, float %20 %cmp31.i = fcmp ogt float %18, %19 %cond35.i = select i1 %cmp31.i, float %18, float %19 %cmp36.i = fcmp ogt float %cond35.i, %20 %cond45.i = select i1 %cmp36.i, float %cond35.i, float %20 %add46.i = fadd float %cond20.blue.i, %cond45.i %div47.i = fmul float %add46.i, 5.000000e-01 br label %GetPixelIntensity.exit sw.bb48.i: ; preds = %if.end.i %mul49.i = fmul float %19, %19 %21 = tail call float @llvm.fmuladd.f32(float %18, float %18, float %mul49.i) #13 %22 = tail call float @llvm.fmuladd.f32(float %20, float %20, float %21) #13 %div50.i = fdiv float %22, 1.966050e+05, !fpmath !11 br label %GetPixelIntensity.exit sw.bb51.i: ; preds = %if.end.i %mul52.i = fmul float %19, 0x3FE2C727E0000000 %23 = tail call float @llvm.fmuladd.f32(float %18, float 0x3FD3202DA0000000, float %mul52.i) #13 %24 = tail call float @llvm.fmuladd.f32(float %20, float 0x3FBD460AA0000000, float %23) #13 br label %GetPixelIntensity.exit sw.bb53.i: ; preds = %if.end.i %mul54.i = fmul float %19, 0x3FE2C727E0000000 %25 = tail call float @llvm.fmuladd.f32(float %18, float 0x3FD3202DA0000000, float %mul54.i) #13 %26 = tail call float @llvm.fmuladd.f32(float %20, float 0x3FBD460AA0000000, float %25) #13 br label %GetPixelIntensity.exit sw.default.i: ; preds = %if.end.i %mul56.i = fmul float %19, 0x3FE6E29300000000 %27 = tail call float @llvm.fmuladd.f32(float %18, float 0x3FCB384FE0000000, float %mul56.i) #13 %28 = tail call float @llvm.fmuladd.f32(float %20, float 0x3FB27AC820000000, float %27) #13 br label %GetPixelIntensity.exit sw.bb57.i: ; preds = %if.end.i %mul58.i = fmul float %19, 0x3FE6E29300000000 %29 = tail call float @llvm.fmuladd.f32(float %18, float 0x3FCB384FE0000000, float %mul58.i) #13 %30 = tail call float @llvm.fmuladd.f32(float %20, float 0x3FB27AC820000000, float %29) #13 br label %GetPixelIntensity.exit sw.bb59.i: ; preds = %if.end.i %mul60.i = fmul float %19, %19 %31 = tail call float @llvm.fmuladd.f32(float %18, float %18, float %mul60.i) #13 %32 = tail call float @llvm.fmuladd.f32(float %20, float %20, float %31) #13 %33 = tail call float @llvm.sqrt.f32(float %32) #14 %34 = tail call float @llvm.sqrt.f32(float 3.000000e+00) #14 %div62.i = fdiv float %33, %34, !fpmath !11 br label %GetPixelIntensity.exit GetPixelIntensity.exit: ; preds = %if.then, %if.then, %sw.bb.i, %sw.bb3.i, %sw.bb15.i, %sw.bb48.i, %sw.bb51.i, %sw.bb53.i, %sw.default.i, %sw.bb57.i, %sw.bb59.i %retval.0.i = phi float [ %18, %if.then ], [ %18, %if.then ], [ %28, %sw.default.i ], [ %30, %sw.bb57.i ], [ %div62.i, %sw.bb59.i ], [ %26, %sw.bb53.i ], [ %24, %sw.bb51.i ], [ %div50.i, %sw.bb48.i ], [ %div47.i, %sw.bb15.i ], [ %cond.blue.i, %sw.bb3.i ], [ %div.i, %sw.bb.i ] %35 = fcmp ogt float %retval.0.i, 6.553500e+04 %36 = fcmp olt float %retval.0.i, 0.000000e+00 %37 = select i1 %36, float 0.000000e+00, float %retval.0.i %.op.i = fadd float %37, 5.000000e-01 %add.i = select i1 %35, float 6.553550e+04, float %.op.i %.inv.i = fcmp oge float %add.i, 6.553500e+04 %retval.02.i = select i1 %.inv.i, float 6.553500e+04, float %add.i %38 = fptoui float %retval.02.i to i32 %add.ptr = getelementptr inbounds <4 x i32>, <4 x i32> addrspace(1)* %histogram, i32 %38, i32 2 %39 = atomicrmw add i32 addrspace(1)* %add.ptr, i32 1 seq_cst br label %if.end if.end: ; preds = %entry, %GetPixelIntensity.exit ret void } ; Function Attrs: convergent nounwind define amdgpu_kernel void @ContrastStretch(<4 x float> addrspace(1)* noalias nocapture %im, i32 %channel, <4 x float> addrspace(1)* noalias nocapture readonly %stretch_map, <4 x float> %white, <4 x float> %black) local_unnamed_addr #4 !kernel_arg_addr_space !35 !kernel_arg_access_qual !31 !kernel_arg_type !36 !kernel_arg_base_type !37 !kernel_arg_type_qual !38 { entry: %0 = tail call i32 @llvm.r600.read.tgid.x() #13 %x.i.i = tail call i32 @llvm.r600.read.local.size.x() #13 %1 = mul i32 %x.i.i, %0 %2 = tail call i32 @llvm.r600.read.tidig.x() #13, !range !3 %3 = add i32 %1, %2 %4 = tail call i8 addrspace(7)* @llvm.r600.implicitarg.ptr() #13 %5 = getelementptr inbounds i8, i8 addrspace(7)* %4, i32 4 %6 = bitcast i8 addrspace(7)* %5 to i32 addrspace(7)* %7 = load i32, i32 addrspace(7)* %6, align 4, !tbaa !4 %8 = add i32 %3, %7 %9 = tail call i32 @llvm.r600.read.tgid.y() #13 %y.i.i = tail call i32 @llvm.r600.read.local.size.y() #13 %10 = mul i32 %y.i.i, %9 %11 = tail call i32 @llvm.r600.read.tidig.y() #13, !range !3 %12 = add i32 %10, %11 %13 = getelementptr inbounds i8, i8 addrspace(7)* %4, i32 8 %14 = bitcast i8 addrspace(7)* %13 to i32 addrspace(7)* %15 = load i32, i32 addrspace(7)* %14, align 4, !tbaa !4 %16 = add i32 %12, %15 %x.i = tail call i32 @llvm.r600.read.global.size.x() #16 %mul = mul nsw i32 %16, %x.i %add = add nsw i32 %8, %mul %arrayidx = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %im, i32 %add %17 = load <4 x float>, <4 x float> addrspace(1)* %arrayidx, align 16, !tbaa !14 %and = and i32 %channel, 1 %cmp = icmp eq i32 %and, 0 br i1 %cmp, label %if.end11, label %if.then if.then: ; preds = %entry %18 = extractelement <4 x float> %white, i32 2 %19 = extractelement <4 x float> %black, i32 2 %cmp5 = fcmp une float %18, %19 br i1 %cmp5, label %if.then6, label %if.end11 if.then6: ; preds = %if.then %20 = extractelement <4 x float> %17, i32 2 %.inv.i93 = fcmp oge float %20, 6.553500e+04 %retval.02.i94 = select i1 %.inv.i93, float 6.553500e+04, float %20 %21 = fptoui float %retval.02.i94 to i32 %arrayidx9 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %stretch_map, i32 %21 %22 = load <4 x float>, <4 x float> addrspace(1)* %arrayidx9, align 16, !tbaa !14 %23 = extractelement <4 x float> %22, i32 2 br label %if.end11 if.end11: ; preds = %entry, %if.then, %if.then6 %red.0 = phi float [ %23, %if.then6 ], [ undef, %if.then ], [ undef, %entry ] %and12 = and i32 %channel, 2 %cmp13 = icmp eq i32 %and12, 0 br i1 %cmp13, label %if.end24, label %if.then14 if.then14: ; preds = %if.end11 %24 = extractelement <4 x float> %white, i32 1 %25 = extractelement <4 x float> %black, i32 1 %cmp17 = fcmp une float %24, %25 br i1 %cmp17, label %if.then18, label %if.end24 if.then18: ; preds = %if.then14 %26 = extractelement <4 x float> %17, i32 1 %.inv.i91 = fcmp oge float %26, 6.553500e+04 %retval.02.i92 = select i1 %.inv.i91, float 6.553500e+04, float %26 %27 = fptoui float %retval.02.i92 to i32 %arrayidx21 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %stretch_map, i32 %27 %28 = load <4 x float>, <4 x float> addrspace(1)* %arrayidx21, align 16, !tbaa !14 %29 = extractelement <4 x float> %28, i32 1 br label %if.end24 if.end24: ; preds = %if.end11, %if.then14, %if.then18 %green.0 = phi float [ %29, %if.then18 ], [ undef, %if.then14 ], [ undef, %if.end11 ] %and25 = and i32 %channel, 4 %cmp26 = icmp eq i32 %and25, 0 br i1 %cmp26, label %if.end37, label %if.then27 if.then27: ; preds = %if.end24 %30 = extractelement <4 x float> %white, i32 0 %31 = extractelement <4 x float> %black, i32 0 %cmp30 = fcmp une float %30, %31 br i1 %cmp30, label %if.then31, label %if.end37 if.then31: ; preds = %if.then27 %32 = extractelement <4 x float> %17, i32 0 %.inv.i89 = fcmp oge float %32, 6.553500e+04 %retval.02.i90 = select i1 %.inv.i89, float 6.553500e+04, float %32 %33 = fptoui float %retval.02.i90 to i32 %arrayidx34 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %stretch_map, i32 %33 %34 = load <4 x float>, <4 x float> addrspace(1)* %arrayidx34, align 16, !tbaa !14 %35 = extractelement <4 x float> %34, i32 0 br label %if.end37 if.end37: ; preds = %if.end24, %if.then27, %if.then31 %blue.0 = phi float [ %35, %if.then31 ], [ undef, %if.then27 ], [ undef, %if.end24 ] %and38 = and i32 %channel, 16 %cmp39 = icmp eq i32 %and38, 0 br i1 %cmp39, label %if.end50, label %if.then40 if.then40: ; preds = %if.end37 %36 = extractelement <4 x float> %white, i32 3 %37 = extractelement <4 x float> %black, i32 3 %cmp43 = fcmp une float %36, %37 br i1 %cmp43, label %if.then44, label %if.end50 if.then44: ; preds = %if.then40 %38 = extractelement <4 x float> %17, i32 3 %.inv.i = fcmp oge float %38, 6.553500e+04 %retval.02.i = select i1 %.inv.i, float 6.553500e+04, float %38 %39 = fptoui float %retval.02.i to i32 %arrayidx47 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %stretch_map, i32 %39 %40 = load <4 x float>, <4 x float> addrspace(1)* %arrayidx47, align 16, !tbaa !14 %41 = extractelement <4 x float> %40, i32 3 br label %if.end50 if.end50: ; preds = %if.end37, %if.then40, %if.then44 %alpha.0 = phi float [ %41, %if.then44 ], [ undef, %if.then40 ], [ undef, %if.end37 ] %vecinit = insertelement <4 x float> undef, float %blue.0, i32 0 %vecinit51 = insertelement <4 x float> %vecinit, float %green.0, i32 1 %vecinit52 = insertelement <4 x float> %vecinit51, float %red.0, i32 2 %vecinit53 = insertelement <4 x float> %vecinit52, float %alpha.0, i32 3 store <4 x float> %vecinit53, <4 x float> addrspace(1)* %arrayidx, align 16, !tbaa !14 ret void } ; Function Attrs: convergent nounwind define amdgpu_kernel void @ConvolveOptimized(<4 x float> addrspace(1)* nocapture readonly %input, <4 x float> addrspace(1)* nocapture %output, i32 %imageWidth, i32 %imageHeight, float addrspace(4)* nocapture readonly %filter, i32 %filterWidth, i32 %filterHeight, i32 %matte, i32 %channel, <4 x float> addrspace(3)* nocapture %pixelLocalCache, float addrspace(3)* nocapture %filterCache) local_unnamed_addr #4 !kernel_arg_addr_space !39 !kernel_arg_access_qual !16 !kernel_arg_type !40 !kernel_arg_base_type !41 !kernel_arg_type_qual !42 { entry: %0 = tail call i32 @llvm.r600.read.tgid.x() #13 %x.i.i = tail call i32 @llvm.r600.read.local.size.x() #13 %1 = mul i32 %x.i.i, %0 %2 = tail call i32 @llvm.r600.read.tidig.x() #13, !range !3 %3 = add i32 %1, %2 %4 = tail call i8 addrspace(7)* @llvm.r600.implicitarg.ptr() #13 %5 = getelementptr inbounds i8, i8 addrspace(7)* %4, i32 4 %6 = bitcast i8 addrspace(7)* %5 to i32 addrspace(7)* %7 = load i32, i32 addrspace(7)* %6, align 4, !tbaa !4 %8 = add i32 %3, %7 %9 = tail call i32 @llvm.r600.read.tgid.y() #13 %y.i.i = tail call i32 @llvm.r600.read.local.size.y() #13 %10 = mul i32 %y.i.i, %9 %11 = tail call i32 @llvm.r600.read.tidig.y() #13, !range !3 %12 = add i32 %10, %11 %13 = getelementptr inbounds i8, i8 addrspace(7)* %4, i32 8 %14 = bitcast i8 addrspace(7)* %13 to i32 addrspace(7)* %15 = load i32, i32 addrspace(7)* %14, align 4, !tbaa !4 %16 = add i32 %12, %15 %17 = urem i32 %8, %x.i.i %mul = sub i32 %8, %17 %18 = insertelement <2 x i32> undef, i32 %mul, i32 0 %19 = urem i32 %16, %y.i.i %mul7 = sub i32 %16, %19 %20 = insertelement <2 x i32> %18, i32 %mul7, i32 1 %sub = add i32 %filterWidth, -1 %div8 = lshr i32 %sub, 1 %21 = insertelement <2 x i32> undef, i32 %div8, i32 0 %sub9 = add i32 %filterHeight, -1 %div10 = lshr i32 %sub9, 1 %22 = insertelement <2 x i32> %21, i32 %div10, i32 1 %sub11 = sub <2 x i32> %20, %22 %sub13 = add i32 %sub, %x.i.i %sub16 = add i32 %sub9, %y.i.i %mul19 = mul i32 %11, %x.i.i %add21 = add i32 %mul19, %2 %mul22 = mul nsw i32 %sub16, %sub13 %mul25 = mul i32 %x.i.i, %y.i.i %cmp327 = icmp slt i32 %add21, %mul22 br i1 %cmp327, label %for.body.lr.ph, label %for.cond35.preheader for.body.lr.ph: ; preds = %entry %sub.i292 = add nsw i32 %imageWidth, -1 %sub.i = add nsw i32 %imageHeight, -1 br label %for.body for.cond35.preheader: ; preds = %for.body, %entry %mul36 = mul i32 %filterHeight, %filterWidth %cmp37325 = icmp ult i32 %add21, %mul36 br i1 %cmp37325, label %for.body39, label %for.cond.cleanup38 for.body: ; preds = %for.body.lr.ph, %for.body %i.0328 = phi i32 [ %add21, %for.body.lr.ph ], [ %add33, %for.body ] %div26 = sdiv i32 %i.0328, %sub13 %23 = mul i32 %div26, %sub13 %24 = sub i32 %i.0328, %23 %25 = insertelement <2 x i32> undef, i32 %24, i32 0 %26 = insertelement <2 x i32> %25, i32 %div26, i32 1 %add27 = add <2 x i32> %26, %sub11 %27 = extractelement <2 x i32> %add27, i32 0 %28 = icmp slt i32 %27, %imageWidth %29 = icmp sgt i32 %27, 0 %30 = select i1 %29, i32 %27, i32 0 %31 = select i1 %28, i32 %30, i32 %sub.i292 %32 = extractelement <2 x i32> %add27, i32 1 %33 = icmp slt i32 %32, %imageHeight %34 = icmp sgt i32 %32, 0 %35 = select i1 %34, i32 %32, i32 0 %36 = select i1 %33, i32 %35, i32 %sub.i %mul30 = mul i32 %36, %imageWidth %add31 = add i32 %mul30, %31 %arrayidx = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %input, i32 %add31 %37 = load <4 x float>, <4 x float> addrspace(1)* %arrayidx, align 16, !tbaa !14 %arrayidx32 = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %pixelLocalCache, i32 %i.0328 store <4 x float> %37, <4 x float> addrspace(3)* %arrayidx32, align 16, !tbaa !14 %add33 = add nsw i32 %i.0328, %mul25 %cmp = icmp slt i32 %add33, %mul22 br i1 %cmp, label %for.body, label %for.cond35.preheader for.cond.cleanup38: ; preds = %for.body39, %for.cond35.preheader tail call void @llvm.r600.group.barrier() #13 %add46 = add i32 %mul, %2 %add48 = add i32 %mul7, %11 %cmp49 = icmp ult i32 %add46, %imageWidth %cmp50 = icmp ult i32 %add48, %imageHeight %or.cond285 = and i1 %cmp49, %cmp50 br i1 %or.cond285, label %if.end, label %cleanup for.body39: ; preds = %for.cond35.preheader, %for.body39 %i34.0326 = phi i32 [ %add43, %for.body39 ], [ %add21, %for.cond35.preheader ] %arrayidx40 = getelementptr inbounds float, float addrspace(4)* %filter, i32 %i34.0326 %38 = bitcast float addrspace(4)* %arrayidx40 to i32 addrspace(4)* %39 = load i32, i32 addrspace(4)* %38, align 4, !tbaa !12 %arrayidx41 = getelementptr inbounds float, float addrspace(3)* %filterCache, i32 %i34.0326 %40 = bitcast float addrspace(3)* %arrayidx41 to i32 addrspace(3)* store i32 %39, i32 addrspace(3)* %40, align 4, !tbaa !12 %add43 = add nsw i32 %i34.0326, %mul25 %cmp37 = icmp ult i32 %add43, %mul36 br i1 %cmp37, label %for.body39, label %for.cond.cleanup38 if.end: ; preds = %for.cond.cleanup38 %and = and i32 %channel, 16 %cmp51 = icmp eq i32 %and, 0 %cmp53 = icmp eq i32 %matte, 0 %or.cond = or i1 %cmp53, %cmp51 %cmp57301 = icmp ne i32 %filterHeight, 0 br i1 %or.cond, label %for.cond56.preheader, label %for.cond86.preheader for.cond86.preheader: ; preds = %if.end br i1 %cmp57301, label %for.cond93.preheader.lr.ph, label %for.cond.cleanup88 for.cond93.preheader.lr.ph: ; preds = %for.cond86.preheader %cmp94308 = icmp eq i32 %filterWidth, 0 br label %for.cond93.preheader for.cond56.preheader: ; preds = %if.end br i1 %cmp57301, label %for.cond62.preheader.lr.ph, label %if.end121 for.cond62.preheader.lr.ph: ; preds = %for.cond56.preheader %cmp63293 = icmp eq i32 %filterWidth, 0 br label %for.cond62.preheader for.cond62.preheader: ; preds = %for.cond.cleanup64, %for.cond62.preheader.lr.ph %j.0306 = phi i32 [ 0, %for.cond62.preheader.lr.ph ], [ %inc81, %for.cond.cleanup64 ] %cacheIndexY.0305 = phi i32 [ %11, %for.cond62.preheader.lr.ph ], [ %inc79, %for.cond.cleanup64 ] %sum.0303 = phi <4 x float> [ zeroinitializer, %for.cond62.preheader.lr.ph ], [ %sum.1.lcssa, %for.cond.cleanup64 ] %filterIndex.0302 = phi i32 [ 0, %for.cond62.preheader.lr.ph ], [ %filterIndex.1.lcssa, %for.cond.cleanup64 ] br i1 %cmp63293, label %for.cond.cleanup64, label %for.body65.lr.ph for.body65.lr.ph: ; preds = %for.cond62.preheader %mul66 = mul nsw i32 %cacheIndexY.0305, %sub13 br label %for.body65 for.cond.cleanup64.loopexit: ; preds = %for.body65 %41 = add i32 %filterIndex.0302, %filterWidth br label %for.cond.cleanup64 for.cond.cleanup64: ; preds = %for.cond.cleanup64.loopexit, %for.cond62.preheader %filterIndex.1.lcssa = phi i32 [ %filterIndex.0302, %for.cond62.preheader ], [ %41, %for.cond.cleanup64.loopexit ] %sum.1.lcssa = phi <4 x float> [ %sum.0303, %for.cond62.preheader ], [ %59, %for.cond.cleanup64.loopexit ] %inc79 = add nuw nsw i32 %cacheIndexY.0305, 1 %inc81 = add nuw nsw i32 %j.0306, 1 %exitcond330 = icmp eq i32 %inc81, %filterHeight br i1 %exitcond330, label %if.end121, label %for.cond62.preheader for.body65: ; preds = %for.body65, %for.body65.lr.ph %i61.0298 = phi i32 [ 0, %for.body65.lr.ph ], [ %inc77, %for.body65 ] %cacheIndexX.0297 = phi i32 [ %2, %for.body65.lr.ph ], [ %inc75, %for.body65 ] %sum.1295 = phi <4 x float> [ %sum.0303, %for.body65.lr.ph ], [ %59, %for.body65 ] %filterIndex.1294 = phi i32 [ %filterIndex.0302, %for.body65.lr.ph ], [ %inc, %for.body65 ] %add67 = add nsw i32 %cacheIndexX.0297, %mul66 %arrayidx68 = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %pixelLocalCache, i32 %add67 %42 = load <4 x float>, <4 x float> addrspace(3)* %arrayidx68, align 16, !tbaa !14 %arrayidx69 = getelementptr inbounds float, float addrspace(3)* %filterCache, i32 %filterIndex.1294 %43 = load float, float addrspace(3)* %arrayidx69, align 4, !tbaa !12 %44 = extractelement <4 x float> %42, i32 0 %45 = extractelement <4 x float> %sum.1295, i32 0 %46 = tail call float @llvm.fmuladd.f32(float %43, float %44, float %45) %47 = insertelement <4 x float> undef, float %46, i32 0 %48 = extractelement <4 x float> %42, i32 1 %49 = extractelement <4 x float> %sum.1295, i32 1 %50 = tail call float @llvm.fmuladd.f32(float %43, float %48, float %49) %51 = insertelement <4 x float> %47, float %50, i32 1 %52 = extractelement <4 x float> %42, i32 2 %53 = extractelement <4 x float> %sum.1295, i32 2 %54 = tail call float @llvm.fmuladd.f32(float %43, float %52, float %53) %55 = insertelement <4 x float> %51, float %54, i32 2 %56 = extractelement <4 x float> %42, i32 3 %57 = extractelement <4 x float> %sum.1295, i32 3 %58 = tail call float @llvm.fmuladd.f32(float %43, float %56, float %57) %59 = insertelement <4 x float> %55, float %58, i32 3 %inc = add nsw i32 %filterIndex.1294, 1 %inc75 = add nuw nsw i32 %cacheIndexX.0297, 1 %inc77 = add nuw nsw i32 %i61.0298, 1 %exitcond = icmp eq i32 %inc77, %filterWidth br i1 %exitcond, label %for.cond.cleanup64.loopexit, label %for.body65 for.cond93.preheader: ; preds = %for.cond.cleanup95, %for.cond93.preheader.lr.ph %j85.0322 = phi i32 [ 0, %for.cond93.preheader.lr.ph ], [ %inc117, %for.cond.cleanup95 ] %cacheIndexY83.0321 = phi i32 [ %11, %for.cond93.preheader.lr.ph ], [ %inc115, %for.cond.cleanup95 ] %gamma.2320 = phi float [ 0.000000e+00, %for.cond93.preheader.lr.ph ], [ %gamma.3.lcssa, %for.cond.cleanup95 ] %sum.2319 = phi <4 x float> [ zeroinitializer, %for.cond93.preheader.lr.ph ], [ %sum.3.lcssa, %for.cond.cleanup95 ] %filterIndex.2318 = phi i32 [ 0, %for.cond93.preheader.lr.ph ], [ %filterIndex.3.lcssa, %for.cond.cleanup95 ] br i1 %cmp94308, label %for.cond.cleanup95, label %for.body96.lr.ph for.body96.lr.ph: ; preds = %for.cond93.preheader %mul98 = mul nsw i32 %cacheIndexY83.0321, %sub13 br label %for.body96 for.cond.cleanup88: ; preds = %for.cond.cleanup95, %for.cond86.preheader %sum.2.lcssa = phi <4 x float> [ zeroinitializer, %for.cond86.preheader ], [ %sum.3.lcssa, %for.cond.cleanup95 ] %gamma.2.lcssa = phi float [ 0.000000e+00, %for.cond86.preheader ], [ %gamma.3.lcssa, %for.cond.cleanup95 ] %cmp.i = fcmp olt float %gamma.2.lcssa, 0.000000e+00 %cond.i = select i1 %cmp.i, float -1.000000e+00, float 1.000000e+00 %mul.i = fmul float %gamma.2.lcssa, %cond.i %cmp1.i = fcmp ult float %mul.i, 0.000000e+00 %div.i = fdiv float 1.000000e+00, %gamma.2.lcssa %mul2.i = fmul float %cond.i, 0x7FF0000000000000 %cond3.i = select i1 %cmp1.i, float %mul2.i, float %div.i %splat.splatinsert = insertelement <3 x float> undef, float %cond3.i, i32 0 %splat.splat = shufflevector <3 x float> %splat.splatinsert, <3 x float> undef, <3 x i32> zeroinitializer %60 = shufflevector <4 x float> %sum.2.lcssa, <4 x float> undef, <3 x i32> %mul120 = fmul <3 x float> %60, %splat.splat %61 = shufflevector <3 x float> %mul120, <3 x float> undef, <4 x i32> %62 = shufflevector <4 x float> %sum.2.lcssa, <4 x float> %61, <4 x i32> br label %if.end121 for.cond.cleanup95.loopexit: ; preds = %for.body96 %63 = add i32 %filterIndex.2318, %filterWidth br label %for.cond.cleanup95 for.cond.cleanup95: ; preds = %for.cond.cleanup95.loopexit, %for.cond93.preheader %filterIndex.3.lcssa = phi i32 [ %filterIndex.2318, %for.cond93.preheader ], [ %63, %for.cond.cleanup95.loopexit ] %sum.3.lcssa = phi <4 x float> [ %sum.2319, %for.cond93.preheader ], [ %81, %for.cond.cleanup95.loopexit ] %gamma.3.lcssa = phi float [ %gamma.2320, %for.cond93.preheader ], [ %add109, %for.cond.cleanup95.loopexit ] %inc115 = add nuw nsw i32 %cacheIndexY83.0321, 1 %inc117 = add nuw nsw i32 %j85.0322, 1 %exitcond332 = icmp eq i32 %inc117, %filterHeight br i1 %exitcond332, label %for.cond.cleanup88, label %for.cond93.preheader for.body96: ; preds = %for.body96, %for.body96.lr.ph %i92.0313 = phi i32 [ 0, %for.body96.lr.ph ], [ %inc113, %for.body96 ] %cacheIndexX90.0312 = phi i32 [ %2, %for.body96.lr.ph ], [ %inc111, %for.body96 ] %gamma.3311 = phi float [ %gamma.2320, %for.body96.lr.ph ], [ %add109, %for.body96 ] %sum.3310 = phi <4 x float> [ %sum.2319, %for.body96.lr.ph ], [ %81, %for.body96 ] %filterIndex.3309 = phi i32 [ %filterIndex.2318, %for.body96.lr.ph ], [ %inc110, %for.body96 ] %add99 = add nsw i32 %cacheIndexX90.0312, %mul98 %arrayidx100 = getelementptr inbounds <4 x float>, <4 x float> addrspace(3)* %pixelLocalCache, i32 %add99 %64 = load <4 x float>, <4 x float> addrspace(3)* %arrayidx100, align 16, !tbaa !14 %65 = extractelement <4 x float> %64, i32 3 %mul101 = fmul float %65, 0x3EEF751040000000 %arrayidx103 = getelementptr inbounds float, float addrspace(3)* %filterCache, i32 %filterIndex.3309 %66 = load float, float addrspace(3)* %arrayidx103, align 4, !tbaa !12 %mul104 = fmul float %66, %mul101 %67 = extractelement <4 x float> %64, i32 0 %68 = extractelement <4 x float> %sum.3310, i32 0 %69 = tail call float @llvm.fmuladd.f32(float %mul104, float %67, float %68) %70 = insertelement <4 x float> undef, float %69, i32 0 %71 = extractelement <4 x float> %64, i32 1 %72 = extractelement <4 x float> %sum.3310, i32 1 %73 = tail call float @llvm.fmuladd.f32(float %mul104, float %71, float %72) %74 = insertelement <4 x float> %70, float %73, i32 1 %75 = extractelement <4 x float> %64, i32 2 %76 = extractelement <4 x float> %sum.3310, i32 2 %77 = tail call float @llvm.fmuladd.f32(float %mul104, float %75, float %76) %78 = insertelement <4 x float> %74, float %77, i32 2 %79 = extractelement <4 x float> %sum.3310, i32 3 %80 = tail call float @llvm.fmuladd.f32(float %66, float %65, float %79) %81 = insertelement <4 x float> %78, float %80, i32 3 %add109 = fadd float %gamma.3311, %mul104 %inc110 = add nsw i32 %filterIndex.3309, 1 %inc111 = add nuw nsw i32 %cacheIndexX90.0312, 1 %inc113 = add nuw nsw i32 %i92.0313, 1 %exitcond331 = icmp eq i32 %inc113, %filterWidth br i1 %exitcond331, label %for.cond.cleanup95.loopexit, label %for.body96 if.end121: ; preds = %for.cond.cleanup64, %for.cond56.preheader, %for.cond.cleanup88 %sum.4 = phi <4 x float> [ %62, %for.cond.cleanup88 ], [ zeroinitializer, %for.cond56.preheader ], [ %sum.1.lcssa, %for.cond.cleanup64 ] %82 = extractelement <4 x float> %sum.4, i32 0 %83 = fcmp ogt float %82, 6.553500e+04 %84 = fcmp olt float %82, 0.000000e+00 %85 = select i1 %84, float 0.000000e+00, float %82 %.op.i290 = fadd float %85, 5.000000e-01 %add.i291 = select i1 %83, float 6.553550e+04, float %.op.i290 %86 = insertelement <4 x float> undef, float %add.i291, i32 0 %87 = extractelement <4 x float> %sum.4, i32 1 %88 = fcmp ogt float %87, 6.553500e+04 %89 = fcmp olt float %87, 0.000000e+00 %90 = select i1 %89, float 0.000000e+00, float %87 %.op.i288 = fadd float %90, 5.000000e-01 %add.i289 = select i1 %88, float 6.553550e+04, float %.op.i288 %91 = insertelement <4 x float> %86, float %add.i289, i32 1 %92 = extractelement <4 x float> %sum.4, i32 2 %93 = fcmp ogt float %92, 6.553500e+04 %94 = fcmp olt float %92, 0.000000e+00 %95 = select i1 %94, float 0.000000e+00, float %92 %.op.i286 = fadd float %95, 5.000000e-01 %add.i287 = select i1 %93, float 6.553550e+04, float %.op.i286 %96 = insertelement <4 x float> %91, float %add.i287, i32 2 br i1 %cmp51, label %cond.false, label %cond.true cond.true: ; preds = %if.end121 %97 = extractelement <4 x float> %sum.4, i32 3 %98 = fcmp ogt float %97, 6.553500e+04 %99 = fcmp olt float %97, 0.000000e+00 %100 = select i1 %99, float 0.000000e+00, float %97 %.op.i = fadd float %100, 5.000000e-01 %add.i = select i1 %98, float 6.553550e+04, float %.op.i %.pre = mul i32 %add48, %imageWidth %.pre333 = add i32 %.pre, %add46 br label %cond.end cond.false: ; preds = %if.end121 %mul128 = mul i32 %add48, %imageWidth %add129 = add i32 %mul128, %add46 %arrayidx130 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %input, i32 %add129 %101 = load <4 x float>, <4 x float> addrspace(1)* %arrayidx130, align 16 %102 = extractelement <4 x float> %101, i32 3 br label %cond.end cond.end: ; preds = %cond.false, %cond.true %add132.pre-phi = phi i32 [ %add129, %cond.false ], [ %.pre333, %cond.true ] %cond = phi float [ %102, %cond.false ], [ %add.i, %cond.true ] %103 = insertelement <4 x float> %96, float %cond, i32 3 %arrayidx133 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %output, i32 %add132.pre-phi store <4 x float> %103, <4 x float> addrspace(1)* %arrayidx133, align 16, !tbaa !14 br label %cleanup cleanup: ; preds = %for.cond.cleanup38, %cond.end ret void } ; Function Attrs: convergent nounwind define amdgpu_kernel void @Convolve(<4 x float> addrspace(1)* nocapture readonly %input, <4 x float> addrspace(1)* nocapture %output, i32 %imageWidth, i32 %imageHeight, float addrspace(4)* nocapture readonly %filter, i32 %filterWidth, i32 %filterHeight, i32 %matte, i32 %channel) local_unnamed_addr #4 !kernel_arg_addr_space !43 !kernel_arg_access_qual !20 !kernel_arg_type !44 !kernel_arg_base_type !45 !kernel_arg_type_qual !46 { entry: %0 = tail call i32 @llvm.r600.read.tgid.x() #13 %x.i.i = tail call i32 @llvm.r600.read.local.size.x() #13 %1 = mul i32 %x.i.i, %0 %2 = tail call i32 @llvm.r600.read.tidig.x() #13, !range !3 %3 = add i32 %1, %2 %4 = tail call i8 addrspace(7)* @llvm.r600.implicitarg.ptr() #13 %5 = getelementptr inbounds i8, i8 addrspace(7)* %4, i32 4 %6 = bitcast i8 addrspace(7)* %5 to i32 addrspace(7)* %7 = load i32, i32 addrspace(7)* %6, align 4, !tbaa !4 %8 = add i32 %3, %7 %9 = tail call i32 @llvm.r600.read.tgid.y() #13 %y.i.i = tail call i32 @llvm.r600.read.local.size.y() #13 %10 = mul i32 %y.i.i, %9 %11 = tail call i32 @llvm.r600.read.tidig.y() #13, !range !3 %12 = add i32 %10, %11 %13 = getelementptr inbounds i8, i8 addrspace(7)* %4, i32 8 %14 = bitcast i8 addrspace(7)* %13 to i32 addrspace(7)* %15 = load i32, i32 addrspace(7)* %14, align 4, !tbaa !4 %16 = add i32 %12, %15 %cmp = icmp ult i32 %8, %imageWidth %cmp2 = icmp ult i32 %16, %imageHeight %or.cond200 = and i1 %cmp, %cmp2 br i1 %or.cond200, label %if.end, label %cleanup if.end: ; preds = %entry %sub = add i32 %filterWidth, -1 %div = lshr i32 %sub, 1 %sub3 = add i32 %filterHeight, -1 %div4 = lshr i32 %sub3, 1 %and = and i32 %channel, 16 %cmp5 = icmp eq i32 %and, 0 %cmp7 = icmp eq i32 %matte, 0 %or.cond = or i1 %cmp7, %cmp5 %cmp9219 = icmp ne i32 %filterHeight, 0 br i1 %or.cond, label %for.cond.preheader, label %for.cond31.preheader for.cond31.preheader: ; preds = %if.end br i1 %cmp9219, label %for.body34.lr.ph, label %for.cond.cleanup33 for.body34.lr.ph: ; preds = %for.cond31.preheader %sub36 = sub nsw i32 %16, %div4 %sub.i207 = add nsw i32 %imageHeight, -1 %cmp41226 = icmp eq i32 %filterWidth, 0 %sub44 = sub nsw i32 %8, %div %sub.i = add nsw i32 %imageWidth, -1 br label %for.body34 for.cond.preheader: ; preds = %if.end br i1 %cmp9219, label %for.body.lr.ph, label %if.end69 for.body.lr.ph: ; preds = %for.cond.preheader %sub10 = sub nsw i32 %16, %div4 %sub.i209 = add nsw i32 %imageHeight, -1 %cmp13210 = icmp eq i32 %filterWidth, 0 %sub16 = sub nsw i32 %8, %div %sub.i208 = add nsw i32 %imageWidth, -1 br label %for.body for.body: ; preds = %for.cond.cleanup14, %for.body.lr.ph %filterIndex.0224 = phi i32 [ 0, %for.body.lr.ph ], [ %filterIndex.1.lcssa, %for.cond.cleanup14 ] %sum.0223 = phi <4 x float> [ zeroinitializer, %for.body.lr.ph ], [ %sum.1.lcssa, %for.cond.cleanup14 ] %inputPixelIndex.0221 = phi <2 x i32> [ undef, %for.body.lr.ph ], [ %inputPixelIndex.1.lcssa, %for.cond.cleanup14 ] %j.0220 = phi i32 [ 0, %for.body.lr.ph ], [ %inc28, %for.cond.cleanup14 ] %add = add nsw i32 %j.0220, %sub10 %17 = icmp slt i32 %add, %imageHeight %18 = icmp sgt i32 %add, 0 %19 = select i1 %18, i32 %add, i32 0 %20 = select i1 %17, i32 %19, i32 %sub.i209 %21 = insertelement <2 x i32> %inputPixelIndex.0221, i32 %20, i32 1 br i1 %cmp13210, label %for.cond.cleanup14, label %for.body15 for.cond.cleanup14.loopexit: ; preds = %for.body15 %22 = add i32 %filterIndex.0224, %filterWidth br label %for.cond.cleanup14 for.cond.cleanup14: ; preds = %for.cond.cleanup14.loopexit, %for.body %inputPixelIndex.1.lcssa = phi <2 x i32> [ %21, %for.body ], [ %27, %for.cond.cleanup14.loopexit ] %sum.1.lcssa = phi <4 x float> [ %sum.0223, %for.body ], [ %46, %for.cond.cleanup14.loopexit ] %filterIndex.1.lcssa = phi i32 [ %filterIndex.0224, %for.body ], [ %22, %for.cond.cleanup14.loopexit ] %inc28 = add nuw nsw i32 %j.0220, 1 %exitcond247 = icmp eq i32 %inc28, %filterHeight br i1 %exitcond247, label %if.end69, label %for.body for.body15: ; preds = %for.body, %for.body15 %filterIndex.1215 = phi i32 [ %inc, %for.body15 ], [ %filterIndex.0224, %for.body ] %sum.1214 = phi <4 x float> [ %46, %for.body15 ], [ %sum.0223, %for.body ] %i.0212 = phi i32 [ %inc26, %for.body15 ], [ 0, %for.body ] %inputPixelIndex.1211 = phi <2 x i32> [ %27, %for.body15 ], [ %21, %for.body ] %add17 = add nsw i32 %i.0212, %sub16 %23 = icmp slt i32 %add17, %imageWidth %24 = icmp sgt i32 %add17, 0 %25 = select i1 %24, i32 %add17, i32 0 %26 = select i1 %23, i32 %25, i32 %sub.i208 %27 = insertelement <2 x i32> %inputPixelIndex.1211, i32 %26, i32 0 %28 = extractelement <2 x i32> %inputPixelIndex.1211, i32 1 %mul = mul i32 %28, %imageWidth %add19 = add i32 %26, %mul %arrayidx = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %input, i32 %add19 %29 = load <4 x float>, <4 x float> addrspace(1)* %arrayidx, align 16, !tbaa !14 %arrayidx20 = getelementptr inbounds float, float addrspace(4)* %filter, i32 %filterIndex.1215 %30 = load float, float addrspace(4)* %arrayidx20, align 4, !tbaa !12 %31 = extractelement <4 x float> %29, i32 0 %32 = extractelement <4 x float> %sum.1214, i32 0 %33 = tail call float @llvm.fmuladd.f32(float %30, float %31, float %32) %34 = insertelement <4 x float> undef, float %33, i32 0 %35 = extractelement <4 x float> %29, i32 1 %36 = extractelement <4 x float> %sum.1214, i32 1 %37 = tail call float @llvm.fmuladd.f32(float %30, float %35, float %36) %38 = insertelement <4 x float> %34, float %37, i32 1 %39 = extractelement <4 x float> %29, i32 2 %40 = extractelement <4 x float> %sum.1214, i32 2 %41 = tail call float @llvm.fmuladd.f32(float %30, float %39, float %40) %42 = insertelement <4 x float> %38, float %41, i32 2 %43 = extractelement <4 x float> %29, i32 3 %44 = extractelement <4 x float> %sum.1214, i32 3 %45 = tail call float @llvm.fmuladd.f32(float %30, float %43, float %44) %46 = insertelement <4 x float> %42, float %45, i32 3 %inc = add nsw i32 %filterIndex.1215, 1 %inc26 = add nuw nsw i32 %i.0212, 1 %exitcond = icmp eq i32 %inc26, %filterWidth br i1 %exitcond, label %for.cond.cleanup14.loopexit, label %for.body15 for.cond.cleanup33: ; preds = %for.cond.cleanup42, %for.cond31.preheader %gamma.2.lcssa = phi float [ 0.000000e+00, %for.cond31.preheader ], [ %gamma.3.lcssa, %for.cond.cleanup42 ] %sum.2.lcssa = phi <4 x float> [ zeroinitializer, %for.cond31.preheader ], [ %sum.3.lcssa, %for.cond.cleanup42 ] %cmp.i = fcmp olt float %gamma.2.lcssa, 0.000000e+00 %cond.i = select i1 %cmp.i, float -1.000000e+00, float 1.000000e+00 %mul.i = fmul float %gamma.2.lcssa, %cond.i %cmp1.i = fcmp ult float %mul.i, 0.000000e+00 %div.i = fdiv float 1.000000e+00, %gamma.2.lcssa %mul2.i = fmul float %cond.i, 0x7FF0000000000000 %cond3.i = select i1 %cmp1.i, float %mul2.i, float %div.i %splat.splatinsert = insertelement <3 x float> undef, float %cond3.i, i32 0 %splat.splat = shufflevector <3 x float> %splat.splatinsert, <3 x float> undef, <3 x i32> zeroinitializer %47 = shufflevector <4 x float> %sum.2.lcssa, <4 x float> undef, <3 x i32> %mul68 = fmul <3 x float> %47, %splat.splat %48 = shufflevector <3 x float> %mul68, <3 x float> undef, <4 x i32> %49 = shufflevector <4 x float> %sum.2.lcssa, <4 x float> %48, <4 x i32> br label %if.end69 for.body34: ; preds = %for.cond.cleanup42, %for.body34.lr.ph %filterIndex.2241 = phi i32 [ 0, %for.body34.lr.ph ], [ %filterIndex.3.lcssa, %for.cond.cleanup42 ] %inputPixelIndex35.0240 = phi <2 x i32> [ undef, %for.body34.lr.ph ], [ %inputPixelIndex35.1.lcssa, %for.cond.cleanup42 ] %j30.0239 = phi i32 [ 0, %for.body34.lr.ph ], [ %inc65, %for.cond.cleanup42 ] %sum.2238 = phi <4 x float> [ zeroinitializer, %for.body34.lr.ph ], [ %sum.3.lcssa, %for.cond.cleanup42 ] %gamma.2237 = phi float [ 0.000000e+00, %for.body34.lr.ph ], [ %gamma.3.lcssa, %for.cond.cleanup42 ] %add37 = add nsw i32 %j30.0239, %sub36 %50 = icmp slt i32 %add37, %imageHeight %51 = icmp sgt i32 %add37, 0 %52 = select i1 %51, i32 %add37, i32 0 %53 = select i1 %50, i32 %52, i32 %sub.i207 %54 = insertelement <2 x i32> %inputPixelIndex35.0240, i32 %53, i32 1 br i1 %cmp41226, label %for.cond.cleanup42, label %for.body43 for.cond.cleanup42.loopexit: ; preds = %for.body43 %55 = add i32 %filterIndex.2241, %filterWidth br label %for.cond.cleanup42 for.cond.cleanup42: ; preds = %for.cond.cleanup42.loopexit, %for.body34 %gamma.3.lcssa = phi float [ %gamma.2237, %for.body34 ], [ %add59, %for.cond.cleanup42.loopexit ] %sum.3.lcssa = phi <4 x float> [ %sum.2238, %for.body34 ], [ %79, %for.cond.cleanup42.loopexit ] %inputPixelIndex35.1.lcssa = phi <2 x i32> [ %54, %for.body34 ], [ %60, %for.cond.cleanup42.loopexit ] %filterIndex.3.lcssa = phi i32 [ %filterIndex.2241, %for.body34 ], [ %55, %for.cond.cleanup42.loopexit ] %inc65 = add nuw nsw i32 %j30.0239, 1 %exitcond249 = icmp eq i32 %inc65, %filterHeight br i1 %exitcond249, label %for.cond.cleanup33, label %for.body34 for.body43: ; preds = %for.body34, %for.body43 %filterIndex.3231 = phi i32 [ %inc60, %for.body43 ], [ %filterIndex.2241, %for.body34 ] %i39.0230 = phi i32 [ %inc62, %for.body43 ], [ 0, %for.body34 ] %inputPixelIndex35.1229 = phi <2 x i32> [ %60, %for.body43 ], [ %54, %for.body34 ] %sum.3228 = phi <4 x float> [ %79, %for.body43 ], [ %sum.2238, %for.body34 ] %gamma.3227 = phi float [ %add59, %for.body43 ], [ %gamma.2237, %for.body34 ] %add45 = add nsw i32 %i39.0230, %sub44 %56 = icmp slt i32 %add45, %imageWidth %57 = icmp sgt i32 %add45, 0 %58 = select i1 %57, i32 %add45, i32 0 %59 = select i1 %56, i32 %58, i32 %sub.i %60 = insertelement <2 x i32> %inputPixelIndex35.1229, i32 %59, i32 0 %61 = extractelement <2 x i32> %inputPixelIndex35.1229, i32 1 %mul48 = mul i32 %61, %imageWidth %add49 = add i32 %59, %mul48 %arrayidx50 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %input, i32 %add49 %62 = load <4 x float>, <4 x float> addrspace(1)* %arrayidx50, align 16, !tbaa !14 %63 = extractelement <4 x float> %62, i32 3 %mul51 = fmul float %63, 0x3EEF751040000000 %arrayidx53 = getelementptr inbounds float, float addrspace(4)* %filter, i32 %filterIndex.3231 %64 = load float, float addrspace(4)* %arrayidx53, align 4, !tbaa !12 %mul54 = fmul float %64, %mul51 %65 = extractelement <4 x float> %62, i32 0 %66 = extractelement <4 x float> %sum.3228, i32 0 %67 = tail call float @llvm.fmuladd.f32(float %mul54, float %65, float %66) %68 = insertelement <4 x float> undef, float %67, i32 0 %69 = extractelement <4 x float> %62, i32 1 %70 = extractelement <4 x float> %sum.3228, i32 1 %71 = tail call float @llvm.fmuladd.f32(float %mul54, float %69, float %70) %72 = insertelement <4 x float> %68, float %71, i32 1 %73 = extractelement <4 x float> %62, i32 2 %74 = extractelement <4 x float> %sum.3228, i32 2 %75 = tail call float @llvm.fmuladd.f32(float %mul54, float %73, float %74) %76 = insertelement <4 x float> %72, float %75, i32 2 %77 = extractelement <4 x float> %sum.3228, i32 3 %78 = tail call float @llvm.fmuladd.f32(float %64, float %63, float %77) %79 = insertelement <4 x float> %76, float %78, i32 3 %add59 = fadd float %gamma.3227, %mul54 %inc60 = add nsw i32 %filterIndex.3231, 1 %inc62 = add nuw nsw i32 %i39.0230, 1 %exitcond248 = icmp eq i32 %inc62, %filterWidth br i1 %exitcond248, label %for.cond.cleanup42.loopexit, label %for.body43 if.end69: ; preds = %for.cond.cleanup14, %for.cond.preheader, %for.cond.cleanup33 %sum.4 = phi <4 x float> [ %49, %for.cond.cleanup33 ], [ zeroinitializer, %for.cond.preheader ], [ %sum.1.lcssa, %for.cond.cleanup14 ] %80 = extractelement <4 x float> %sum.4, i32 0 %81 = fcmp ogt float %80, 6.553500e+04 %82 = fcmp olt float %80, 0.000000e+00 %83 = select i1 %82, float 0.000000e+00, float %80 %.op.i205 = fadd float %83, 5.000000e-01 %add.i206 = select i1 %81, float 6.553550e+04, float %.op.i205 %84 = insertelement <4 x float> undef, float %add.i206, i32 0 %85 = extractelement <4 x float> %sum.4, i32 1 %86 = fcmp ogt float %85, 6.553500e+04 %87 = fcmp olt float %85, 0.000000e+00 %88 = select i1 %87, float 0.000000e+00, float %85 %.op.i203 = fadd float %88, 5.000000e-01 %add.i204 = select i1 %86, float 6.553550e+04, float %.op.i203 %89 = insertelement <4 x float> %84, float %add.i204, i32 1 %90 = extractelement <4 x float> %sum.4, i32 2 %91 = fcmp ogt float %90, 6.553500e+04 %92 = fcmp olt float %90, 0.000000e+00 %93 = select i1 %92, float 0.000000e+00, float %90 %.op.i201 = fadd float %93, 5.000000e-01 %add.i202 = select i1 %91, float 6.553550e+04, float %.op.i201 %94 = insertelement <4 x float> %89, float %add.i202, i32 2 br i1 %cmp5, label %cond.false, label %cond.true cond.true: ; preds = %if.end69 %95 = extractelement <4 x float> %sum.4, i32 3 %96 = fcmp ogt float %95, 6.553500e+04 %97 = fcmp olt float %95, 0.000000e+00 %98 = select i1 %97, float 0.000000e+00, float %95 %.op.i = fadd float %98, 5.000000e-01 %add.i = select i1 %96, float 6.553550e+04, float %.op.i %.pre = mul i32 %16, %imageWidth %.pre250 = add i32 %.pre, %8 br label %cond.end cond.false: ; preds = %if.end69 %mul76 = mul i32 %16, %imageWidth %add77 = add i32 %mul76, %8 %arrayidx78 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %input, i32 %add77 %99 = load <4 x float>, <4 x float> addrspace(1)* %arrayidx78, align 16 %100 = extractelement <4 x float> %99, i32 3 br label %cond.end cond.end: ; preds = %cond.false, %cond.true %add80.pre-phi = phi i32 [ %add77, %cond.false ], [ %.pre250, %cond.true ] %cond = phi float [ %100, %cond.false ], [ %add.i, %cond.true ] %101 = insertelement <4 x float> %94, float %cond, i32 3 %arrayidx81 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %output, i32 %add80.pre-phi store <4 x float> %101, <4 x float> addrspace(1)* %arrayidx81, align 16, !tbaa !14 br label %cleanup cleanup: ; preds = %entry, %cond.end ret void } ; Function Attrs: convergent nounwind define amdgpu_kernel void @HullPass1(<4 x float> addrspace(1)* nocapture readonly %inputImage, <4 x float> addrspace(1)* nocapture %outputImage, i32 %imageWidth, i32 %imageHeight, <2 x i32> %offset, i32 %polarity, i32 %matte) local_unnamed_addr #4 !kernel_arg_addr_space !47 !kernel_arg_access_qual !48 !kernel_arg_type !49 !kernel_arg_base_type !50 !kernel_arg_type_qual !51 { entry: %0 = tail call i32 @llvm.r600.read.tgid.x() #13 %x.i.i = tail call i32 @llvm.r600.read.local.size.x() #13 %1 = mul i32 %x.i.i, %0 %2 = tail call i32 @llvm.r600.read.tidig.x() #13, !range !3 %3 = add i32 %1, %2 %4 = tail call i8 addrspace(7)* @llvm.r600.implicitarg.ptr() #13 %5 = getelementptr inbounds i8, i8 addrspace(7)* %4, i32 4 %6 = bitcast i8 addrspace(7)* %5 to i32 addrspace(7)* %7 = load i32, i32 addrspace(7)* %6, align 4, !tbaa !4 %8 = add i32 %3, %7 %9 = tail call i32 @llvm.r600.read.tgid.y() #13 %y.i.i = tail call i32 @llvm.r600.read.local.size.y() #13 %10 = mul i32 %y.i.i, %9 %11 = tail call i32 @llvm.r600.read.tidig.y() #13, !range !3 %12 = add i32 %10, %11 %13 = getelementptr inbounds i8, i8 addrspace(7)* %4, i32 8 %14 = bitcast i8 addrspace(7)* %13 to i32 addrspace(7)* %15 = load i32, i32 addrspace(7)* %14, align 4, !tbaa !4 %16 = add i32 %12, %15 %mul = mul i32 %16, %imageWidth %add = add i32 %mul, %8 %arrayidx = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %inputImage, i32 %add %17 = load <4 x float>, <4 x float> addrspace(1)* %arrayidx, align 16, !tbaa !14 %18 = extractelement <2 x i32> %offset, i32 1 %add2 = add nsw i32 %16, %18 %19 = extractelement <2 x i32> %offset, i32 0 %add3 = add nsw i32 %8, %19 %sub.i140 = add nsw i32 %imageWidth, -1 %20 = icmp slt i32 %add3, %imageWidth %21 = icmp sgt i32 %add3, 0 %22 = select i1 %21, i32 %add3, i32 0 %23 = select i1 %20, i32 %22, i32 %sub.i140 %sub.i = add nsw i32 %imageHeight, -1 %24 = icmp slt i32 %add2, %imageHeight %25 = icmp sgt i32 %add2, 0 %26 = select i1 %25, i32 %add2, i32 0 %27 = select i1 %24, i32 %26, i32 %sub.i %cmp = icmp eq i32 %23, %add3 %cmp6 = icmp eq i32 %27, %add2 %or.cond = and i1 %cmp, %cmp6 br i1 %or.cond, label %cond.true, label %cond.end cond.true: ; preds = %entry %mul7 = mul i32 %add2, %imageWidth %add8 = add i32 %mul7, %add3 %arrayidx9 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %inputImage, i32 %add8 %28 = load <4 x float>, <4 x float> addrspace(1)* %arrayidx9, align 16, !tbaa !14 br label %cond.end cond.end: ; preds = %entry, %cond.true %cond = phi <4 x float> [ %28, %cond.true ], [ zeroinitializer, %entry ] %29 = extractelement <4 x float> %17, i32 0 %conv = fptosi float %29 to i32 %30 = extractelement <4 x float> %17, i32 1 %conv11 = fptosi float %30 to i32 %31 = extractelement <4 x float> %17, i32 2 %conv13 = fptosi float %31 to i32 %32 = extractelement <4 x float> %17, i32 3 %conv15 = fptosi float %32 to i32 %33 = extractelement <4 x float> %cond, i32 0 %conv17 = fptosi float %33 to i32 %34 = extractelement <4 x float> %cond, i32 1 %conv19 = fptosi float %34 to i32 %35 = extractelement <4 x float> %cond, i32 2 %conv21 = fptosi float %35 to i32 %36 = extractelement <4 x float> %cond, i32 3 %conv23 = fptosi float %36 to i32 %cmp25 = icmp sgt i32 %polarity, 0 %conv30 = sitofp i32 %conv17 to float %conv32 = sitofp i32 %conv to float br i1 %cmp25, label %for.body.preheader, label %for.body54.preheader for.body54.preheader: ; preds = %cond.end %sub = fadd float %conv32, -5.140000e+02 %cmp60 = fcmp ult float %sub, %conv30 %sub66 = fadd float %conv32, -2.570000e+02 %cond71 = select i1 %cmp60, float %conv32, float %sub66 %conv56.1 = sitofp i32 %conv19 to float %conv58.1 = sitofp i32 %conv11 to float %sub.1 = fadd float %conv58.1, -5.140000e+02 %cmp60.1 = fcmp ult float %sub.1, %conv56.1 %sub66.1 = fadd float %conv58.1, -2.570000e+02 %cond71.1 = select i1 %cmp60.1, float %conv58.1, float %sub66.1 %conv56.2 = sitofp i32 %conv21 to float %conv58.2 = sitofp i32 %conv13 to float %sub.2 = fadd float %conv58.2, -5.140000e+02 %cmp60.2 = fcmp ult float %sub.2, %conv56.2 %sub66.2 = fadd float %conv58.2, -2.570000e+02 %cond71.2 = select i1 %cmp60.2, float %conv58.2, float %sub66.2 %conv56.3 = sitofp i32 %conv23 to float %conv58.3 = sitofp i32 %conv15 to float %sub.3 = fadd float %conv58.3, -5.140000e+02 %cmp60.3 = fcmp ult float %sub.3, %conv56.3 %sub66.3 = fadd float %conv58.3, -2.570000e+02 %cond71.3 = select i1 %cmp60.3, float %conv58.3, float %sub66.3 br label %if.end for.body.preheader: ; preds = %cond.end %add34 = fadd float %conv32, 5.140000e+02 %cmp35 = fcmp ugt float %add34, %conv30 %add41 = fadd float %conv32, 2.570000e+02 %cond46 = select i1 %cmp35, float %conv32, float %add41 %conv30.1 = sitofp i32 %conv19 to float %conv32.1 = sitofp i32 %conv11 to float %add34.1 = fadd float %conv32.1, 5.140000e+02 %cmp35.1 = fcmp ugt float %add34.1, %conv30.1 %add41.1 = fadd float %conv32.1, 2.570000e+02 %cond46.1 = select i1 %cmp35.1, float %conv32.1, float %add41.1 %conv30.2 = sitofp i32 %conv21 to float %conv32.2 = sitofp i32 %conv13 to float %add34.2 = fadd float %conv32.2, 5.140000e+02 %cmp35.2 = fcmp ugt float %add34.2, %conv30.2 %add41.2 = fadd float %conv32.2, 2.570000e+02 %cond46.2 = select i1 %cmp35.2, float %conv32.2, float %add41.2 %conv30.3 = sitofp i32 %conv23 to float %conv32.3 = sitofp i32 %conv15 to float %add34.3 = fadd float %conv32.3, 5.140000e+02 %cmp35.3 = fcmp ugt float %add34.3, %conv30.3 %add41.3 = fadd float %conv32.3, 2.570000e+02 %cond46.3 = select i1 %cmp35.3, float %conv32.3, float %add41.3 br label %if.end if.end: ; preds = %for.body54.preheader, %for.body.preheader %.in = phi float [ %cond71.3, %for.body54.preheader ], [ %cond46.3, %for.body.preheader ] %.in145 = phi float [ %cond71.2, %for.body54.preheader ], [ %cond46.2, %for.body.preheader ] %.in146 = phi float [ %cond71.1, %for.body54.preheader ], [ %cond46.1, %for.body.preheader ] %.in147 = phi float [ %cond71, %for.body54.preheader ], [ %cond46, %for.body.preheader ] %37 = fptosi float %.in147 to i32 %38 = fptosi float %.in146 to i32 %39 = fptosi float %.in145 to i32 %conv78 = sitofp i32 %37 to float %40 = insertelement <4 x float> %17, float %conv78, i32 0 %conv80 = sitofp i32 %38 to float %41 = insertelement <4 x float> %40, float %conv80, i32 1 %conv82 = sitofp i32 %39 to float %42 = insertelement <4 x float> %41, float %conv82, i32 2 %cmp83 = icmp eq i32 %matte, 0 br i1 %cmp83, label %if.end88, label %if.then85 if.then85: ; preds = %if.end %43 = fptosi float %.in to i32 %conv87 = sitofp i32 %43 to float %44 = insertelement <4 x float> %42, float %conv87, i32 3 br label %if.end88 if.end88: ; preds = %if.end, %if.then85 %v.0 = phi <4 x float> [ %44, %if.then85 ], [ %42, %if.end ] %arrayidx91 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %outputImage, i32 %add store <4 x float> %v.0, <4 x float> addrspace(1)* %arrayidx91, align 16, !tbaa !14 ret void } ; Function Attrs: convergent nounwind define amdgpu_kernel void @HullPass2(<4 x float> addrspace(1)* nocapture readonly %inputImage, <4 x float> addrspace(1)* nocapture %outputImage, i32 %imageWidth, i32 %imageHeight, <2 x i32> %offset, i32 %polarity, i32 %matte) local_unnamed_addr #4 !kernel_arg_addr_space !47 !kernel_arg_access_qual !48 !kernel_arg_type !49 !kernel_arg_base_type !50 !kernel_arg_type_qual !51 { entry: %0 = tail call i32 @llvm.r600.read.tgid.x() #13 %x.i.i = tail call i32 @llvm.r600.read.local.size.x() #13 %1 = mul i32 %x.i.i, %0 %2 = tail call i32 @llvm.r600.read.tidig.x() #13, !range !3 %3 = add i32 %1, %2 %4 = tail call i8 addrspace(7)* @llvm.r600.implicitarg.ptr() #13 %5 = getelementptr inbounds i8, i8 addrspace(7)* %4, i32 4 %6 = bitcast i8 addrspace(7)* %5 to i32 addrspace(7)* %7 = load i32, i32 addrspace(7)* %6, align 4, !tbaa !4 %8 = add i32 %3, %7 %9 = tail call i32 @llvm.r600.read.tgid.y() #13 %y.i.i = tail call i32 @llvm.r600.read.local.size.y() #13 %10 = mul i32 %y.i.i, %9 %11 = tail call i32 @llvm.r600.read.tidig.y() #13, !range !3 %12 = add i32 %10, %11 %13 = getelementptr inbounds i8, i8 addrspace(7)* %4, i32 8 %14 = bitcast i8 addrspace(7)* %13 to i32 addrspace(7)* %15 = load i32, i32 addrspace(7)* %14, align 4, !tbaa !4 %16 = add i32 %12, %15 %mul = mul i32 %16, %imageWidth %add = add i32 %mul, %8 %arrayidx = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %inputImage, i32 %add %17 = load <4 x float>, <4 x float> addrspace(1)* %arrayidx, align 16, !tbaa !14 %18 = extractelement <2 x i32> %offset, i32 1 %add2 = add nsw i32 %16, %18 %19 = extractelement <2 x i32> %offset, i32 0 %add3 = add nsw i32 %8, %19 %sub.i207 = add nsw i32 %imageWidth, -1 %20 = icmp slt i32 %add3, %imageWidth %21 = icmp sgt i32 %add3, 0 %22 = select i1 %21, i32 %add3, i32 0 %23 = select i1 %20, i32 %22, i32 %sub.i207 %sub.i206 = add nsw i32 %imageHeight, -1 %24 = icmp slt i32 %add2, %imageHeight %25 = icmp sgt i32 %add2, 0 %26 = select i1 %25, i32 %add2, i32 0 %27 = select i1 %24, i32 %26, i32 %sub.i206 %cmp = icmp eq i32 %23, %add3 %cmp6 = icmp eq i32 %27, %add2 %or.cond = and i1 %cmp, %cmp6 br i1 %or.cond, label %cond.true, label %cond.end cond.true: ; preds = %entry %mul7 = mul i32 %add2, %imageWidth %add8 = add i32 %mul7, %add3 %arrayidx9 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %inputImage, i32 %add8 %28 = load <4 x float>, <4 x float> addrspace(1)* %arrayidx9, align 16, !tbaa !14 br label %cond.end cond.end: ; preds = %entry, %cond.true %cond = phi <4 x float> [ %28, %cond.true ], [ zeroinitializer, %entry ] %sub = sub nsw i32 %16, %18 %sub10 = sub nsw i32 %8, %19 %29 = icmp slt i32 %sub10, %imageWidth %30 = icmp sgt i32 %sub10, 0 %31 = select i1 %30, i32 %sub10, i32 0 %32 = select i1 %29, i32 %31, i32 %sub.i207 %33 = icmp slt i32 %sub, %imageHeight %34 = icmp sgt i32 %sub, 0 %35 = select i1 %34, i32 %sub, i32 0 %36 = select i1 %33, i32 %35, i32 %sub.i206 %cmp13 = icmp eq i32 %32, %sub10 %cmp15 = icmp eq i32 %36, %sub %or.cond204 = and i1 %cmp13, %cmp15 br i1 %or.cond204, label %cond.true16, label %cond.end21 cond.true16: ; preds = %cond.end %mul17 = mul i32 %sub, %imageWidth %add18 = add i32 %mul17, %sub10 %arrayidx19 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %inputImage, i32 %add18 %37 = load <4 x float>, <4 x float> addrspace(1)* %arrayidx19, align 16, !tbaa !14 br label %cond.end21 cond.end21: ; preds = %cond.end, %cond.true16 %cond22 = phi <4 x float> [ %37, %cond.true16 ], [ zeroinitializer, %cond.end ] %38 = extractelement <4 x float> %17, i32 0 %conv = fptosi float %38 to i32 %39 = extractelement <4 x float> %17, i32 1 %conv24 = fptosi float %39 to i32 %40 = extractelement <4 x float> %17, i32 2 %conv26 = fptosi float %40 to i32 %41 = extractelement <4 x float> %17, i32 3 %conv28 = fptosi float %41 to i32 %42 = extractelement <4 x float> %cond, i32 0 %conv30 = fptosi float %42 to i32 %43 = extractelement <4 x float> %cond, i32 1 %conv32 = fptosi float %43 to i32 %44 = extractelement <4 x float> %cond, i32 2 %conv34 = fptosi float %44 to i32 %45 = extractelement <4 x float> %cond, i32 3 %conv36 = fptosi float %45 to i32 %46 = extractelement <4 x float> %cond22, i32 0 %conv38 = fptosi float %46 to i32 %47 = extractelement <4 x float> %cond22, i32 1 %conv40 = fptosi float %47 to i32 %48 = extractelement <4 x float> %cond22, i32 2 %conv42 = fptosi float %48 to i32 %49 = extractelement <4 x float> %cond22, i32 3 %conv44 = fptosi float %49 to i32 %cmp46 = icmp sgt i32 %polarity, 0 %conv51 = sitofp i32 %conv38 to float %conv53 = sitofp i32 %conv to float br i1 %cmp46, label %for.body.preheader, label %for.body82.preheader for.body82.preheader: ; preds = %cond.end21 %sub88 = fadd float %conv53, -5.140000e+02 %cmp89 = fcmp olt float %sub88, %conv51 %conv90 = zext i1 %cmp89 to i32 %cmp93 = icmp sge i32 %conv30, %conv %add95 = sext i1 %cmp93 to i32 %cmp96 = icmp eq i32 %conv90, %add95 %sub105 = fadd float %conv53, -2.570000e+02 %spec.select208 = select i1 %cmp96, float %sub105, float %conv53 %conv84.1 = sitofp i32 %conv40 to float %conv86.1 = sitofp i32 %conv24 to float %sub88.1 = fadd float %conv86.1, -5.140000e+02 %cmp89.1 = fcmp olt float %sub88.1, %conv84.1 %conv90.1 = zext i1 %cmp89.1 to i32 %cmp93.1 = icmp sge i32 %conv32, %conv24 %add95.1 = sext i1 %cmp93.1 to i32 %cmp96.1 = icmp eq i32 %conv90.1, %add95.1 %sub105.1 = fadd float %conv86.1, -2.570000e+02 %spec.select208.1 = select i1 %cmp96.1, float %sub105.1, float %conv86.1 %conv84.2 = sitofp i32 %conv42 to float %conv86.2 = sitofp i32 %conv26 to float %sub88.2 = fadd float %conv86.2, -5.140000e+02 %cmp89.2 = fcmp olt float %sub88.2, %conv84.2 %conv90.2 = zext i1 %cmp89.2 to i32 %cmp93.2 = icmp sge i32 %conv34, %conv26 %add95.2 = sext i1 %cmp93.2 to i32 %cmp96.2 = icmp eq i32 %conv90.2, %add95.2 %sub105.2 = fadd float %conv86.2, -2.570000e+02 %spec.select208.2 = select i1 %cmp96.2, float %sub105.2, float %conv86.2 %conv84.3 = sitofp i32 %conv44 to float %conv86.3 = sitofp i32 %conv28 to float %sub88.3 = fadd float %conv86.3, -5.140000e+02 %cmp89.3 = fcmp olt float %sub88.3, %conv84.3 %conv90.3 = zext i1 %cmp89.3 to i32 %cmp93.3 = icmp sge i32 %conv36, %conv28 %add95.3 = sext i1 %cmp93.3 to i32 %cmp96.3 = icmp eq i32 %conv90.3, %add95.3 %sub105.3 = fadd float %conv86.3, -2.570000e+02 br label %if.end for.body.preheader: ; preds = %cond.end21 %add55 = fadd float %conv53, 5.140000e+02 %cmp56 = fcmp ogt float %add55, %conv51 %conv57 = zext i1 %cmp56 to i32 %cmp60 = icmp sle i32 %conv30, %conv %add62 = sext i1 %cmp60 to i32 %cmp63 = icmp eq i32 %conv57, %add62 %add72 = fadd float %conv53, 2.570000e+02 %spec.select = select i1 %cmp63, float %add72, float %conv53 %conv51.1 = sitofp i32 %conv40 to float %conv53.1 = sitofp i32 %conv24 to float %add55.1 = fadd float %conv53.1, 5.140000e+02 %cmp56.1 = fcmp ogt float %add55.1, %conv51.1 %conv57.1 = zext i1 %cmp56.1 to i32 %cmp60.1 = icmp sle i32 %conv32, %conv24 %add62.1 = sext i1 %cmp60.1 to i32 %cmp63.1 = icmp eq i32 %conv57.1, %add62.1 %add72.1 = fadd float %conv53.1, 2.570000e+02 %spec.select.1 = select i1 %cmp63.1, float %add72.1, float %conv53.1 %conv51.2 = sitofp i32 %conv42 to float %conv53.2 = sitofp i32 %conv26 to float %add55.2 = fadd float %conv53.2, 5.140000e+02 %cmp56.2 = fcmp ogt float %add55.2, %conv51.2 %conv57.2 = zext i1 %cmp56.2 to i32 %cmp60.2 = icmp sle i32 %conv34, %conv26 %add62.2 = sext i1 %cmp60.2 to i32 %cmp63.2 = icmp eq i32 %conv57.2, %add62.2 %add72.2 = fadd float %conv53.2, 2.570000e+02 %spec.select.2 = select i1 %cmp63.2, float %add72.2, float %conv53.2 %conv51.3 = sitofp i32 %conv44 to float %conv53.3 = sitofp i32 %conv28 to float %add55.3 = fadd float %conv53.3, 5.140000e+02 %cmp56.3 = fcmp ogt float %add55.3, %conv51.3 %conv57.3 = zext i1 %cmp56.3 to i32 %cmp60.3 = icmp sle i32 %conv36, %conv28 %add62.3 = sext i1 %cmp60.3 to i32 %cmp63.3 = icmp eq i32 %conv57.3, %add62.3 %add72.3 = fadd float %conv53.3, 2.570000e+02 br label %if.end if.end: ; preds = %for.body82.preheader, %for.body.preheader %conv86.3.sink = phi float [ %conv86.3, %for.body82.preheader ], [ %conv53.3, %for.body.preheader ] %sub105.3.sink = phi float [ %sub105.3, %for.body82.preheader ], [ %add72.3, %for.body.preheader ] %cmp96.3.sink = phi i1 [ %cmp96.3, %for.body82.preheader ], [ %cmp63.3, %for.body.preheader ] %.in213 = phi float [ %spec.select208.2, %for.body82.preheader ], [ %spec.select.2, %for.body.preheader ] %.in214 = phi float [ %spec.select208.1, %for.body82.preheader ], [ %spec.select.1, %for.body.preheader ] %.in215 = phi float [ %spec.select208, %for.body82.preheader ], [ %spec.select, %for.body.preheader ] %50 = fptosi float %.in215 to i32 %51 = fptosi float %.in214 to i32 %52 = fptosi float %.in213 to i32 %conv114 = sitofp i32 %50 to float %53 = insertelement <4 x float> %17, float %conv114, i32 0 %conv116 = sitofp i32 %51 to float %54 = insertelement <4 x float> %53, float %conv116, i32 1 %conv118 = sitofp i32 %52 to float %55 = insertelement <4 x float> %54, float %conv118, i32 2 %cmp119 = icmp eq i32 %matte, 0 br i1 %cmp119, label %if.end124, label %if.then121 if.then121: ; preds = %if.end %spec.select208.3 = select i1 %cmp96.3.sink, float %sub105.3.sink, float %conv86.3.sink %56 = fptosi float %spec.select208.3 to i32 %conv123 = sitofp i32 %56 to float %57 = insertelement <4 x float> %55, float %conv123, i32 3 br label %if.end124 if.end124: ; preds = %if.end, %if.then121 %v.0 = phi <4 x float> [ %57, %if.then121 ], [ %55, %if.end ] %arrayidx127 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %outputImage, i32 %add store <4 x float> %v.0, <4 x float> addrspace(1)* %arrayidx127, align 16, !tbaa !14 ret void } ; Function Attrs: convergent nounwind define amdgpu_kernel void @Equalize(<4 x float> addrspace(1)* noalias nocapture %im, i32 %channel, <4 x float> addrspace(1)* noalias nocapture readonly %equalize_map, <4 x float> %white, <4 x float> %black) local_unnamed_addr #4 !kernel_arg_addr_space !35 !kernel_arg_access_qual !31 !kernel_arg_type !36 !kernel_arg_base_type !37 !kernel_arg_type_qual !38 { entry: %0 = tail call i32 @llvm.r600.read.tgid.x() #13 %x.i.i = tail call i32 @llvm.r600.read.local.size.x() #13 %1 = mul i32 %x.i.i, %0 %2 = tail call i32 @llvm.r600.read.tidig.x() #13, !range !3 %3 = add i32 %1, %2 %4 = tail call i8 addrspace(7)* @llvm.r600.implicitarg.ptr() #13 %5 = getelementptr inbounds i8, i8 addrspace(7)* %4, i32 4 %6 = bitcast i8 addrspace(7)* %5 to i32 addrspace(7)* %7 = load i32, i32 addrspace(7)* %6, align 4, !tbaa !4 %8 = add i32 %3, %7 %9 = tail call i32 @llvm.r600.read.tgid.y() #13 %y.i.i = tail call i32 @llvm.r600.read.local.size.y() #13 %10 = mul i32 %y.i.i, %9 %11 = tail call i32 @llvm.r600.read.tidig.y() #13, !range !3 %12 = add i32 %10, %11 %13 = getelementptr inbounds i8, i8 addrspace(7)* %4, i32 8 %14 = bitcast i8 addrspace(7)* %13 to i32 addrspace(7)* %15 = load i32, i32 addrspace(7)* %14, align 4, !tbaa !4 %16 = add i32 %12, %15 %x.i = tail call i32 @llvm.r600.read.global.size.x() #16 %mul = mul nsw i32 %16, %x.i %add = add nsw i32 %8, %mul %arrayidx = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %im, i32 %add %17 = load <4 x float>, <4 x float> addrspace(1)* %arrayidx, align 16, !tbaa !14 %and = and i32 %channel, 131072 %cmp = icmp eq i32 %and, 0 br i1 %cmp, label %if.end27, label %if.then if.then: ; preds = %entry %18 = extractelement <4 x float> %white, i32 2 %19 = extractelement <4 x float> %black, i32 2 %cmp5 = fcmp une float %18, %19 br i1 %cmp5, label %if.then6, label %if.end27 if.then6: ; preds = %if.then %20 = extractelement <4 x float> %17, i32 2 %.inv.i57 = fcmp oge float %20, 6.553500e+04 %retval.02.i58 = select i1 %.inv.i57, float 6.553500e+04, float %20 %21 = fptoui float %retval.02.i58 to i32 %arrayidx9 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %equalize_map, i32 %21 %22 = load <4 x float>, <4 x float> addrspace(1)* %arrayidx9, align 16, !tbaa !14 %23 = extractelement <4 x float> %17, i32 1 %.inv.i55 = fcmp oge float %23, 6.553500e+04 %retval.02.i56 = select i1 %.inv.i55, float 6.553500e+04, float %23 %24 = fptoui float %retval.02.i56 to i32 %arrayidx13 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %equalize_map, i32 %24 %25 = load <4 x float>, <4 x float> addrspace(1)* %arrayidx13, align 16, !tbaa !14 %26 = extractelement <4 x float> %17, i32 0 %.inv.i53 = fcmp oge float %26, 6.553500e+04 %retval.02.i54 = select i1 %.inv.i53, float 6.553500e+04, float %26 %27 = fptoui float %retval.02.i54 to i32 %arrayidx17 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %equalize_map, i32 %27 %28 = load <4 x float>, <4 x float> addrspace(1)* %arrayidx17, align 16, !tbaa !14 %29 = extractelement <4 x float> %17, i32 3 %.inv.i = fcmp oge float %29, 6.553500e+04 %retval.02.i = select i1 %.inv.i, float 6.553500e+04, float %29 %30 = fptoui float %retval.02.i to i32 %arrayidx21 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %equalize_map, i32 %30 %31 = load <4 x float>, <4 x float> addrspace(1)* %arrayidx21, align 16, !tbaa !14 %vecinit23 = shufflevector <4 x float> %28, <4 x float> %25, <4 x i32> %vecinit24 = shufflevector <4 x float> %vecinit23, <4 x float> %22, <4 x i32> %vecinit25 = shufflevector <4 x float> %vecinit24, <4 x float> %31, <4 x i32> store <4 x float> %vecinit25, <4 x float> addrspace(1)* %arrayidx, align 16, !tbaa !14 br label %if.end27 if.end27: ; preds = %entry, %if.then, %if.then6 ret void } ; Function Attrs: convergent nounwind readonly define float @ApplyFunction(float %pixel, i32 %function, i32 %number_parameters, float addrspace(4)* nocapture readonly %parameters) local_unnamed_addr #2 { entry: switch i32 %function, label %sw.epilog [ i32 3, label %for.cond.preheader i32 4, label %sw.bb3 i32 1, label %sw.bb29 i32 2, label %sw.bb74 ] for.cond.preheader: ; preds = %entry %cmp195 = icmp eq i32 %number_parameters, 0 br i1 %cmp195, label %sw.epilog, label %for.body for.cond.cleanup.loopexit: ; preds = %for.body %phitmp198 = fmul float %1, 6.553500e+04 br label %sw.epilog for.body: ; preds = %for.cond.preheader, %for.body %result.0197 = phi float [ %1, %for.body ], [ 0.000000e+00, %for.cond.preheader ] %i.0196 = phi i32 [ %inc, %for.body ], [ 0, %for.cond.preheader ] %mul = fmul float %result.0197, 0x3EEF751040000000 %arrayidx = getelementptr inbounds float, float addrspace(4)* %parameters, i32 %i.0196 %0 = load float, float addrspace(4)* %arrayidx, align 4, !tbaa !12 %1 = tail call float @llvm.fmuladd.f32(float %mul, float %pixel, float %0) %inc = add nuw i32 %i.0196, 1 %exitcond = icmp eq i32 %inc, %number_parameters br i1 %exitcond, label %for.cond.cleanup.loopexit, label %for.body sw.bb3: ; preds = %entry %cmp4 = icmp eq i32 %number_parameters, 0 br i1 %cmp4, label %cond.end22, label %cond.end cond.end: ; preds = %sw.bb3 %2 = load float, float addrspace(4)* %parameters, align 4, !tbaa !12 %phitmp167 = fmul float %2, 0x3EEF751040000000 %cmp6 = icmp eq i32 %number_parameters, 1 br i1 %cmp6, label %cond.end22, label %cond.end10 cond.end10: ; preds = %cond.end %arrayidx8 = getelementptr inbounds float, float addrspace(4)* %parameters, i32 1 %3 = load float, float addrspace(4)* %arrayidx8, align 4, !tbaa !12 %cmp12 = icmp ugt i32 %number_parameters, 2 br i1 %cmp12, label %cond.end16, label %cond.end22 cond.end16: ; preds = %cond.end10 %arrayidx14 = getelementptr inbounds float, float addrspace(4)* %parameters, i32 2 %4 = load float, float addrspace(4)* %arrayidx14, align 4, !tbaa !12 %cmp18 = icmp eq i32 %number_parameters, 3 br i1 %cmp18, label %cond.end22, label %cond.true19 cond.true19: ; preds = %cond.end16 %arrayidx20 = getelementptr inbounds float, float addrspace(4)* %parameters, i32 3 %5 = load float, float addrspace(4)* %arrayidx20, align 4, !tbaa !12 br label %cond.end22 cond.end22: ; preds = %cond.end16, %cond.end, %sw.bb3, %cond.end10, %cond.true19 %cond17176 = phi float [ %4, %cond.true19 ], [ %4, %cond.end16 ], [ 5.000000e-01, %cond.end10 ], [ 5.000000e-01, %cond.end ], [ 5.000000e-01, %sw.bb3 ] %cond169171175 = phi float [ %phitmp167, %cond.true19 ], [ %phitmp167, %cond.end16 ], [ %phitmp167, %cond.end10 ], [ %phitmp167, %cond.end ], [ 0x3EEF751040000000, %sw.bb3 ] %cond11172174 = phi float [ %3, %cond.true19 ], [ %3, %cond.end16 ], [ %3, %cond.end10 ], [ 0.000000e+00, %cond.end ], [ 0.000000e+00, %sw.bb3 ] %cond23 = phi float [ %5, %cond.true19 ], [ 5.000000e-01, %cond.end16 ], [ 5.000000e-01, %cond.end10 ], [ 5.000000e-01, %cond.end ], [ 5.000000e-01, %sw.bb3 ] %div = fdiv float %cond11172174, 3.600000e+02, !fpmath !11 %6 = tail call float @llvm.fmuladd.f32(float %cond169171175, float %pixel, float %div) %mul26 = fmul float %6, 0x401921FB80000000 %7 = bitcast float %mul26 to i32 %8 = and i32 %7, 2147483647 %9 = bitcast i32 %8 to float %10 = fcmp olt float %9, 0x4160000000000000 br i1 %10, label %11, label %52 ;