@@ -57,6 +57,8 @@ class EnumClassFlag<string flag, string getter> :
5757// LLVMAttrDefs.td
5858// - The mnemonics are either LLVM or builtin MLIR attributes and types, but
5959// regular C++ types are also allowed to match builders and parsers.
60+ // - DIScopeAttr and DINodeAttr are empty base classes, custom encoding not
61+ // needed.
6062//===----------------------------------------------------------------------===//
6163
6264//===----------------------------------------------------------------------===//
@@ -107,7 +109,7 @@ def DIFileAttr : DialectAttribute<(attr
107109//===----------------------------------------------------------------------===//
108110
109111def DILocalVariableAttr : DialectAttribute<(attr
110- Attr<"DIScopeAttr">:$scope, // Non-optional attribute
112+ Attr<"DIScopeAttr">:$scope,
111113 OptionalAttribute<"StringAttr">:$name,
112114 OptionalAttribute<"DIFileAttr">:$file,
113115 VarInt:$line,
@@ -158,7 +160,7 @@ def DISubprogramAttr : DialectAttribute<(attr
158160 Bool:$isRecSelf,
159161 OptionalAttribute<"DistinctAttr">:$id,
160162 OptionalAttribute<"DICompileUnitAttr">:$compileUnit,
161- OptionalAttribute<"DIScopeAttr">:$scope, // TODO: DIScopeAttr
163+ OptionalAttribute<"DIScopeAttr">:$scope,
162164 OptionalAttribute<"StringAttr">:$name,
163165 OptionalAttribute<"StringAttr">:$linkageName,
164166 OptionalAttribute<"DIFileAttr">:$file,
@@ -207,7 +209,7 @@ def DIDerivedTypeAttr : DialectAttribute<(attr
207209 VarInt:$alignInBits,
208210 VarInt:$offsetInBits,
209211 OptionalInt<"unsigned">:$dwarfAddressSpace,
210- OptionalAttribute<"DINodeAttr">:$extraData // TODO: DINodeAttr
212+ OptionalAttribute<"DINodeAttr">:$extraData
211213)>;
212214
213215//===----------------------------------------------------------------------===//
@@ -305,26 +307,27 @@ def DISubrangeAttr : DialectAttribute<(attr
305307
306308def LoopAnnotationAttr : DialectAttribute<(attr
307309 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,
317319 OptionalAttribute<"BoolAttr">:$mustProgress,
318320 OptionalAttribute<"BoolAttr">:$isVectorized,
319321 OptionalAttribute<"FusedLoc">:$startLoc,
320322 OptionalAttribute<"FusedLoc">:$endLoc,
321- OptionalArrayRef<"AccessGroupAttr">:$parallelAccesses // TODO: AccessGroupAttr
323+ OptionalArrayRef<"AccessGroupAttr">:$parallelAccesses
322324)>;
323325
324326//===----------------------------------------------------------------------===//
325327// Attributes & Types with custom bytecode handling.
326328//===----------------------------------------------------------------------===//
327329
330+ // All the attributes with custom bytecode handling.
328331def LLVMDialectAttributes : DialectAttributes<"LLVM"> {
329332 let elems = [
330333 AliasScopeAttr,
@@ -347,6 +350,10 @@ def LLVMDialectAttributes : DialectAttributes<"LLVM"> {
347350 DISubrangeAttr,
348351 DISubroutineTypeAttr,
349352 LoopAnnotationAttr
353+ // Referenced attributes currently missing support:
354+ // AccessGroupAttr, LoopVectorizeAttr, LoopInterleaveAttr, LoopUnrollAttr,
355+ // LoopUnrollAndJamAttr, LoopLICMAttr, LoopDistributeAttr, LoopPipelineAttr,
356+ // LoopPeeledAttr, LoopUnswitchAttr
350357 ];
351358}
352359
0 commit comments