diff --git a/llvm/test/VISC/parboil/benchmarks/mri-q/src/visc/visc_mri-q.ll b/llvm/test/VISC/parboil/benchmarks/mri-q/src/visc/visc_mri-q.ll index 11213492f06491f626e8661369eeece23f8adbbf..be3c3294ad36889e366225abdeb679c105da33aa 100644 --- a/llvm/test/VISC/parboil/benchmarks/mri-q/src/visc/visc_mri-q.ll +++ b/llvm/test/VISC/parboil/benchmarks/mri-q/src/visc/visc_mri-q.ll @@ -271,7 +271,7 @@ declare noalias i8* @malloc(i64) #1 ; ------------------ VISC Intrinsics ------------------- ; Return Type of VISC computePhiMag and computeQ %rtype = type {} -%struct.arg.phiMag = type <{ float*, i64, float*, i64, float*, i64, i32, i64, i64 %rtype }> +%struct.arg.phiMag = type <{ float*, i64, float*, i64, float*, i64, i32, i64, i64, %rtype }> %struct.arg.Q = type <{i32, i32, float*, i64, float*, i64, float*, i64, float*, i64, float*, i64, %struct.kValues*, i64, i64, i64, %rtype}> ; Function Attrs: nounwind @@ -284,13 +284,13 @@ declare void @llvm.visc.wait(i8*) #0 declare i8* @llvm.visc.createNode(i8*) #0 ; Function Attrs: nounwind -declare i8* @llvm.visc.createNode1D(i8*, i32) #0 +declare i8* @llvm.visc.createNode1D(i8*, i64) #0 ; Function Attrs: nounwind -declare i8* @llvm.visc.createNode2D(i8*, i32, i32) #0 +declare i8* @llvm.visc.createNode2D(i8*, i64, i64) #0 ; Function Attrs: nounwind -declare i8* @llvm.visc.createNode3D(i8*, i32, i32, i32) #0 +declare i8* @llvm.visc.createNode3D(i8*, i64, i64, i64) #0 ; Function Attrs: nounwind declare i8* @llvm.visc.createEdge(i8*, i8*, i1, i32, i32) #0 @@ -360,6 +360,7 @@ define %rtype @computePhiMag_kernel(float* in %phiR, i64 %bytes_phiR, float* in ;%global_id = call i32 (i32, ...)* bitcast (i32 (...)* @get_global_id to i32 (i32, ...)*)(i32 0) ; ---------------------- VISC changes End ------------------ store i32 %global_id, i32* %indexK, align 4 + %8 = add i1 0, 0 ; NOP inserted to avoid changed numbering %9 = load i32* %indexK, align 4 %10 = load i32* %7, align 4 %11 = icmp slt i32 %9, %10 @@ -413,7 +414,7 @@ define %rtype @computePhiMag_internal(float* in %phiR, i64 %bytes_phiR, float* i ; ----------------- Compute Phi Mag root node ---------------- define %rtype @computePhiMag_root(float* in %phiR, i64 %bytes_phiR, float* in %phiI, i64 %bytes_phiI, float* out %phiMag, i64 %bytes_phiMag, i32 %numK, i64 %DimPhiMagBlock, i64 %DimPhiMagGrid) { - %kernel = call i8* @llvm.visc.createNode1D(i8* bitcast (%rtype (float*, i64, float*, i64, float*, i64, i32, i64)* @computePhiMagi_internal to i8*), i64 %DimPhiMagGrid) + %kernel = call i8* @llvm.visc.createNode1D(i8* bitcast (%rtype (float*, i64, float*, i64, float*, i64, i32, i64)* @computePhiMag_internal to i8*), i64 %DimPhiMagGrid) ; Bind Inputs call void @llvm.visc.bind.input(i8* %kernel, i32 0, i32 0); phiR call void @llvm.visc.bind.input(i8* %kernel, i32 1, i32 1); bytes_phiR @@ -478,15 +479,15 @@ define void @computePhiMag(i32 %numK, float* %phiR, float* %phiI, float* %phiMag %in.addr = alloca %struct.arg.phiMag ; Store arguments - %in.addr.phiR = getelementptr %struct.arg* %in.addr, i32 0, i32 0 - %in.addr.bytes_phiR = getelementptr %struct.arg* %in.addr, i32 0, i32 1 - %in.addr.phiI = getelementptr %struct.arg* %in.addr, i32 0, i32 2 - %in.addr.bytes_phiI = getelementptr %struct.arg* %in.addr, i32 0, i32 3 - %in.addr.phiMag = getelementptr %struct.arg* %in.addr, i32 0, i32 4 - %in.addr.bytes_phiMag = getelementptr %struct.arg* %in.addr, i32 0, i32 5 - %in.addr.numK = getelementptr %struct.arg* %in.addr, i32 0, i32 6 - %in.addr.DimPhiMagBlock = getelementptr %struct.arg* %in.addr, i32 0, i32 7 - %in.addr.DimPhiMagGrid = getelementptr %struct.arg* %in.addr, i32 0, i32 8 + %in.addr.phiR = getelementptr %struct.arg.phiMag* %in.addr, i32 0, i32 0 + %in.addr.bytes_phiR = getelementptr %struct.arg.phiMag* %in.addr, i32 0, i32 1 + %in.addr.phiI = getelementptr %struct.arg.phiMag* %in.addr, i32 0, i32 2 + %in.addr.bytes_phiI = getelementptr %struct.arg.phiMag* %in.addr, i32 0, i32 3 + %in.addr.phiMag = getelementptr %struct.arg.phiMag* %in.addr, i32 0, i32 4 + %in.addr.bytes_phiMag = getelementptr %struct.arg.phiMag* %in.addr, i32 0, i32 5 + %in.addr.numK = getelementptr %struct.arg.phiMag* %in.addr, i32 0, i32 6 + %in.addr.DimPhiMagBlock = getelementptr %struct.arg.phiMag* %in.addr, i32 0, i32 7 + %in.addr.DimPhiMagGrid = getelementptr %struct.arg.phiMag* %in.addr, i32 0, i32 8 store float* %20, float** %in.addr.phiR store i64 %21, i64* %in.addr.bytes_phiR @@ -571,15 +572,16 @@ define %rtype @computeQ_kernel(i32 %numK, i32 %kGlobalIndex, float* in %x, i64 % ; Replaced statement -- ; %19 = call i32 (i32, ...)* bitcast (i32 (...)* @get_group_id to i32 (i32, ...)*)(i32 0) ; %21 = call i32 (i32, ...)* bitcast (i32 (...)* @get_local_id to i32 (i32, ...)*)(i32 0) - %this_node = call i8* @llvm.visc.getNode() - %parent_node = call i8* @llvm.visc.getParentNode(i8* %this_node) + %this_node_1 = call i8* @llvm.visc.getNode() + %parent_node_1 = call i8* @llvm.visc.getParentNode(i8* %this_node_1) - %19 = call i32 @llvm.visc.getNodeInstanceID.x(i8* %parent_node) - %21 = call i32 @llvm.visc.getNodeInstanceID.x(i8* %this_node) + %group_id_1 = call i32 @llvm.visc.getNodeInstanceID.x(i8* %parent_node_1) + %local_id_1 = call i32 @llvm.visc.getNodeInstanceID.x(i8* %this_node_1) ; ---------------------- VISC changes End ------------------ - - %20 = mul nsw i32 %19, 256 - %22 = mul nsw i32 4, %21 + %19 = add i32 0, 0 ; NOP + %20 = mul nsw i32 %group_id_1, 256 + %21 = add i32 0, 0 ; NOP + %22 = mul nsw i32 4, %local_id_1 %23 = add nsw i32 %20, %22 %24 = load i32* %tx, align 4 %25 = add nsw i32 %23, %24 @@ -775,17 +777,19 @@ define %rtype @computeQ_kernel(i32 %numK, i32 %kGlobalIndex, float* in %x, i64 % ; Replaced statement -- ; %167 = call i32 (i32, ...)* bitcast (i32 (...)* @get_group_id to i32 (i32, ...)*)(i32 0) ; %169 = call i32 (i32, ...)* bitcast (i32 (...)* @get_local_id to i32 (i32, ...)*)(i32 0) - %this_node = call i8* @llvm.visc.getNode() - %parent_node = call i8* @llvm.visc.getParentNode(i8* %this_node) + %this_node_2 = call i8* @llvm.visc.getNode() + %parent_node_2 = call i8* @llvm.visc.getParentNode(i8* %this_node_2) - %167 = call i32 @llvm.visc.getNodeInstanceID.x(i8* %parent_node) - %169 = call i32 @llvm.visc.getNodeInstanceID.x(i8* %this_node) + %group_id_2 = call i32 @llvm.visc.getNodeInstanceID.x(i8* %parent_node_2) + %local_id_2 = call i32 @llvm.visc.getNodeInstanceID.x(i8* %this_node_2) ; ---------------------- VISC changes End ------------------ - %168 = mul nsw i32 %167, 256 - %170 = mul nsw i32 4, %169 + %167 = add i32 0, 0 ; NOP + %168 = mul nsw i32 %group_id_2, 256 + %169 = add i32 0, 0 ; NOP + %170 = mul nsw i32 4, %local_id_2 %171 = add nsw i32 %168, %170 %172 = load i32* %tx2, align 4 %173 = add nsw i32 %171, %172 @@ -1003,22 +1007,22 @@ define void @computeQ(i32 %numK, i32 %numX, float* %x, float* %y, float* %z, %st %in.addr = alloca %struct.arg.Q ; Store arguments - %in.addr.numK = getelementptr %struct.arg* %in.addr, i32 0, i32 0 - %in.addr.kGlobalIndex = getelementptr %struct.arg* %in.addr, i32 0, i32 1 - %in.addr.x = getelementptr %struct.arg* %in.addr, i32 0, i32 2 - %in.addr.bytes_x = getelementptr %struct.arg* %in.addr, i32 0, i32 3 - %in.addr.y = getelementptr %struct.arg* %in.addr, i32 0, i32 4 - %in.addr.bytes_y = getelementptr %struct.arg* %in.addr, i32 0, i32 5 - %in.addr.z = getelementptr %struct.arg* %in.addr, i32 0, i32 6 - %in.addr.bytes_z = getelementptr %struct.arg* %in.addr, i32 0, i32 7 - %in.addr.Qr = getelementptr %struct.arg* %in.addr, i32 0, i32 8 - %in.addr.bytes_Qr = getelementptr %struct.arg* %in.addr, i32 0, i32 9 - %in.addr.Qi = getelementptr %struct.arg* %in.addr, i32 0, i32 10 - %in.addr.bytes_Qi = getelementptr %struct.arg* %in.addr, i32 0, i32 11 - %in.addr.ck = getelementptr %struct.arg* %in.addr, i32 0, i32 12 - %in.addr.bytes_ck = getelementptr %struct.arg* %in.addr, i32 0, i32 13 - %in.addr.DimQBlock = getelementptr %struct.arg* %in.addr, i32 0, i32 14 - %in.addr.DimQGrid = getelementptr %struct.arg* %in.addr, i32 0, i32 15 + %in.addr.numK = getelementptr %struct.arg.Q* %in.addr, i32 0, i32 0 + %in.addr.kGlobalIndex = getelementptr %struct.arg.Q* %in.addr, i32 0, i32 1 + %in.addr.x = getelementptr %struct.arg.Q* %in.addr, i32 0, i32 2 + %in.addr.bytes_x = getelementptr %struct.arg.Q* %in.addr, i32 0, i32 3 + %in.addr.y = getelementptr %struct.arg.Q* %in.addr, i32 0, i32 4 + %in.addr.bytes_y = getelementptr %struct.arg.Q* %in.addr, i32 0, i32 5 + %in.addr.z = getelementptr %struct.arg.Q* %in.addr, i32 0, i32 6 + %in.addr.bytes_z = getelementptr %struct.arg.Q* %in.addr, i32 0, i32 7 + %in.addr.Qr = getelementptr %struct.arg.Q* %in.addr, i32 0, i32 8 + %in.addr.bytes_Qr = getelementptr %struct.arg.Q* %in.addr, i32 0, i32 9 + %in.addr.Qi = getelementptr %struct.arg.Q* %in.addr, i32 0, i32 10 + %in.addr.bytes_Qi = getelementptr %struct.arg.Q* %in.addr, i32 0, i32 11 + %in.addr.ck = getelementptr %struct.arg.Q* %in.addr, i32 0, i32 12 + %in.addr.bytes_ck = getelementptr %struct.arg.Q* %in.addr, i32 0, i32 13 + %in.addr.DimQBlock = getelementptr %struct.arg.Q* %in.addr, i32 0, i32 14 + %in.addr.DimQGrid = getelementptr %struct.arg.Q* %in.addr, i32 0, i32 15 store i32 %59, i32* %in.addr.numK store i32 %60, i32* %in.addr.kGlobalIndex