[llvm] [SPIR-V] Fix division by zero on byte addressing GEP into a subbyte array (PR #202593)
Arseniy Obolenskiy via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 12 02:24:04 PDT 2026
================
@@ -788,7 +788,7 @@ bool SPIRVEmitIntrinsics::walkLogicalAccessChainConstant(
do {
if (ArrayType *AT = dyn_cast<ArrayType>(CurType)) {
- uint32_t EltTypeSize = DL.getTypeSizeInBits(AT->getElementType()) / 8;
+ uint64_t EltTypeSize = DL.getTypeAllocSize(AT->getElementType());
----------------
aobolensk wrote:
`getTypeAllocSize` depends on LLVM IR DataLayout, not on SPIR-V expectations
https://github.com/llvm/llvm-project/pull/202593
More information about the llvm-commits
mailing list