@@ -57,6 +57,8 @@ class EnumClassFlag<string flag, string getter> :
57
57
// LLVMAttrDefs.td
58
58
// - The mnemonics are either LLVM or builtin MLIR attributes and types, but
59
59
// regular C++ types are also allowed to match builders and parsers.
60
+ // - DIScopeAttr and DINodeAttr are empty base classes, custom encoding not
61
+ // needed.
60
62
//===----------------------------------------------------------------------===//
61
63
62
64
//===----------------------------------------------------------------------===//
@@ -107,7 +109,7 @@ def DIFileAttr : DialectAttribute<(attr
107
109
//===----------------------------------------------------------------------===//
108
110
109
111
def DILocalVariableAttr : DialectAttribute<(attr
110
- Attr<"DIScopeAttr">:$scope, // Non-optional attribute
112
+ Attr<"DIScopeAttr">:$scope,
111
113
OptionalAttribute<"StringAttr">:$name,
112
114
OptionalAttribute<"DIFileAttr">:$file,
113
115
VarInt:$line,
@@ -158,7 +160,7 @@ def DISubprogramAttr : DialectAttribute<(attr
158
160
Bool:$isRecSelf,
159
161
OptionalAttribute<"DistinctAttr">:$id,
160
162
OptionalAttribute<"DICompileUnitAttr">:$compileUnit,
161
- OptionalAttribute<"DIScopeAttr">:$scope, // TODO: DIScopeAttr
163
+ OptionalAttribute<"DIScopeAttr">:$scope,
162
164
OptionalAttribute<"StringAttr">:$name,
163
165
OptionalAttribute<"StringAttr">:$linkageName,
164
166
OptionalAttribute<"DIFileAttr">:$file,
@@ -207,7 +209,7 @@ def DIDerivedTypeAttr : DialectAttribute<(attr
207
209
VarInt:$alignInBits,
208
210
VarInt:$offsetInBits,
209
211
OptionalInt<"unsigned">:$dwarfAddressSpace,
210
- OptionalAttribute<"DINodeAttr">:$extraData // TODO: DINodeAttr
212
+ OptionalAttribute<"DINodeAttr">:$extraData
211
213
)>;
212
214
213
215
//===----------------------------------------------------------------------===//
@@ -305,26 +307,27 @@ def DISubrangeAttr : DialectAttribute<(attr
305
307
306
308
def LoopAnnotationAttr : DialectAttribute<(attr
307
309
OptionalAttribute<"BoolAttr">:$disableNonforced,
308
- OptionalAttribute<"LoopVectorizeAttr">:$vectorize, // TODO: LoopVectorizeAttr
309
- OptionalAttribute<"LoopInterleaveAttr">:$interleave, // TODO: LoopInterleaveAttr
310
- OptionalAttribute<"LoopUnrollAttr">:$unroll, // TODO: LoopUnrollAttr
311
- OptionalAttribute<"LoopUnrollAndJamAttr">:$unrollAndJam, // TODO: LoopUnrollAndJamAttr
312
- OptionalAttribute<"LoopLICMAttr">:$licm, // TODO: LoopLICMAttr
313
- OptionalAttribute<"LoopDistributeAttr">:$distribute, // TODO: LoopDistributeAttr
314
- OptionalAttribute<"LoopPipelineAttr">:$pipeline, // TODO: LoopPipelineAttr
315
- OptionalAttribute<"LoopPeeledAttr">:$peeled, // TODO: LoopPeeledAttr
316
- OptionalAttribute<"LoopUnswitchAttr">:$unswitch, // TODO: LoopUnswitchAttr
310
+ OptionalAttribute<"LoopVectorizeAttr">:$vectorize,
311
+ OptionalAttribute<"LoopInterleaveAttr">:$interleave,
312
+ OptionalAttribute<"LoopUnrollAttr">:$unroll,
313
+ OptionalAttribute<"LoopUnrollAndJamAttr">:$unrollAndJam,
314
+ OptionalAttribute<"LoopLICMAttr">:$licm,
315
+ OptionalAttribute<"LoopDistributeAttr">:$distribute,
316
+ OptionalAttribute<"LoopPipelineAttr">:$pipeline,
317
+ OptionalAttribute<"LoopPeeledAttr">:$peeled,
318
+ OptionalAttribute<"LoopUnswitchAttr">:$unswitch,
317
319
OptionalAttribute<"BoolAttr">:$mustProgress,
318
320
OptionalAttribute<"BoolAttr">:$isVectorized,
319
321
OptionalAttribute<"FusedLoc">:$startLoc,
320
322
OptionalAttribute<"FusedLoc">:$endLoc,
321
- OptionalArrayRef<"AccessGroupAttr">:$parallelAccesses // TODO: AccessGroupAttr
323
+ OptionalArrayRef<"AccessGroupAttr">:$parallelAccesses
322
324
)>;
323
325
324
326
//===----------------------------------------------------------------------===//
325
327
// Attributes & Types with custom bytecode handling.
326
328
//===----------------------------------------------------------------------===//
327
329
330
+ // All the attributes with custom bytecode handling.
328
331
def LLVMDialectAttributes : DialectAttributes<"LLVM"> {
329
332
let elems = [
330
333
AliasScopeAttr,
@@ -347,6 +350,10 @@ def LLVMDialectAttributes : DialectAttributes<"LLVM"> {
347
350
DISubrangeAttr,
348
351
DISubroutineTypeAttr,
349
352
LoopAnnotationAttr
353
+ // Referenced attributes currently missing support:
354
+ // AccessGroupAttr, LoopVectorizeAttr, LoopInterleaveAttr, LoopUnrollAttr,
355
+ // LoopUnrollAndJamAttr, LoopLICMAttr, LoopDistributeAttr, LoopPipelineAttr,
356
+ // LoopPeeledAttr, LoopUnswitchAttr
350
357
];
351
358
}
352
359
0 commit comments