static Type convertBoolMemrefType(const spirv::TargetEnv &targetEnv,
const SPIRVTypeConverter::Options &options,
MemRefType type) {
- if (!type.hasStaticShape()) {
- LLVM_DEBUG(llvm::dbgs()
- << type << " dynamic shape on i1 is not supported yet\n");
- return nullptr;
- }
-
Optional<spirv::StorageClass> storageClass =
SPIRVTypeConverter::getStorageClassForMemorySpace(
type.getMemorySpaceAsInt());
return nullptr;
}
+ if (!type.hasStaticShape()) {
+ auto arrayType =
+ spirv::RuntimeArrayType::get(arrayElemType, *arrayElemSize);
+ return wrapInStructAndGetPointer(arrayType, *storageClass);
+ }
+
int64_t memrefSize = (type.getNumElements() * numBoolBits + 7) / 8;
auto arrayElemCount = (memrefSize + *arrayElemSize - 1) / *arrayElemSize;
auto arrayType =
// CHECK-SAME: memref<*xi32>
func @unranked_memref(%arg0: memref<*xi32>) { return }
-// Check that dynamic dims on i1 are not supported.
// CHECK-LABEL: func @memref_1bit_type
-// CHECK-SAME: memref<?xi1>
+// CHECK-SAME: !spv.ptr<!spv.struct<(!spv.rtarray<i32, stride=4> [0])>, StorageBuffer>
+// NOEMU-LABEL: func @memref_1bit_type
+// NOEMU-SAME: memref<?xi1>
func @memref_1bit_type(%arg0: memref<?xi1>) { return }
// CHECK-LABEL: func @dynamic_dim_memref