From 34628711bb19c4491812c38697bd007b0ca1c817 Mon Sep 17 00:00:00 2001 From: xazhang Date: Thu, 9 Nov 2023 20:56:31 -0500 Subject: [PATCH] minor fix --- lgc/patch/PatchEntryPointMutate.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lgc/patch/PatchEntryPointMutate.cpp b/lgc/patch/PatchEntryPointMutate.cpp index 4a4759196c..96b5899e72 100644 --- a/lgc/patch/PatchEntryPointMutate.cpp +++ b/lgc/patch/PatchEntryPointMutate.cpp @@ -378,7 +378,7 @@ void PatchEntryPointMutate::lowerGroupMemcpy(GroupMemcpyOp &groupMemcpyOp) { // The local invocation ID is packed to VGPR0 on GFX11+ with the following layout: // // +-----------------------+-----------------------+-----------------------+ - // | Local Invocation ID Z | Local Invocation ID Y | Local Invocation ID Z | + // | Local Invocation ID Z | Local Invocation ID Y | Local Invocation ID X | // | [29:20] | [19:10] | [9:0] | // +-----------------------+-----------------------+-----------------------+ // localInvocationIdZ = localInvocationId[29:20] @@ -395,10 +395,9 @@ void PatchEntryPointMutate::lowerGroupMemcpy(GroupMemcpyOp &groupMemcpyOp) { threadIndex = builder.getInt32(0); if (workgroupSize[2] > 1) threadIndex = builder.CreateMul(threadIdComp[2], builder.getInt32(workgroupSize[1])); - if (workgroupSize[1] > 1) { - threadIndex = builder.CreateAdd(threadIndex, threadIdComp[1]); - threadIndex = builder.CreateMul(threadIndex, builder.getInt32(workgroupSize[0])); - } + if (workgroupSize[1] > 1) + threadIndex = + builder.CreateMul(builder.CreateAdd(threadIndex, threadIdComp[1]), builder.getInt32(workgroupSize[0])); threadIndex = builder.CreateAdd(threadIndex, threadIdComp[0]); } } else {