Skip to content

Commit 9ebdd41

Browse files
jgu222igcbot
authored andcommitted
[Autobackout][FuncReg]Revert of change: c24df24
Fix layout struct copy For struct type, GetType() (to get its visa type) is byte always. When doing struct layout copy, need to use int type that is the same size as its member. For example, a copy from uniform Src to uniform Dst, both are of the struct type as below: struct.soa { struct.aos {i8, i8, i8 ,i8}, struct.aos {i8, i8, i8, i8} } As its member is 4 bytes, the copy will be using dw as copy type: mov (2) Dst:d Src:d
1 parent ca5cbef commit 9ebdd41

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

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

93109310
uint32_t sTyBytes = (uint32_t)DL.getTypeStoreSize(sTy);
9311-
// dEltTy : copy type
9312-
// struct member could be vector, so take its scalar type.
9313-
// Use int type for copy always.
9311+
// struct member could be vector, so take its scalar type.
93149312
Type* dEltTy = sTy->getElementType(0)->getScalarType();
93159313
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);
93189314
// dNElts in unit of dEltTy.
93199315
// Note Legal struct has its size be multiple of dEltTy.
93209316
IGC_ASSERT((sTyBytes % dEltBytes) == 0);

0 commit comments

Comments
 (0)