Skip to content

Commit 3cfbd3c

Browse files
jgu222igcbot
authored andcommitted
revert the previous incorrect autobackout
This is to restore the original change that fix layout struct copy.
1 parent 570cfe7 commit 3cfbd3c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9308,9 +9308,13 @@ void EmitPass::emitCopyFromLayoutStruct(Value* D, Value* S)
93089308
}
93099309

93109310
uint32_t sTyBytes = (uint32_t)DL.getTypeStoreSize(sTy);
9311-
// struct member could be vector, so take its scalar type.
9311+
// dEltTy : copy type
9312+
// struct member could be vector, so take its scalar type.
9313+
// Use int type for copy always.
93129314
Type* dEltTy = sTy->getElementType(0)->getScalarType();
93139315
uint32_t dEltBytes = (uint32_t)DL.getTypeStoreSize(dEltTy);
9316+
// dEltTy could be of struct or float, int, etc. Here, use int type.
9317+
dEltTy = Type::getIntNTy(dEltTy->getContext(), dEltBytes * 8);
93149318
// dNElts in unit of dEltTy.
93159319
// Note Legal struct has its size be multiple of dEltTy.
93169320
IGC_ASSERT((sTyBytes % dEltBytes) == 0);

0 commit comments

Comments
 (0)