@@ -176,7 +176,7 @@ mlir::Type getSYCLType(const clang::RecordType *RT,
176
176
llvm::SmallVector<mlir::Type, 4 > Body;
177
177
178
178
for (const auto *Field : RD->fields ())
179
- Body.push_back (CGT.getMLIRType (Field->getType ()));
179
+ Body.push_back (CGT.getMLIRTypeForMem (Field->getType ()));
180
180
181
181
if (const auto *CTS =
182
182
llvm::dyn_cast<clang::ClassTemplateSpecializationDecl>(RD)) {
@@ -193,7 +193,7 @@ mlir::Type getSYCLType(const clang::RecordType *RT,
193
193
}
194
194
case TypeEnum::Accessor: {
195
195
const auto Type =
196
- CGT.getMLIRType (CTS->getTemplateArgs ().get (0 ).getAsType ());
196
+ CGT.getMLIRTypeForMem (CTS->getTemplateArgs ().get (0 ).getAsType ());
197
197
const auto Dim =
198
198
CTS->getTemplateArgs ().get (1 ).getAsIntegral ().getExtValue ();
199
199
const auto MemAccessMode = static_cast <mlir::sycl::MemoryAccessMode>(
@@ -206,7 +206,7 @@ mlir::Type getSYCLType(const clang::RecordType *RT,
206
206
// TODO: we should push the non-empty base classes in a more general way.
207
207
if (MemTargetMode == mlir::sycl::MemoryTargetMode::Local) {
208
208
assert (Body.empty ());
209
- Body.push_back (CGT.getMLIRType (CTS->bases_begin ()->getType ()));
209
+ Body.push_back (CGT.getMLIRTypeForMem (CTS->bases_begin ()->getType ()));
210
210
}
211
211
212
212
return mlir::sycl::AccessorType::get (CGT.getModule ()->getContext (), Type,
@@ -227,7 +227,7 @@ mlir::Type getSYCLType(const clang::RecordType *RT,
227
227
}
228
228
case TypeEnum::Atomic: {
229
229
const auto Type =
230
- CGT.getMLIRType (CTS->getTemplateArgs ().get (0 ).getAsType ());
230
+ CGT.getMLIRTypeForMem (CTS->getTemplateArgs ().get (0 ).getAsType ());
231
231
const int AddrSpace =
232
232
CTS->getTemplateArgs ().get (1 ).getAsIntegral ().getExtValue ();
233
233
return mlir::sycl::AtomicType::get (
@@ -236,12 +236,12 @@ mlir::Type getSYCLType(const clang::RecordType *RT,
236
236
}
237
237
case TypeEnum::GetOp: {
238
238
const auto Type =
239
- CGT.getMLIRType (CTS->getTemplateArgs ().get (0 ).getAsType ());
239
+ CGT.getMLIRTypeForMem (CTS->getTemplateArgs ().get (0 ).getAsType ());
240
240
return mlir::sycl::GetOpType::get (CGT.getModule ()->getContext (), Type);
241
241
}
242
242
case TypeEnum::GetScalarOp: {
243
243
const auto Type =
244
- CGT.getMLIRType (CTS->getTemplateArgs ().get (0 ).getAsType ());
244
+ CGT.getMLIRTypeForMem (CTS->getTemplateArgs ().get (0 ).getAsType ());
245
245
return mlir::sycl::GetScalarOpType::get (CGT.getModule ()->getContext (),
246
246
Type, Body);
247
247
}
@@ -260,7 +260,7 @@ mlir::Type getSYCLType(const clang::RecordType *RT,
260
260
case TypeEnum::ID: {
261
261
const auto Dim =
262
262
CTS->getTemplateArgs ().get (0 ).getAsIntegral ().getExtValue ();
263
- Body.push_back (CGT.getMLIRType (CTS->bases_begin ()->getType ()));
263
+ Body.push_back (CGT.getMLIRTypeForMem (CTS->bases_begin ()->getType ()));
264
264
return mlir::sycl::IDType::get (CGT.getModule ()->getContext (), Dim, Body);
265
265
}
266
266
case TypeEnum::ItemBase: {
@@ -287,7 +287,7 @@ mlir::Type getSYCLType(const clang::RecordType *RT,
287
287
}
288
288
case TypeEnum::LocalAccessorBase: {
289
289
const auto Type =
290
- CGT.getMLIRType (CTS->getTemplateArgs ().get (0 ).getAsType ());
290
+ CGT.getMLIRTypeForMem (CTS->getTemplateArgs ().get (0 ).getAsType ());
291
291
const auto Dim =
292
292
CTS->getTemplateArgs ().get (1 ).getAsIntegral ().getExtValue ();
293
293
const auto MemAccessMode = static_cast <mlir::sycl::MemoryAccessMode>(
@@ -297,10 +297,10 @@ mlir::Type getSYCLType(const clang::RecordType *RT,
297
297
}
298
298
case TypeEnum::LocalAccessor: {
299
299
const auto Type =
300
- CGT.getMLIRType (CTS->getTemplateArgs ().get (0 ).getAsType ());
300
+ CGT.getMLIRTypeForMem (CTS->getTemplateArgs ().get (0 ).getAsType ());
301
301
const auto Dim =
302
302
CTS->getTemplateArgs ().get (1 ).getAsIntegral ().getExtValue ();
303
- Body.push_back (CGT.getMLIRType (CTS->bases_begin ()->getType ()));
303
+ Body.push_back (CGT.getMLIRTypeForMem (CTS->bases_begin ()->getType ()));
304
304
return mlir::sycl::LocalAccessorType::get (CGT.getModule ()->getContext (),
305
305
Type, Dim, Body);
306
306
}
@@ -316,7 +316,7 @@ mlir::Type getSYCLType(const clang::RecordType *RT,
316
316
}
317
317
case TypeEnum::MultiPtr: {
318
318
const auto Type =
319
- CGT.getMLIRType (CTS->getTemplateArgs ().get (0 ).getAsType ());
319
+ CGT.getMLIRTypeForMem (CTS->getTemplateArgs ().get (0 ).getAsType ());
320
320
const int AddrSpace =
321
321
CTS->getTemplateArgs ().get (1 ).getAsIntegral ().getExtValue ();
322
322
const int DecAccess =
@@ -343,36 +343,36 @@ mlir::Type getSYCLType(const clang::RecordType *RT,
343
343
case TypeEnum::Range: {
344
344
const auto Dim =
345
345
CTS->getTemplateArgs ().get (0 ).getAsIntegral ().getExtValue ();
346
- Body.push_back (CGT.getMLIRType (CTS->bases_begin ()->getType ()));
346
+ Body.push_back (CGT.getMLIRTypeForMem (CTS->bases_begin ()->getType ()));
347
347
return mlir::sycl::RangeType::get (CGT.getModule ()->getContext (), Dim,
348
348
Body);
349
349
}
350
350
case TypeEnum::TupleCopyAssignableValueHolder: {
351
351
const auto Type =
352
- CGT.getMLIRType (CTS->getTemplateArgs ().get (0 ).getAsType ());
352
+ CGT.getMLIRTypeForMem (CTS->getTemplateArgs ().get (0 ).getAsType ());
353
353
const auto IsTriviallyCopyAssignable =
354
354
CTS->getTemplateArgs ().get (1 ).getAsIntegral ().getExtValue ();
355
- Body.push_back (CGT.getMLIRType (CTS->bases_begin ()->getType ()));
355
+ Body.push_back (CGT.getMLIRTypeForMem (CTS->bases_begin ()->getType ()));
356
356
return mlir::sycl::TupleCopyAssignableValueHolderType::get (
357
357
CGT.getModule ()->getContext (), Type, IsTriviallyCopyAssignable, Body);
358
358
}
359
359
case TypeEnum::TupleValueHolder: {
360
360
const auto Type =
361
- CGT.getMLIRType (CTS->getTemplateArgs ().get (0 ).getAsType ());
361
+ CGT.getMLIRTypeForMem (CTS->getTemplateArgs ().get (0 ).getAsType ());
362
362
return mlir::sycl::TupleValueHolderType::get (
363
363
CGT.getModule ()->getContext (), Type, Body);
364
364
}
365
365
case TypeEnum::Vec: {
366
366
const auto ElemType =
367
- CGT.getMLIRType (CTS->getTemplateArgs ().get (0 ).getAsType ());
367
+ CGT.getMLIRTypeForMem (CTS->getTemplateArgs ().get (0 ).getAsType ());
368
368
const auto NumElems =
369
369
CTS->getTemplateArgs ().get (1 ).getAsIntegral ().getExtValue ();
370
370
return mlir::sycl::VecType::get (CGT.getModule ()->getContext (), ElemType,
371
371
NumElems, Body);
372
372
}
373
373
case TypeEnum::SwizzleOp: {
374
374
const auto VecType =
375
- CGT.getMLIRType (CTS->getTemplateArgs ().get (0 ).getAsType ())
375
+ CGT.getMLIRTypeForMem (CTS->getTemplateArgs ().get (0 ).getAsType ())
376
376
.cast <mlir::sycl::VecType>();
377
377
const auto IndexesArgs = CTS->getTemplateArgs ().get (4 ).getPackAsArray ();
378
378
SmallVector<int > Indexes;
0 commit comments