13#include "mlir/Dialect/Ptr/IR/MemorySpaceInterfaces.h"
16#include "mlir/IR/Attributes.h"
17#include "mlir/IR/DialectImplementation.h"
18#include "llvm/ADT/TypeSwitch.h"
26 mlir::ArrayAttr &members);
33 cir::IntTypeInterface ty);
36 cir::IntTypeInterface ty);
43static mlir::ParseResult
45 mlir::FailureOr<llvm::APFloat> &value,
46 cir::FPTypeInterface fpType);
53 cir::LangAddressSpace &addrSpace) {
54 llvm::SMLoc loc = p.getCurrentLocation();
55 mlir::FailureOr<cir::LangAddressSpace> result =
56 mlir::FieldParser<cir::LangAddressSpace>::parse(p);
57 if (mlir::failed(result))
58 return p.emitError(loc,
"expected address space keyword");
59 addrSpace = result.value();
60 return mlir::success();
64 cir::LangAddressSpace addrSpace) {
65 p << cir::stringifyEnum(addrSpace);
69 mlir::IntegerAttr &value);
73static mlir::ParseResult
75 mlir::DenseI32ArrayAttr &memberPath);
78 mlir::DenseI32ArrayAttr memberPath);
80#define GET_ATTRDEF_CLASSES
81#include "clang/CIR/Dialect/IR/CIROpsAttributes.cpp.inc"
91bool LangAddressSpaceAttr::isValidLoad(
92 mlir::Type type, mlir::ptr::AtomicOrdering ordering,
93 std::optional<int64_t> alignment,
const mlir::DataLayout *dataLayout,
94 llvm::function_ref<mlir::InFlightDiagnostic()> emitError)
const {
95 llvm_unreachable(
"isValidLoad for LangAddressSpaceAttr NYI");
98bool LangAddressSpaceAttr::isValidStore(
99 mlir::Type type, mlir::ptr::AtomicOrdering ordering,
100 std::optional<int64_t> alignment,
const mlir::DataLayout *dataLayout,
101 llvm::function_ref<mlir::InFlightDiagnostic()> emitError)
const {
102 llvm_unreachable(
"isValidStore for LangAddressSpaceAttr NYI");
105bool LangAddressSpaceAttr::isValidAtomicOp(
106 mlir::ptr::AtomicBinOp op, mlir::Type type,
107 mlir::ptr::AtomicOrdering ordering, std::optional<int64_t> alignment,
108 const mlir::DataLayout *dataLayout,
109 llvm::function_ref<mlir::InFlightDiagnostic()> emitError)
const {
110 llvm_unreachable(
"isValidAtomicOp for LangAddressSpaceAttr NYI");
113bool LangAddressSpaceAttr::isValidAtomicXchg(
114 mlir::Type type, mlir::ptr::AtomicOrdering successOrdering,
115 mlir::ptr::AtomicOrdering failureOrdering, std::optional<int64_t> alignment,
116 const mlir::DataLayout *dataLayout,
117 llvm::function_ref<mlir::InFlightDiagnostic()> emitError)
const {
118 llvm_unreachable(
"isValidAtomicXchg for LangAddressSpaceAttr NYI");
121bool LangAddressSpaceAttr::isValidAddrSpaceCast(
122 mlir::Type tgt, mlir::Type src,
123 llvm::function_ref<mlir::InFlightDiagnostic()> emitError)
const {
124 llvm_unreachable(
"isValidAddrSpaceCast for LangAddressSpaceAttr NYI");
127bool LangAddressSpaceAttr::isValidPtrIntCast(
128 mlir::Type intLikeTy, mlir::Type ptrLikeTy,
129 llvm::function_ref<mlir::InFlightDiagnostic()> emitError)
const {
130 llvm_unreachable(
"isValidPtrIntCast for LangAddressSpaceAttr NYI");
133bool TargetAddressSpaceAttr::isValidLoad(
134 mlir::Type type, mlir::ptr::AtomicOrdering ordering,
135 std::optional<int64_t> alignment,
const mlir::DataLayout *dataLayout,
136 llvm::function_ref<mlir::InFlightDiagnostic()> emitError)
const {
137 llvm_unreachable(
"isValidLoad for TargetAddressSpaceAttr NYI");
140bool TargetAddressSpaceAttr::isValidStore(
141 mlir::Type type, mlir::ptr::AtomicOrdering ordering,
142 std::optional<int64_t> alignment,
const mlir::DataLayout *dataLayout,
143 llvm::function_ref<mlir::InFlightDiagnostic()> emitError)
const {
144 llvm_unreachable(
"isValidStore for TargetAddressSpaceAttr NYI");
147bool TargetAddressSpaceAttr::isValidAtomicOp(
148 mlir::ptr::AtomicBinOp op, mlir::Type type,
149 mlir::ptr::AtomicOrdering ordering, std::optional<int64_t> alignment,
150 const mlir::DataLayout *dataLayout,
151 llvm::function_ref<mlir::InFlightDiagnostic()> emitError)
const {
152 llvm_unreachable(
"isValidAtomicOp for TargetAddressSpaceAttr NYI");
155bool TargetAddressSpaceAttr::isValidAtomicXchg(
156 mlir::Type type, mlir::ptr::AtomicOrdering successOrdering,
157 mlir::ptr::AtomicOrdering failureOrdering, std::optional<int64_t> alignment,
158 const mlir::DataLayout *dataLayout,
159 llvm::function_ref<mlir::InFlightDiagnostic()> emitError)
const {
160 llvm_unreachable(
"isValidAtomicXchg for TargetAddressSpaceAttr NYI");
163bool TargetAddressSpaceAttr::isValidAddrSpaceCast(
164 mlir::Type tgt, mlir::Type src,
165 llvm::function_ref<mlir::InFlightDiagnostic()> emitError)
const {
166 llvm_unreachable(
"isValidAddrSpaceCast for TargetAddressSpaceAttr NYI");
169bool TargetAddressSpaceAttr::isValidPtrIntCast(
170 mlir::Type intLikeTy, mlir::Type ptrLikeTy,
171 llvm::function_ref<mlir::InFlightDiagnostic()> emitError)
const {
172 llvm_unreachable(
"isValidPtrIntCast for TargetAddressSpaceAttr NYI");
180 mlir::ArrayAttr members) {
182 llvm::interleaveComma(members, printer);
187 mlir::ArrayAttr &members) {
190 auto delimiter = AsmParser::Delimiter::Braces;
191 auto result = parser.parseCommaSeparatedList(delimiter, [&]() {
192 mlir::TypedAttr attr;
193 if (parser.parseAttribute(attr).failed())
194 return mlir::failure();
195 elts.push_back(attr);
196 return mlir::success();
200 return mlir::failure();
202 members = mlir::ArrayAttr::get(parser.getContext(), elts);
203 return mlir::success();
211ConstRecordAttr::verify(function_ref<InFlightDiagnostic()> emitError,
212 mlir::Type type, ArrayAttr members) {
213 auto sTy = mlir::dyn_cast_if_present<cir::RecordType>(type);
215 return emitError() <<
"expected !cir.struct or !cir.union type";
220 if (members.size() != 1)
221 return emitError() <<
"union constant must have exactly one element, got "
223 auto m = mlir::cast<mlir::TypedAttr>(members[0]);
224 if (!llvm::is_contained(sTy.getMembers(), m.getType()))
225 return emitError() <<
"union element type " << m.getType()
226 <<
" is not a member of " << sTy;
230 if (sTy.getMembers().size() != members.size())
231 return emitError() <<
"number of elements must match";
233 for (
const auto &[attrIdx, member] : llvm::enumerate(sTy.getMembers())) {
234 auto m = mlir::cast<mlir::TypedAttr>(members[attrIdx]);
239 if (attrIdx == sTy.getMembers().size() - 1) {
240 auto memArrayTy = dyn_cast<cir::ArrayType>(member);
241 if (memArrayTy && memArrayTy.getSize() == 0) {
244 if (!isa<cir::ArrayType>(m.getType()))
246 <<
"element at index " << attrIdx <<
" has type "
247 << m.getType() <<
" but the expected type for this element is "
250 cir::ArrayType initArrayTy = cast<cir::ArrayType>(m.getType());
252 if (initArrayTy.getElementType() != memArrayTy.getElementType())
254 <<
"flexible array member at index " << attrIdx <<
" has type "
256 <<
" which doesn't match the expected element type of member "
262 if (member != m.getType())
263 return emitError() <<
"element at index " << attrIdx <<
" has type "
265 <<
" but the expected type for this element is "
276LogicalResult OptInfoAttr::verify(function_ref<InFlightDiagnostic()> emitError,
277 unsigned level,
unsigned size) {
280 <<
"optimization level must be between 0 and 3 inclusive";
283 <<
"size optimization level must be between 0 and 2 inclusive";
293static ParseResult
parseConstPtr(AsmParser &parser, mlir::IntegerAttr &value) {
295 if (parser.parseOptionalKeyword(
"null").succeeded()) {
296 value = parser.getBuilder().getI64IntegerAttr(0);
300 return parser.parseAttribute(value);
311 mlir::DenseI32ArrayAttr &memberPath) {
312 if (parser.parseOptionalKeyword(
"null").succeeded())
315 auto parsed = mlir::FieldParser<mlir::DenseI32ArrayAttr>::parse(parser);
316 if (mlir::failed(parsed))
318 memberPath = *parsed;
323 mlir::DenseI32ArrayAttr memberPath) {
327 p.printStrippedAttrOrType(memberPath);
335 cir::IntTypeInterface ty) {
336 llvm::SMLoc loc = parser.getCurrentLocation();
338 mlir::OptionalParseResult result = parser.parseOptionalInteger(parsed);
339 if (!result.has_value() || failed(*result))
340 return parser.emitError(loc,
"expected integer value");
342 const unsigned width = ty.getWidth();
344 ty.isSigned() ? parsed.getSignificantBits() <= width
345 : !parsed.isNegative() && parsed.getActiveBits() <= width;
347 return parser.emitError(loc,
"integer value too large for the given type");
349 value = ty.isSigned() ? parsed.sextOrTrunc(width) : parsed.zextOrTrunc(width);
354 cir::IntTypeInterface ty) {
356 value.toString(str, 10, ty.isSigned());
360LogicalResult IntAttr::verify(function_ref<InFlightDiagnostic()> emitError,
361 cir::IntTypeInterface type, llvm::APInt value) {
362 if (value.getBitWidth() != type.getWidth())
363 return emitError() <<
"type and value bitwidth mismatch: "
364 << type.getWidth() <<
" != " << value.getBitWidth();
377 FailureOr<APFloat> &value,
378 cir::FPTypeInterface fpType) {
380 APFloat parsedValue(0.0);
381 if (parser.parseFloat(fpType.getFloatSemantics(), parsedValue))
384 value.emplace(parsedValue);
388FPAttr FPAttr::getZero(Type type) {
391 mlir::cast<cir::FPTypeInterface>(type).getFloatSemantics()));
394LogicalResult FPAttr::verify(function_ref<InFlightDiagnostic()> emitError,
395 cir::FPTypeInterface fpType, APFloat value) {
396 if (APFloat::SemanticsToEnum(fpType.getFloatSemantics()) !=
397 APFloat::SemanticsToEnum(value.getSemantics()))
398 return emitError() <<
"floating-point semantics mismatch";
407std::string CmpThreeWayInfoAttr::getAlias()
const {
408 std::string alias =
"cmpinfo";
410 switch (getOrdering()) {
411 case CmpOrdering::Strong:
412 alias.append(
"_strong_");
414 case CmpOrdering::Weak:
415 alias.append(
"_weak_");
417 case CmpOrdering::Partial:
418 alias.append(
"_partial_");
422 auto appendInt = [&](int64_t value) {
424 alias.push_back(
'n');
427 alias.append(std::to_string(value));
437 if (std::optional<int> unordered = getUnordered()) {
439 appendInt(unordered.value());
446CmpThreeWayInfoAttr::verify(function_ref<InFlightDiagnostic()> emitError,
447 CmpOrdering ordering, int64_t lt, int64_t eq,
448 int64_t gt, std::optional<int64_t> unordered) {
450 if ((ordering == CmpOrdering::Strong || ordering == CmpOrdering::Weak) &&
452 emitError() <<
"strong and weak ordering do not include unordered";
455 if (ordering == CmpOrdering::Partial && !unordered) {
456 emitError() <<
"partial ordering requires unordered value";
468ConstComplexAttr::verify(function_ref<InFlightDiagnostic()> emitError,
469 cir::ComplexType type, mlir::TypedAttr real,
470 mlir::TypedAttr imag) {
471 mlir::Type elemType = type.getElementType();
472 if (real.getType() != elemType)
474 <<
"type of the real part does not match the complex type";
476 if (imag.getType() != elemType)
478 <<
"type of the imaginary part does not match the complex type";
487void CUDAVarRegistrationInfoAttr::print(AsmPrinter &p)
const {
488 p <<
"<" << getDeviceSideName();
489 p <<
", " << stringifyEnum(
getKind());
499Attribute CUDAVarRegistrationInfoAttr::parse(AsmParser &parser, Type odsType) {
500 if (parser.parseLess())
503 std::string deviceSideName;
504 if (parser.parseKeywordOrString(&deviceSideName)) {
505 parser.emitError(parser.getCurrentLocation(),
506 "expected device variable name");
510 if (parser.parseComma())
515 if (parser.parseKeyword(&kindStr))
518 std::optional<CUDADeviceVarKind>
kind = symbolizeCUDADeviceVarKind(kindStr);
520 parser.emitError(parser.getCurrentLocation(),
521 "unknown device variable kind: ")
527 bool isExtern =
false;
528 bool isConstant =
false;
529 bool isManaged =
false;
531 while (parser.parseOptionalGreater().failed()) {
532 if (parser.parseComma())
536 if (parser.parseKeyword(&flag))
539 if (flag ==
"extern")
541 else if (flag ==
"constant")
543 else if (flag ==
"managed")
546 parser.emitError(parser.getCurrentLocation(),
"unknown flag: ") << flag;
551 return get(parser.getContext(), deviceSideName, *
kind, isExtern, isConstant,
560DataMemberAttr::verify(function_ref<InFlightDiagnostic()> emitError,
561 cir::DataMemberType ty,
562 mlir::DenseI32ArrayAttr memberPath) {
566 if (memberPath.empty())
567 return emitError() <<
"#cir.data_member path must not be empty";
569 mlir::Type currentTy = ty.getClassTy();
570 for (
auto [
step, idx] : llvm::enumerate(memberPath.asArrayRef())) {
571 auto recTy = mlir::dyn_cast<cir::RecordType>(currentTy);
573 return emitError() <<
"#cir.data_member path step " <<
step
574 <<
" reaches a non-record type";
576 if (recTy.isIncomplete())
579 if (idx < 0 ||
static_cast<unsigned>(idx) >= recTy.getNumElements())
580 return emitError() <<
"#cir.data_member path index " << idx <<
" at step "
581 <<
step <<
" is out of range";
583 currentTy = recTy.getMembers()[idx];
586 if (currentTy != ty.getMemberTy())
588 <<
"member type of a #cir.data_member attribute must match "
589 "the attribute type";
598LogicalResult MethodAttr::verify(function_ref<InFlightDiagnostic()> emitError,
599 cir::MethodType type,
600 std::optional<FlatSymbolRefAttr> symbol,
601 std::optional<uint64_t> vtable_offset) {
602 if (symbol.has_value() && vtable_offset.has_value())
604 <<
"at most one of symbol and vtable_offset can be present "
610Attribute MethodAttr::parse(AsmParser &parser, Type odsType) {
611 auto ty = mlir::cast<cir::MethodType>(odsType);
613 if (parser.parseLess().failed())
617 if (parser.parseOptionalKeyword(
"null").succeeded()) {
618 if (parser.parseGreater().failed())
625 FlatSymbolRefAttr symbol;
626 mlir::OptionalParseResult parseSymbolRefResult =
627 parser.parseOptionalAttribute(symbol);
628 if (parseSymbolRefResult.has_value()) {
629 if (parseSymbolRefResult.value().failed())
631 if (parser.parseGreater().failed())
633 return get(ty, symbol);
637 std::uint64_t vtableOffset = 0;
638 if (parser.parseKeyword(
"vtable_offset"))
640 if (parser.parseEqual())
642 if (parser.parseInteger(vtableOffset))
645 if (parser.parseGreater())
648 return get(ty, vtableOffset);
651void MethodAttr::print(AsmPrinter &printer)
const {
652 auto symbol = getSymbol();
653 auto vtableOffset = getVtableOffset();
656 if (symbol.has_value()) {
658 }
else if (vtableOffset.has_value()) {
659 printer <<
"vtable_offset = " << *vtableOffset;
671ConstArrayAttr::verify(function_ref<InFlightDiagnostic()> emitError, Type type,
672 Attribute elts,
int trailingZerosNum) {
674 if (!(mlir::isa<ArrayAttr, StringAttr>(elts)))
675 return emitError() <<
"constant array expects ArrayAttr or StringAttr";
677 if (
auto strAttr = mlir::dyn_cast<StringAttr>(elts)) {
678 const auto arrayTy = mlir::cast<ArrayType>(type);
679 const auto intTy = mlir::dyn_cast<IntType>(arrayTy.getElementType());
682 if (!intTy || intTy.getWidth() != 8)
684 <<
"constant array element for string literals expects "
685 "!cir.int<u, 8> element type";
689 assert(mlir::isa<ArrayAttr>(elts));
690 const auto arrayAttr = mlir::cast<mlir::ArrayAttr>(elts);
691 const auto arrayTy = mlir::cast<ArrayType>(type);
694 if (arrayAttr.size() > arrayTy.getSize())
695 return emitError() <<
"constant array has " << arrayAttr.size()
696 <<
" values but array type has size "
697 << arrayTy.getSize();
698 if (arrayTy.getSize() != arrayAttr.size() + trailingZerosNum)
699 return emitError() <<
"constant array size should match type size";
703Attribute ConstArrayAttr::parse(AsmParser &parser, Type type) {
704 mlir::FailureOr<Type> resultTy;
705 mlir::FailureOr<Attribute> resultVal;
708 if (parser.parseLess())
712 resultVal = FieldParser<Attribute>::parse(parser);
713 if (failed(resultVal)) {
715 parser.getCurrentLocation(),
716 "failed to parse ConstArrayAttr parameter 'value' which is "
717 "to be a `Attribute`");
722 if (mlir::isa<ArrayAttr>(*resultVal)) {
724 if (parser.parseOptionalColon().failed()) {
727 resultTy = FieldParser<Type>::parse(parser);
728 if (failed(resultTy)) {
730 parser.getCurrentLocation(),
731 "failed to parse ConstArrayAttr parameter 'type' which is "
732 "to be a `::mlir::Type`");
737 auto ta = mlir::cast<TypedAttr>(*resultVal);
738 resultTy = ta.getType();
739 if (mlir::isa<mlir::NoneType>(*resultTy)) {
740 parser.emitError(parser.getCurrentLocation(),
741 "expected type declaration for string literal");
747 if (parser.parseOptionalComma().succeeded()) {
748 if (parser.parseOptionalKeyword(
"trailing_zeros").succeeded()) {
749 unsigned totalSize = mlir::cast<cir::ArrayType>(type).getSize();
750 mlir::Attribute elts = resultVal.value();
751 if (
auto str = mlir::dyn_cast<mlir::StringAttr>(elts))
752 zeros = totalSize - str.size();
754 zeros = totalSize - mlir::cast<mlir::ArrayAttr>(elts).size();
761 if (parser.parseGreater())
764 return parser.getChecked<ConstArrayAttr>(parser.getCurrentLocation(),
765 parser.getContext(), type,
766 resultVal.value(), zeros);
769void ConstArrayAttr::print(AsmPrinter &printer)
const {
771 printer.printStrippedAttrOrType(getElts());
772 if (getTrailingZerosNum())
773 printer <<
", trailing_zeros";
782cir::ConstVectorAttr::verify(function_ref<InFlightDiagnostic()> emitError,
783 Type type, ArrayAttr elts) {
785 if (!mlir::isa<cir::VectorType>(type))
786 return emitError() <<
"type of cir::ConstVectorAttr is not a "
790 const auto vecType = mlir::cast<cir::VectorType>(type);
792 if (vecType.getSize() != elts.size())
794 <<
"number of constant elements should match vector size";
797 LogicalResult elementTypeCheck =
success();
798 elts.walkImmediateSubElements(
799 [&](Attribute element) {
800 if (elementTypeCheck.failed()) {
804 auto typedElement = mlir::dyn_cast<TypedAttr>(element);
806 typedElement.getType() != vecType.getElementType()) {
807 elementTypeCheck = failure();
808 emitError() <<
"constant type should match vector element type";
813 return elementTypeCheck;
820LogicalResult cir::VTableAttr::verify(
821 llvm::function_ref<mlir::InFlightDiagnostic()> emitError, mlir::Type type,
822 mlir::ArrayAttr data) {
823 auto sTy = mlir::dyn_cast_if_present<cir::RecordType>(type);
825 return emitError() <<
"expected !cir.struct or !cir.union type result";
826 if (sTy.getMembers().empty() || data.empty())
827 return emitError() <<
"expected record type with one or more subtype";
829 if (cir::ConstRecordAttr::verify(emitError, type, data).failed())
832 for (
const auto &element : data.getAsRange<mlir::Attribute>()) {
833 const auto &constArrayAttr = mlir::dyn_cast<cir::ConstArrayAttr>(element);
835 return emitError() <<
"expected constant array subtype";
837 LogicalResult eltTypeCheck =
success();
838 auto arrayElts = mlir::cast<ArrayAttr>(constArrayAttr.getElts());
839 arrayElts.walkImmediateSubElements(
840 [&](mlir::Attribute attr) {
841 if (mlir::isa<ConstPtrAttr, GlobalViewAttr>(attr))
844 eltTypeCheck = emitError()
845 <<
"expected GlobalViewAttr or ConstPtrAttr";
847 [&](mlir::Type type) {});
848 if (eltTypeCheck.failed())
858std::string DynamicCastInfoAttr::getAlias()
const {
861 std::string alias =
"dyn_cast_info_";
863 alias.append(getSrcRtti().getSymbol().getValue());
864 alias.push_back(
'_');
865 alias.append(getDestRtti().getSymbol().getValue());
870LogicalResult DynamicCastInfoAttr::verify(
871 function_ref<InFlightDiagnostic()> emitError, cir::GlobalViewAttr srcRtti,
872 cir::GlobalViewAttr destRtti, mlir::FlatSymbolRefAttr runtimeFunc,
873 mlir::FlatSymbolRefAttr badCastFunc, cir::IntAttr offsetHint) {
874 auto isRttiPtr = [](mlir::Type ty) {
877 auto ptrTy = mlir::dyn_cast<cir::PointerType>(ty);
881 auto pointeeIntTy = mlir::dyn_cast<cir::IntType>(ptrTy.getPointee());
885 return pointeeIntTy.isUnsigned() && pointeeIntTy.getWidth() == 8;
888 if (!isRttiPtr(srcRtti.getType()))
889 return emitError() <<
"srcRtti must be an RTTI pointer";
891 if (!isRttiPtr(destRtti.getType()))
892 return emitError() <<
"destRtti must be an RTTI pointer";
902 mlir::StringAttr name) {
903 auto dict =
module->getAttrOfType<mlir::DictionaryAttr>(
904 CIRDialect::getRecordLayoutsAttrName());
905 assert(dict &&
"module missing cir.record_layouts attribute");
906 auto attr = dict.getAs<RecordLayoutAttr>(name);
907 assert(attr &&
"record layout entry missing for named record");
915void CIRDialect::registerAttributes() {
917#define GET_ATTRDEF_LIST
918#include "clang/CIR/Dialect/IR/CIROpsAttributes.cpp.inc"
static mlir::ParseResult parseFloatLiteral(mlir::AsmParser &parser, mlir::FailureOr< llvm::APFloat > &value, cir::FPTypeInterface fpType)
void printAddressSpaceValue(mlir::AsmPrinter &p, cir::LangAddressSpace addrSpace)
static void printConstPtr(mlir::AsmPrinter &p, mlir::IntegerAttr value)
static void printRecordMembers(mlir::AsmPrinter &p, mlir::ArrayAttr members)
static mlir::ParseResult parseIntLiteral(mlir::AsmParser &parser, llvm::APInt &value, cir::IntTypeInterface ty)
static void printIntLiteral(mlir::AsmPrinter &p, llvm::APInt value, cir::IntTypeInterface ty)
static mlir::ParseResult parseConstPtr(mlir::AsmParser &parser, mlir::IntegerAttr &value)
static void printFloatLiteral(mlir::AsmPrinter &p, llvm::APFloat value, mlir::Type ty)
static mlir::ParseResult parseDataMemberPath(mlir::AsmParser &parser, mlir::DenseI32ArrayAttr &memberPath)
static void printDataMemberPath(mlir::AsmPrinter &p, mlir::DenseI32ArrayAttr memberPath)
static mlir::ParseResult parseRecordMembers(mlir::AsmParser &parser, mlir::ArrayAttr &members)
mlir::ParseResult parseAddressSpaceValue(mlir::AsmParser &p, cir::LangAddressSpace &addrSpace)
static Decl::Kind getKind(const Decl *D)
*collection of selector each with an associated kind and an ordered *collection of selectors A selector has a kind
RecordLayoutAttr getRecordLayout(mlir::ModuleOp module, mlir::StringAttr name)
Look up the RecordLayoutAttr for a named record in the module's cir.record_layouts dictionary.
float __ovld __cnfn step(float, float)
Returns 0.0 if x < edge, otherwise it returns 1.0.