@@ -149,7 +149,7 @@ static Value optionallyTruncateOrExtend(Location loc, Value value,
149
149
150
150
// / Broadcasts the value to vector with `numElements` number of elements.
151
151
static Value broadcast (Location loc, Value toBroadcast, unsigned numElements,
152
- const LLVMTypeConverter &typeConverter,
152
+ const TypeConverter &typeConverter,
153
153
ConversionPatternRewriter &rewriter) {
154
154
auto vectorType = VectorType::get (numElements, toBroadcast.getType ());
155
155
auto llvmVectorType = typeConverter.convertType (vectorType);
@@ -166,7 +166,7 @@ static Value broadcast(Location loc, Value toBroadcast, unsigned numElements,
166
166
167
167
// / Broadcasts the value. If `srcType` is a scalar, the value remains unchanged.
168
168
static Value optionallyBroadcast (Location loc, Value value, Type srcType,
169
- const LLVMTypeConverter &typeConverter,
169
+ const TypeConverter &typeConverter,
170
170
ConversionPatternRewriter &rewriter) {
171
171
if (auto vectorType = dyn_cast<VectorType>(srcType)) {
172
172
unsigned numElements = vectorType.getNumElements ();
@@ -186,8 +186,7 @@ static Value optionallyBroadcast(Location loc, Value value, Type srcType,
186
186
// / Then cast `Offset` and `Count` if their bit width is different
187
187
// / from `Base` bit width.
188
188
static Value processCountOrOffset (Location loc, Value value, Type srcType,
189
- Type dstType,
190
- const LLVMTypeConverter &converter,
189
+ Type dstType, const TypeConverter &converter,
191
190
ConversionPatternRewriter &rewriter) {
192
191
Value broadcasted =
193
192
optionallyBroadcast (loc, value, srcType, converter, rewriter);
@@ -197,7 +196,7 @@ static Value processCountOrOffset(Location loc, Value value, Type srcType,
197
196
// / Converts SPIR-V struct with a regular (according to `VulkanLayoutUtils`)
198
197
// / offset to LLVM struct. Otherwise, the conversion is not supported.
199
198
static Type convertStructTypeWithOffset (spirv::StructType type,
200
- const LLVMTypeConverter &converter) {
199
+ const TypeConverter &converter) {
201
200
if (type != VulkanLayoutUtils::decorateType (type))
202
201
return nullptr ;
203
202
@@ -210,7 +209,7 @@ static Type convertStructTypeWithOffset(spirv::StructType type,
210
209
211
210
// / Converts SPIR-V struct with no offset to packed LLVM struct.
212
211
static Type convertStructTypePacked (spirv::StructType type,
213
- const LLVMTypeConverter &converter) {
212
+ const TypeConverter &converter) {
214
213
SmallVector<Type> elementsVector;
215
214
if (failed (converter.convertTypes (type.getElementTypes (), elementsVector)))
216
215
return nullptr ;
@@ -227,10 +226,11 @@ static Value createI32ConstantOf(Location loc, PatternRewriter &rewriter,
227
226
}
228
227
229
228
// / Utility for `spirv.Load` and `spirv.Store` conversion.
230
- static LogicalResult replaceWithLoadOrStore (
231
- Operation *op, ValueRange operands, ConversionPatternRewriter &rewriter,
232
- const LLVMTypeConverter &typeConverter, unsigned alignment, bool isVolatile,
233
- bool isNonTemporal) {
229
+ static LogicalResult replaceWithLoadOrStore (Operation *op, ValueRange operands,
230
+ ConversionPatternRewriter &rewriter,
231
+ const TypeConverter &typeConverter,
232
+ unsigned alignment, bool isVolatile,
233
+ bool isNonTemporal) {
234
234
if (auto loadOp = dyn_cast<spirv::LoadOp>(op)) {
235
235
auto dstType = typeConverter.convertType (loadOp.getType ());
236
236
if (!dstType)
@@ -271,7 +271,7 @@ static std::optional<Type> convertArrayType(spirv::ArrayType type,
271
271
// / Converts SPIR-V pointer type to LLVM pointer. Pointer's storage class is not
272
272
// / modelled at the moment.
273
273
static Type convertPointerType (spirv::PointerType type,
274
- const LLVMTypeConverter &converter,
274
+ const TypeConverter &converter,
275
275
spirv::ClientAPI clientAPI) {
276
276
unsigned addressSpace =
277
277
storageClassToAddressSpace (clientAPI, type.getStorageClass ());
@@ -292,7 +292,7 @@ static std::optional<Type> convertRuntimeArrayType(spirv::RuntimeArrayType type,
292
292
// / Converts SPIR-V struct to LLVM struct. There is no support of structs with
293
293
// / member decorations. Also, only natural offset is supported.
294
294
static Type convertStructType (spirv::StructType type,
295
- const LLVMTypeConverter &converter) {
295
+ const TypeConverter &converter) {
296
296
SmallVector<spirv::StructType::MemberDecorationInfo, 4 > memberDecorations;
297
297
type.getMemberDecorations (memberDecorations);
298
298
if (!memberDecorations.empty ())
@@ -1378,9 +1378,10 @@ class FuncConversionPattern : public SPIRVToLLVMConversion<spirv::FuncOp> {
1378
1378
auto funcType = funcOp.getFunctionType ();
1379
1379
TypeConverter::SignatureConversion signatureConverter (
1380
1380
funcType.getNumInputs ());
1381
- auto llvmType = getTypeConverter ()->convertFunctionSignature (
1382
- funcType, /* isVariadic=*/ false , /* useBarePtrCallConv=*/ false ,
1383
- signatureConverter);
1381
+ auto llvmType = static_cast <const LLVMTypeConverter *>(getTypeConverter ())
1382
+ ->convertFunctionSignature (
1383
+ funcType, /* isVariadic=*/ false ,
1384
+ /* useBarePtrCallConv=*/ false , signatureConverter);
1384
1385
if (!llvmType)
1385
1386
return failure ();
1386
1387
0 commit comments