Skip to content

Commit e06c3a9

Browse files
authored
[SPIRV] Add assertion to simplify debugging (#152139)
1 parent cd40281 commit e06c3a9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,8 @@ SPIRVType *SPIRVGlobalRegistry::getOpTypeArray(uint32_t NumElems,
840840
.addUse(NumElementsVReg);
841841
});
842842
} else {
843+
assert(ST.isShader() && "Runtime arrays are not allowed in non-shader "
844+
"SPIR-V modules.");
843845
if (!ST.isShader())
844846
return nullptr;
845847
ArrayType = createOpType(MIRBuilder, [&](MachineIRBuilder &MIRBuilder) {

0 commit comments

Comments
 (0)