|
24 | 24 | namespace mlir {
|
25 | 25 | /// Attribute name for the AffineArrayAttr which encodes the relationship
|
26 | 26 | /// between a structured op iterators' and its operands.
|
27 |
| -static constexpr StringLiteral getIndexingMapsAttrName() { |
28 |
| - return StringLiteral("indexing_maps"); |
29 |
| -} |
| 27 | +constexpr StringRef getIndexingMapsAttrName() { return "indexing_maps"; } |
30 | 28 |
|
31 | 29 | /// Attribute name for the StrArrayAttr which encodes the type of a structured
|
32 | 30 | /// op's iterators.
|
33 |
| -static constexpr StringLiteral getIteratorTypesAttrName() { |
34 |
| - return StringLiteral("iterator_types"); |
35 |
| -} |
| 31 | +constexpr StringRef getIteratorTypesAttrName() { return "iterator_types"; } |
36 | 32 |
|
37 | 33 | /// Attribute name for the IntegerAttr which encodes the number of input buffer
|
38 | 34 | /// arguments.
|
39 |
| -static constexpr StringLiteral getArgsInAttrName() { |
40 |
| - return StringLiteral("args_in"); |
41 |
| -} |
| 35 | +constexpr StringRef getArgsInAttrName() { return "args_in"; } |
42 | 36 |
|
43 | 37 | /// Attribute name for the IntegerAttr which encodes the number of input buffer
|
44 | 38 | /// arguments.
|
45 |
| -static constexpr StringLiteral getArgsOutAttrName() { |
46 |
| - return StringLiteral("args_out"); |
47 |
| -} |
| 39 | +constexpr StringRef getArgsOutAttrName() { return "args_out"; } |
48 | 40 |
|
49 | 41 | /// Attribute name for the StringAttr which encodes an optional documentation
|
50 | 42 | /// string of the structured op.
|
51 |
| -static constexpr StringLiteral getDocAttrName() { return StringLiteral("doc"); } |
| 43 | +constexpr StringRef getDocAttrName() { return "doc"; } |
52 | 44 |
|
53 | 45 | /// Attribute name for the StrArrayAttr which encodes the SymbolAttr for the
|
54 | 46 | /// MLIR function that implements the body of the structured op.
|
55 |
| -static constexpr StringLiteral getFunAttrName() { return StringLiteral("fun"); } |
| 47 | +constexpr StringRef getFunAttrName() { return "fun"; } |
56 | 48 |
|
57 | 49 | /// Attribute name for the StrArrayAttr which encodes the external library
|
58 | 50 | /// function that implements the structured op.
|
59 |
| -static constexpr StringLiteral getLibraryCallAttrName() { |
60 |
| - return StringLiteral("library_call"); |
61 |
| -} |
| 51 | +constexpr StringRef getLibraryCallAttrName() { return "library_call"; } |
62 | 52 |
|
63 | 53 | /// Use to encode that a particular iterator type has parallel semantics.
|
64 |
| -inline static constexpr StringLiteral getParallelIteratorTypeName() { |
65 |
| - return StringLiteral("parallel"); |
66 |
| -} |
| 54 | +constexpr StringRef getParallelIteratorTypeName() { return "parallel"; } |
67 | 55 |
|
68 | 56 | /// Use to encode that a particular iterator type has reduction semantics.
|
69 |
| -inline static constexpr StringLiteral getReductionIteratorTypeName() { |
70 |
| - return StringLiteral("reduction"); |
71 |
| -} |
| 57 | +constexpr StringRef getReductionIteratorTypeName() { return "reduction"; } |
72 | 58 |
|
73 | 59 | /// Use to encode that a particular iterator type has window semantics.
|
74 |
| -inline static constexpr StringLiteral getWindowIteratorTypeName() { |
75 |
| - return StringLiteral("window"); |
76 |
| -} |
| 60 | +constexpr StringRef getWindowIteratorTypeName() { return "window"; } |
77 | 61 |
|
78 | 62 | /// Use to encode that a particular iterator type has window semantics.
|
79 |
| -inline static ArrayRef<StringRef> getAllIteratorTypeNames() { |
80 |
| - static StringRef names[3] = {getParallelIteratorTypeName(), |
81 |
| - getReductionIteratorTypeName(), |
82 |
| - getWindowIteratorTypeName()}; |
83 |
| - return llvm::makeArrayRef(names); |
| 63 | +inline ArrayRef<StringRef> getAllIteratorTypeNames() { |
| 64 | + static constexpr StringRef names[3] = {getParallelIteratorTypeName(), |
| 65 | + getReductionIteratorTypeName(), |
| 66 | + getWindowIteratorTypeName()}; |
| 67 | + return names; |
84 | 68 | }
|
85 | 69 |
|
86 | 70 | /// Returns the iterator of a certain type.
|
|
0 commit comments