9#ifndef LLVM_CLANG_CIR_DIALECT_BUILDER_CIRBASEBUILDER_H
10#define LLVM_CLANG_CIR_DIALECT_BUILDER_CIRBASEBUILDER_H
19#include "llvm/ADT/BitmaskEnum.h"
20#include "llvm/IR/FPEnv.h"
21#include "llvm/Support/ErrorHandling.h"
23#include "mlir/Dialect/Ptr/IR/MemorySpaceInterfaces.h"
24#include "mlir/IR/Builders.h"
25#include "mlir/IR/BuiltinAttributes.h"
26#include "mlir/IR/Location.h"
27#include "mlir/IR/OperationSupport.h"
28#include "mlir/IR/Types.h"
48 :
mlir::OpBuilder(&mlirContext) {}
65 llvm::RoundingMode::NearestTiesToEven;
69 const llvm::APInt &val) {
70 return cir::ConstantOp::create(*
this, loc, cir::IntAttr::get(typ, val));
73 cir::ConstantOp
getConstant(mlir::Location loc, mlir::TypedAttr attr) {
74 return cir::ConstantOp::create(*
this, loc, attr);
79 return getConstant(loc, cir::IntAttr::get(ty, value));
83 auto type = cir::IntType::get(getContext(), numBits,
true);
85 llvm::APInt(numBits, val,
true));
90 auto type = cir::IntType::get(getContext(), numBits,
false);
100 assert(mlir::isa<cir::PointerType>(t) &&
"expected cir.ptr");
105 return cir::DataMemberAttr::get(ty);
109 if (
auto bitFieldTy = mlir::dyn_cast<cir::BitFieldType>(ty)) {
110 assert(bitFieldTy.ownsBytes() &&
111 "a zero-width bit-field takes no initializer");
114 if (mlir::isa<cir::IntType>(ty))
115 return cir::IntAttr::get(ty, 0);
116 if (cir::isAnyFloatingPointType(ty))
117 return cir::FPAttr::getZero(ty);
118 if (cir::isAnyOpaqueFloatingPointType(ty))
119 return cir::ZeroAttr::get(ty);
120 if (
auto complexType = mlir::dyn_cast<cir::ComplexType>(ty))
121 return cir::ZeroAttr::get(complexType);
122 if (
auto arrTy = mlir::dyn_cast<cir::ArrayType>(ty))
123 return cir::ZeroAttr::get(arrTy);
124 if (
auto vecTy = mlir::dyn_cast<cir::VectorType>(ty))
125 return cir::ZeroAttr::get(vecTy);
126 if (
auto matrixTy = mlir::dyn_cast<cir::MatrixType>(ty))
127 return cir::ZeroAttr::get(matrixTy);
128 if (
auto ptrTy = mlir::dyn_cast<cir::PointerType>(ty))
130 if (
auto recordTy = mlir::dyn_cast<cir::RecordType>(ty))
131 return cir::ZeroAttr::get(recordTy);
132 if (
auto dataMemberTy = mlir::dyn_cast<cir::DataMemberType>(ty))
134 if (
auto methodTy = mlir::dyn_cast<cir::MethodType>(ty))
136 if (
auto vptrTy = mlir::dyn_cast<cir::VPtrType>(ty))
137 return cir::ZeroAttr::get(vptrTy);
138 if (mlir::isa<cir::BoolType>(ty)) {
142 llvm_unreachable(
"Zero initializer for given type is NYI");
145 cir::ConstantOp
getBool(
bool state, mlir::Location loc) {
146 return cir::ConstantOp::create(*
this, loc,
getCIRBoolAttr(state));
151 cir::BoolType
getBoolTy() {
return cir::BoolType::get(getContext()); }
152 cir::VoidType
getVoidTy() {
return cir::VoidType::get(getContext()); }
155 return cir::IntType::get(getContext(), n,
false);
159 if (
auto intType = mlir::dyn_cast<cir::IntTypeInterface>(eltTy))
160 return intType.getWidth();
161 if (
auto floatType = mlir::dyn_cast<cir::FPTypeInterface>(eltTy))
162 return floatType.getWidth();
164 llvm_unreachable(
"Unsupported type in getCIRIntOrFloatBitWidth");
167 return cir::IntType::get(getContext(), n,
true);
171 return cir::PointerType::get(ty);
175 mlir::ptr::MemorySpaceAttrInterface as) {
176 return cir::PointerType::get(ty, as);
183 mlir::ptr::MemorySpaceAttrInterface addrSpaceAttr =
189 return getPointerTo(cir::VoidType::get(getContext()), langAS);
192 cir::PointerType
getVoidPtrTy(mlir::ptr::MemorySpaceAttrInterface as) {
193 return getPointerTo(cir::VoidType::get(getContext()), as);
196 cir::MethodAttr
getMethodAttr(cir::MethodType ty, cir::FuncOp methodFuncOp) {
197 auto methodFuncSymbolRef = mlir::FlatSymbolRefAttr::get(methodFuncOp);
198 return cir::MethodAttr::get(ty, methodFuncSymbolRef);
202 return cir::MethodAttr::get(ty);
206 return cir::BoolAttr::get(getContext(), state);
256 return cir::FastMathFlagsAttr::get(getContext(),
fastMathFlags);
268 cir::FPDynamicRoundingMode roundingMode;
270 case llvm::RoundingMode::NearestTiesToEven:
271 roundingMode = cir::FPDynamicRoundingMode::ToNearest;
273 case llvm::RoundingMode::TowardNegative:
274 roundingMode = cir::FPDynamicRoundingMode::Downward;
276 case llvm::RoundingMode::TowardPositive:
277 roundingMode = cir::FPDynamicRoundingMode::Upward;
279 case llvm::RoundingMode::TowardZero:
280 roundingMode = cir::FPDynamicRoundingMode::UpwardZero;
282 case llvm::RoundingMode::NearestTiesToAway:
283 roundingMode = cir::FPDynamicRoundingMode::ToNearestAway;
285 case llvm::RoundingMode::Dynamic:
286 roundingMode = cir::FPDynamicRoundingMode::Unknown;
289 llvm_unreachable(
"unexpected constrained rounding mode");
292 cir::FPExceptionMode exceptMode;
296 exceptMode = cir::FPExceptionMode::Masked;
297 strictExcept =
false;
300 exceptMode = cir::FPExceptionMode::Unknown;
301 strictExcept =
false;
304 exceptMode = cir::FPExceptionMode::Unknown;
308 llvm_unreachable(
"unexpected constrained exception mode");
311 return cir::FenvAttr::get(getContext(), roundingMode, exceptMode,
312 mlir::BoolAttr::get(getContext(), strictExcept));
317 auto resultComplexTy = cir::ComplexType::get(real.getType());
318 return cir::ComplexCreateOp::create(*
this, loc, resultComplexTy, real,
323 auto resultType = operand.getType();
324 if (
auto complexResultType = mlir::dyn_cast<cir::ComplexType>(resultType))
325 resultType = complexResultType.getElementType();
326 return cir::ComplexRealOp::create(*
this, loc, resultType, operand);
330 auto resultType = operand.getType();
331 if (
auto complexResultType = mlir::dyn_cast<cir::ComplexType>(resultType))
332 resultType = complexResultType.getElementType();
333 return cir::ComplexImagOp::create(*
this, loc, resultType, operand);
338 auto complexTy = mlir::cast<cir::ComplexType>(lhs.getType());
339 if (cir::isAnyFloatingPointType(complexTy.getElementType())) {
341 return cir::ComplexFAddOp::create(*
this, loc, lhs, rhs, fenv);
343 return cir::ComplexAddOp::create(*
this, loc, lhs, rhs);
348 auto complexTy = mlir::cast<cir::ComplexType>(lhs.getType());
349 if (cir::isAnyFloatingPointType(complexTy.getElementType())) {
351 return cir::ComplexFSubOp::create(*
this, loc, lhs, rhs, fenv);
353 return cir::ComplexSubOp::create(*
this, loc, lhs, rhs);
358 cir::ComplexRangeKind rangeKind) {
359 auto complexTy = mlir::cast<cir::ComplexType>(lhs.getType());
360 if (cir::isAnyFloatingPointType(complexTy.getElementType()))
361 return cir::ComplexFMulOp::create(*
this, loc, lhs, rhs, rangeKind);
362 return cir::ComplexMulOp::create(*
this, loc, lhs, rhs);
367 cir::ComplexRangeKind rangeKind) {
368 auto complexTy = mlir::cast<cir::ComplexType>(lhs.getType());
369 if (cir::isAnyFloatingPointType(complexTy.getElementType()))
370 return cir::ComplexFDivOp::create(*
this, loc, lhs, rhs, rangeKind);
371 return cir::ComplexDivOp::create(*
this, loc, lhs, rhs);
375 return cir::ComplexConjOp::create(*
this, loc, operand.getType(), operand);
379 bool isVolatile =
false,
uint64_t alignment = 0,
380 bool isNontemporal =
false) {
382 return cir::LoadOp::create(*
this, loc, ptr,
false, isVolatile,
383 isNontemporal, alignmentAttr,
384 cir::SyncScopeKindAttr{}, cir::MemOrderAttr{},
390 return createLoad(loc, ptr,
false, alignment);
393 mlir::Value
createNot(mlir::Location loc, mlir::Value value) {
394 return cir::NotOp::create(*
this, loc, value);
404 llvm::function_ref<
void(mlir::OpBuilder &, mlir::Location)> condBuilder,
405 llvm::function_ref<
void(mlir::OpBuilder &, mlir::Location)> bodyBuilder) {
406 return cir::DoWhileOp::create(*
this, loc, condBuilder, bodyBuilder);
412 llvm::function_ref<
void(mlir::OpBuilder &, mlir::Location)> condBuilder,
413 llvm::function_ref<
void(mlir::OpBuilder &, mlir::Location)> bodyBuilder) {
414 return cir::WhileOp::create(*
this, loc, condBuilder, bodyBuilder);
420 llvm::function_ref<
void(mlir::OpBuilder &, mlir::Location)> condBuilder,
421 llvm::function_ref<
void(mlir::OpBuilder &, mlir::Location)> bodyBuilder,
422 llvm::function_ref<
void(mlir::OpBuilder &, mlir::Location)>
424 cir::CleanupKind cleanupKind) {
425 return cir::WhileOp::create(*
this, loc, condBuilder, bodyBuilder,
426 cleanupBuilder, cleanupKind);
432 llvm::function_ref<
void(mlir::OpBuilder &, mlir::Location)> condBuilder,
433 llvm::function_ref<
void(mlir::OpBuilder &, mlir::Location)> bodyBuilder,
434 llvm::function_ref<
void(mlir::OpBuilder &, mlir::Location)> stepBuilder) {
435 return cir::ForOp::create(*
this, loc, condBuilder, bodyBuilder,
442 llvm::function_ref<
void(mlir::OpBuilder &, mlir::Location)> condBuilder,
443 llvm::function_ref<
void(mlir::OpBuilder &, mlir::Location)> bodyBuilder,
444 llvm::function_ref<
void(mlir::OpBuilder &, mlir::Location)> stepBuilder,
445 llvm::function_ref<
void(mlir::OpBuilder &, mlir::Location)>
447 cir::CleanupKind cleanupKind) {
448 return cir::ForOp::create(*
this, loc, condBuilder, bodyBuilder, stepBuilder,
449 cleanupBuilder, cleanupKind);
454 return cir::BreakOp::create(*
this, loc);
459 return cir::ContinueOp::create(*
this, loc);
462 mlir::Value
createInc(mlir::Location loc, mlir::Value input,
464 return cir::IncOp::create(*
this, loc, input, nsw);
467 mlir::Value
createDec(mlir::Location loc, mlir::Value input,
469 return cir::DecOp::create(*
this, loc, input, nsw);
474 return cir::MinusOp::create(*
this, loc, input, nsw);
478 return cir::ConstPtrAttr::get(type, getI64IntegerAttr(value));
481 mlir::Value
createAlloca(mlir::Location loc, cir::PointerType addrType,
482 llvm::StringRef name, mlir::IntegerAttr alignment,
483 mlir::Value dynAllocSize) {
484 return cir::AllocaOp::create(*
this, loc, addrType, name, alignment,
488 mlir::Value
createAlloca(mlir::Location loc, cir::PointerType addrType,
489 mlir::Type type, llvm::StringRef name,
491 mlir::Value dynAllocSize) {
493 return createAlloca(loc, addrType, name, alignmentAttr, dynAllocSize);
496 mlir::Value
createAlloca(mlir::Location loc, cir::PointerType addrType,
497 llvm::StringRef name, mlir::IntegerAttr alignment) {
498 return cir::AllocaOp::create(*
this, loc, addrType, name, alignment);
501 mlir::Value
createAlloca(mlir::Location loc, cir::PointerType addrType,
504 return createAlloca(loc, addrType, name, alignmentAttr);
510 mlir::ArrayAttr indices = {}) {
511 cir::PointerType type =
getPointerTo(globalOp.getSymType());
517 cir::GlobalOp globalOp,
518 mlir::ArrayAttr indices = {},
519 bool addressPoint =
false) {
520 auto symbol = mlir::FlatSymbolRefAttr::get(globalOp.getSymNameAttr());
521 return cir::GlobalViewAttr::get(type, symbol, indices, addressPoint);
527 cir::GlobalOp globalOp,
529 bool addressPoint =
false) {
532 attrs.push_back(getI64IntegerAttr(ind));
533 mlir::ArrayAttr arAttr = mlir::ArrayAttr::get(getContext(), attrs);
538 bool threadLocal =
false) {
539 return cir::GetGlobalOp::create(
541 getPointerTo(global.getSymType(), global.getAddrSpaceAttr()),
542 global.getSymNameAttr(), threadLocal);
546 bool threadLocal =
false) {
552 bool isVolatile =
false,
553 bool skipTailPadding =
false) {
554 return cir::CopyOp::create(*
this, dst.getLoc(), dst, src,
556 isVolatile, skipTailPadding);
559 cir::StoreOp
createStore(mlir::Location loc, mlir::Value val, mlir::Value dst,
560 bool isVolatile =
false,
bool isNontemporal =
false,
561 mlir::IntegerAttr align = {},
562 cir::SyncScopeKindAttr scope = {},
563 cir::MemOrderAttr order = {},
564 cir::TBAATagAttr tbaa = {}) {
565 if (mlir::cast<cir::PointerType>(dst.getType()).getPointee() !=
568 return cir::StoreOp::create(*
this, loc, val, dst, isVolatile, isNontemporal,
569 align, scope, order, tbaa);
575 if (boolTy != mlir::cast<cir::PointerType>(addr.getType()).getPointee())
581 mlir::Value flag =
getBool(val, loc);
585 [[nodiscard]] cir::GlobalOp
587 mlir::StringRef name, mlir::Type type,
bool isConstant,
588 cir::GlobalLinkageKind linkage,
589 mlir::ptr::MemorySpaceAttrInterface addrSpace) {
590 mlir::OpBuilder::InsertionGuard guard(*
this);
591 setInsertionPointToStart(mlirModule.getBody());
592 return cir::GlobalOp::create(*
this, loc, name, type, isConstant, addrSpace,
597 mlir::Value base, llvm::StringRef name,
599 return cir::GetMemberOp::create(*
this, loc, resultTy, base, name, index);
606 return cir::LoadOp::create(*
this, loc, addr,
false,
614 mlir::Value stride) {
615 return cir::PtrStrideOp::create(*
this, loc, base.getType(), base, stride);
622 cir::CallOp
createCallOp(mlir::Location loc, mlir::SymbolRefAttr callee,
623 mlir::Type returnType, mlir::ValueRange operands,
627 cir::CallingConv callingConv = cir::CallingConv::C) {
628 auto op = cir::CallOp::create(*
this, loc, callee, returnType, operands);
630 if (callingConv != cir::CallingConv::C)
631 op.setCallingConv(callingConv);
633 if (!argAttrs.empty()) {
634 llvm::SmallVector<mlir::Attribute> argDictAttrs;
635 argDictAttrs.reserve(argAttrs.size());
638 argAttrs, std::back_inserter(argDictAttrs),
639 [
this](llvm::ArrayRef<mlir::NamedAttribute> singleArgAttrs) {
640 return mlir::DictionaryAttr::get(getContext(), singleArgAttrs);
643 op.setArgAttrsAttr(mlir::ArrayAttr::get(getContext(), argDictAttrs));
646 if (!resAttrs.empty()) {
647 auto resultDictAttr = mlir::DictionaryAttr::get(getContext(), resAttrs);
648 op.setResAttrsAttr(mlir::ArrayAttr::get(getContext(), resultDictAttr));
654 mlir::ValueRange operands,
658 cir::CallingConv callingConv = cir::CallingConv::C) {
659 return createCallOp(loc, mlir::SymbolRefAttr::get(callee),
660 callee.getFunctionType().getReturnType(), operands,
661 attrs, argAttrs, resAttrs, callingConv);
666 cir::FuncType funcType, mlir::ValueRange operands,
670 cir::CallingConv callingConv = cir::CallingConv::C) {
671 llvm::SmallVector<mlir::Value> resOperands{indirectTarget};
672 resOperands.append(operands.begin(), operands.end());
674 return createCallOp(loc, mlir::SymbolRefAttr(), funcType.getReturnType(),
675 resOperands, attrs, argAttrs, resAttrs, callingConv);
678 cir::CallOp
createCallOp(mlir::Location loc, mlir::SymbolRefAttr callee,
679 mlir::ValueRange operands = mlir::ValueRange(),
683 return createCallOp(loc, callee, cir::VoidType(), operands, attrs, argAttrs,
692 mlir::Value src, mlir::Type newTy) {
693 if (newTy == src.getType())
695 return cir::CastOp::create(*
this, loc, newTy,
kind, src);
700 if (newTy == src.getType())
707 if (newTy == src.getType())
715 return createCast(cir::CastKind::integral, src, newTy);
720 return cir::BuiltinIntCastOp::create(*
this, loc, newTy, src);
730 auto cirIntTy = mlir::cast<cir::IntType>(src.getType());
735 return createCast(cir::CastKind::int_to_ptr, src, newTy);
739 return createCast(cir::CastKind::ptr_to_int, src, newTy);
747 return createCast(cir::CastKind::bool_to_int, src, newTy);
751 return createCast(cir::CastKind::bitcast, src, newTy);
756 return createCast(loc, cir::CastKind::bitcast, src, newTy);
760 assert(mlir::isa<cir::PointerType>(src.getType()) &&
"expected ptr src");
761 cir::PointerType srcPtrTy = mlir::cast<cir::PointerType>(src.getType());
767 mlir::Value nullPtr =
getNullPtr(ptr.getType(), ptr.getLoc());
768 return createCompare(ptr.getLoc(), cir::CmpOpKind::eq, ptr, nullPtr);
772 mlir::Value nullPtr =
getNullPtr(ptr.getType(), ptr.getLoc());
773 return createCompare(ptr.getLoc(), cir::CmpOpKind::ne, ptr, nullPtr);
778 return createCast(loc, cir::CastKind::address_space, src, newTy);
791 assert(idxTy.isFundamental() &&
792 "vector index must have a fundamental integer type");
794 getConstAPInt(loc, idxTy, llvm::APInt(idxTy.getWidth(), idx));
795 return cir::VecExtractOp::create(*
this, loc, vec, idxVal);
800 return cir::VecExtractOp::create(*
this, loc, vec, idx);
804 mlir::Value newElt, cir::IntType idxTy,
806 assert(idxTy.isFundamental() &&
807 "vector index must have a fundamental integer type");
809 getConstAPInt(loc, idxTy, llvm::APInt(idxTy.getWidth(), idx));
810 return cir::VecInsertOp::create(*
this, loc, vec, newElt, idxVal);
814 mlir::Value newElt, mlir::Value idx) {
815 return cir::VecInsertOp::create(*
this, loc, vec, newElt, idx);
819 auto resTy = cir::BoolType::get(getContext());
820 return cir::SignBitOp::create(*
this, loc, resTy, val);
829 llvm::APInt val = llvm::APInt::getLowBitsSet(size, bits);
830 auto type = cir::IntType::get(getContext(), size,
false);
834 mlir::Value
createAnd(mlir::Location loc, mlir::Value lhs, mlir::Value rhs) {
835 return cir::AndOp::create(*
this, loc, lhs, rhs);
838 mlir::Value
createOr(mlir::Location loc, mlir::Value lhs, mlir::Value rhs) {
839 return cir::OrOp::create(*
this, loc, lhs, rhs);
843 mlir::Value trueValue, mlir::Value falseValue) {
844 assert(trueValue.getType() == falseValue.getType() &&
845 "trueValue and falseValue should have the same type");
846 return cir::SelectOp::create(*
this, loc, trueValue.getType(),
condition,
847 trueValue, falseValue);
860 mlir::Value
createMul(mlir::Location loc, mlir::Value lhs, mlir::Value rhs,
861 OverflowFlags flags = OverflowFlags::None) {
862 return cir::MulOp::create(*
this, loc, lhs, rhs, flags);
866 return createMul(loc, lhs, rhs, OverflowFlags::NoSignedWrap);
870 return createMul(loc, lhs, rhs, OverflowFlags::NoUnsignedWrap);
875 return cir::AddSatOp::create(*
this, loc, lhs, rhs);
880 return cir::SubSatOp::create(*
this, loc, lhs, rhs);
883 mlir::Value
createSub(mlir::Location loc, mlir::Value lhs, mlir::Value rhs,
884 OverflowFlags flags = OverflowFlags::None) {
885 return cir::SubOp::create(*
this, loc, lhs, rhs, flags);
890 return createSub(loc, lhs, rhs, OverflowFlags::NoSignedWrap);
895 return createSub(loc, lhs, rhs, OverflowFlags::NoUnsignedWrap);
898 mlir::Value
createAdd(mlir::Location loc, mlir::Value lhs, mlir::Value rhs,
899 OverflowFlags flags = OverflowFlags::None) {
900 return cir::AddOp::create(*
this, loc, lhs, rhs, flags);
905 return createAdd(loc, lhs, rhs, OverflowFlags::NoSignedWrap);
910 return createAdd(loc, lhs, rhs, OverflowFlags::NoUnsignedWrap);
913 mlir::Value
createDiv(mlir::Location loc, mlir::Value lhs, mlir::Value rhs) {
914 return cir::DivOp::create(*
this, loc, lhs, rhs);
917 mlir::Value
createRem(mlir::Location loc, mlir::Value lhs, mlir::Value rhs) {
918 return cir::RemOp::create(*
this, loc, lhs, rhs);
921 template <
typename OpTy>
929 mlir::Value
createFAdd(mlir::Location loc, mlir::Value lhs, mlir::Value rhs) {
933 mlir::Value
createFSub(mlir::Location loc, mlir::Value lhs, mlir::Value rhs) {
937 mlir::Value
createFMul(mlir::Location loc, mlir::Value lhs, mlir::Value rhs) {
941 mlir::Value
createFDiv(mlir::Location loc, mlir::Value lhs, mlir::Value rhs) {
945 mlir::Value
createFRem(mlir::Location loc, mlir::Value lhs, mlir::Value rhs) {
949 mlir::Value
createFNeg(mlir::Location loc, mlir::Value operand) {
950 assert(cir::isFPOrVectorOfFPType(operand.getType()) &&
951 "expected floating-point or vector-of-float type");
958 mlir::Value
createXor(mlir::Location loc, mlir::Value lhs, mlir::Value rhs) {
959 return cir::XorOp::create(*
this, loc, lhs, rhs);
962 mlir::Value
createMax(mlir::Location loc, mlir::Value lhs, mlir::Value rhs) {
963 return cir::MaxOp::create(*
this, loc, lhs, rhs);
966 mlir::Value
createMin(mlir::Location loc, mlir::Value lhs, mlir::Value rhs) {
967 return cir::MinOp::create(*
this, loc, lhs, rhs);
971 mlir::Value lhs, mlir::Value rhs) {
973 if (cir::isAnyFloatingPointType(lhs.getType()))
975 return cir::CmpOp::create(*
this, loc,
kind, lhs, rhs, fenv);
979 mlir::Value lhs, mlir::Value rhs,
980 bool signaling =
false) {
983 return cir::FCmpOp::create(*
this, loc,
kind, lhs, rhs, signaling, fenv);
989 mlir::Value lhs, mlir::Value rhs) {
990 VectorType vecCast = mlir::cast<VectorType>(lhs.getType());
991 mlir::Type elemTy = vecCast.getElementType();
995 cir::VectorType::get(integralTy, vecCast.getSize(), vecCast.getKind()),
1004 cir::CmpOpKind
kind, mlir::Value lhs,
1006 assert(mlir::cast<VectorType>(lhs.getType()).getSize() ==
1007 resultTy.getSize() &&
1008 cir::isIntOrBoolType(resultTy.getElementType()) &&
1009 "vector compare result must be an int or bool vector of the "
1011 return cir::VecCmpOp::create(*
this, loc, resultTy,
kind, lhs, rhs);
1019 mlir::Value lhs, mlir::Value rhs,
1020 bool signaling =
false) {
1021 VectorType vecCast = mlir::cast<VectorType>(lhs.getType());
1022 mlir::Type elemTy = vecCast.getElementType();
1023 assert(!(mlir::isa<cir::FPTypeInterface>(elemTy) &&
1024 &mlir::cast<cir::FPTypeInterface>(elemTy).getFloatSemantics() ==
1025 &llvm::APFloat::x87DoubleExtended()) &&
1026 "an FP80 vector compare must name its result type");
1029 cir::VectorType::get(integralTy, vecCast.getSize(), vecCast.getKind());
1030 return cir::VecFCmpOp::create(*
this, loc, resTy,
kind, lhs, rhs, signaling,
1039 cir::FCmpOpKind
kind, mlir::Value lhs,
1040 mlir::Value rhs,
bool signaling =
false) {
1041 assert(mlir::cast<VectorType>(lhs.getType()).getSize() ==
1042 resultTy.getSize() &&
1043 cir::isIntOrBoolType(resultTy.getElementType()) &&
1044 "vector compare result must be an int or bool vector of the "
1046 return cir::VecFCmpOp::create(*
this, loc, resultTy,
kind, lhs, rhs,
1051 return createFCompare(loc, cir::FCmpOpKind::uno, operand, operand);
1054 mlir::Value
createShift(mlir::Location loc, mlir::Value lhs, mlir::Value rhs,
1056 return cir::ShiftOp::create(*
this, loc, lhs.getType(), lhs, rhs,
1061 const llvm::APInt &rhs,
bool isShiftLeft) {
1066 mlir::Value
createShift(mlir::Location loc, mlir::Value lhs,
unsigned bits,
1068 auto width = mlir::dyn_cast<cir::IntType>(lhs.getType()).getWidth();
1069 auto shift = llvm::APInt(width, bits);
1095 return cir::FuncType::get(llvm::to_vector(argTypes),
getVoidTy());
1109 std::find_if(block->rbegin(), block->rend(), [](mlir::Operation &op) {
1110 return mlir::isa<cir::AllocaOp, cir::LabelOp>(&op);
1113 if (last != block->rend())
1114 return OpBuilder::InsertPoint(block, ++mlir::Block::iterator(&*last));
1115 return OpBuilder::InsertPoint(block, block->begin());
1136 return alignment ? getI64IntegerAttr(alignment) : mlir::IntegerAttr();
1162 cir::YieldOp
createYield(mlir::Location loc, mlir::ValueRange value = {}) {
1163 return cir::YieldOp::create(*
this, loc, value);
1172 mlir::Value objectPtr) {
1175 mlir::cast<cir::MethodType>(method.getType()).getMemberFuncTy();
1176 auto methodFuncInputTypes = methodFuncTy.getInputs();
1178 auto objectPtrTy = mlir::cast<cir::PointerType>(objectPtr.getType());
1179 mlir::Type adjustedThisTy =
getVoidPtrTy(objectPtrTy.getAddrSpace());
1184 if (methodFuncInputTypes.size() > 1)
1185 calleeFuncInputTypes.insert(calleeFuncInputTypes.end(),
1186 methodFuncInputTypes.begin() + 1,
1187 methodFuncInputTypes.end());
1188 cir::FuncType calleeFuncTy =
1189 methodFuncTy.clone(calleeFuncInputTypes, methodFuncTy.getReturnType());
1192 cir::PointerType calleeTy =
getPointerTo(calleeFuncTy);
1194 auto op = cir::GetMethodOp::create(*
this, loc, calleeTy, adjustedThisTy,
1196 cir::TBAATagAttr());
1197 return {op.getCallee(), op.getAdjustedThis()};
Provides definitions for the various language-specific address spaces.
Defines the clang::LangOptions interface.
*collection of selector each with an associated kind and an ordered *collection of selectors A selector has a an optional score condition
*collection of selector each with an associated kind and an ordered *collection of selectors A selector has a kind
mlir::FloatType getTF32Type()=delete
cir::VecFCmpOp createVecFCompare(mlir::Location loc, VectorType resultTy, cir::FCmpOpKind kind, mlir::Value lhs, mlir::Value rhs, bool signaling=false)
Compares lhs and rhs element-wise, producing resultTy, which must be a vector of integers or bools wi...
mlir::Value createNSWSub(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
cir::ConstantOp getBool(bool state, mlir::Location loc)
mlir::Value createShift(mlir::Location loc, mlir::Value lhs, unsigned bits, bool isShiftLeft)
cir::StoreOp createFlagStore(mlir::Location loc, bool val, mlir::Value dst)
cir::WhileOp createWhile(mlir::Location loc, llvm::function_ref< void(mlir::OpBuilder &, mlir::Location)> condBuilder, llvm::function_ref< void(mlir::OpBuilder &, mlir::Location)> bodyBuilder)
Create a while operation.
mlir::Value createDiv(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
mlir::Value createAdd(mlir::Location loc, mlir::Value lhs, mlir::Value rhs, OverflowFlags flags=OverflowFlags::None)
mlir::Value createAlloca(mlir::Location loc, cir::PointerType addrType, llvm::StringRef name, mlir::IntegerAttr alignment)
mlir::Value createComplexMul(mlir::Location loc, mlir::Value lhs, mlir::Value rhs, cir::ComplexRangeKind rangeKind)
cir::VecCmpOp createVecCompare(mlir::Location loc, VectorType resultTy, cir::CmpOpKind kind, mlir::Value lhs, mlir::Value rhs)
Compares lhs and rhs element-wise, producing resultTy, which must be a vector of integers or bools wi...
cir::BreakOp createBreak(mlir::Location loc)
Create a break operation.
mlir::TypedAttr getConstNullPtrAttr(mlir::Type t)
cir::FenvAttr getConstrainedFPAttr()
Build the #cir.fenv attribute describing the constrained floating-point environment currently in effe...
cir::PointerType getVoidPtrTy(mlir::ptr::MemorySpaceAttrInterface as)
mlir::IntegerAttr getAlignmentAttr(int64_t alignment)
mlir::Value createDec(mlir::Location loc, mlir::Value input, bool nsw=false)
mlir::Value createShift(mlir::Location loc, mlir::Value lhs, const llvm::APInt &rhs, bool isShiftLeft)
mlir::Value getConstAPInt(mlir::Location loc, mlir::Type typ, const llvm::APInt &val)
mlir::Value createBuiltinIntCast(mlir::Value src, mlir::Type newTy)
mlir::Value createCast(cir::CastKind kind, mlir::Value src, mlir::Type newTy)
mlir::Value createLogicalOr(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
mlir::Value createShift(mlir::Location loc, mlir::Value lhs, mlir::Value rhs, bool isShiftLeft)
mlir::Value createSub(mlir::Location loc, mlir::Value lhs, mlir::Value rhs, OverflowFlags flags=OverflowFlags::None)
cir::ConditionOp createCondition(mlir::Value condition)
Create a loop condition.
clang::LangOptions::FPExceptionModeKind getDefaultConstrainedExcept() const
Get the exception handling used with constrained floating point.
mlir::Value createLowBitsSet(mlir::Location loc, unsigned size, unsigned bits)
mlir::Value createInc(mlir::Location loc, mlir::Value input, bool nsw=false)
cir::CopyOp createCopy(mlir::Value dst, mlir::Value src, bool isVolatile=false, bool skipTailPadding=false)
Create a copy with inferred length.
mlir::Value createNSWAdd(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
cir::GlobalViewAttr getGlobalViewAttr(cir::GlobalOp globalOp, mlir::ArrayAttr indices={})
Get constant address of a global variable as an MLIR attribute.
cir::FCmpOp createFCompare(mlir::Location loc, cir::FCmpOpKind kind, mlir::Value lhs, mlir::Value rhs, bool signaling=false)
cir::MethodAttr getMethodAttr(cir::MethodType ty, cir::FuncOp methodFuncOp)
cir::FastMathFlags getFastMathFlags() const
Get the fast-math flags attached to floating-point operations.
cir::VoidType getVoidTy()
cir::ConstantOp getNullValue(mlir::Type ty, mlir::Location loc)
cir::BoolAttr getCIRBoolAttr(bool state)
mlir::Value createBoolToInt(mlir::Value src, mlir::Type newTy)
cir::ConstantOp getConstant(mlir::Location loc, mlir::TypedAttr attr)
cir::MethodAttr getNullMethodAttr(cir::MethodType ty)
mlir::Value createNUWAdd(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
mlir::Value createOr(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
mlir::FloatType getF80Type()=delete
mlir::Value createPtrIsNull(mlir::Value ptr)
mlir::Value createShiftLeft(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
mlir::Value createBuiltinIntCast(mlir::Location loc, mlir::Value src)
Casts src to the builtin MLIR integer type with the same width as its own CIR integer type.
mlir::Value createFPBinOp(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
cir::SignBitOp createSignBit(mlir::Location loc, mlir::Value val)
mlir::Value createInsertElement(mlir::Location loc, mlir::Value vec, mlir::Value newElt, cir::IntType idxTy, uint64_t idx)
mlir::Value createCast(mlir::Location loc, cir::CastKind kind, mlir::Value src, mlir::Type newTy)
mlir::IntegerAttr getSizeFromCharUnits(clang::CharUnits size)
cir::PointerType getVoidFnPtrTy(mlir::TypeRange argTypes={})
Returns void (*)(T...) as a cir::PointerType.
cir::ForOp createFor(mlir::Location loc, llvm::function_ref< void(mlir::OpBuilder &, mlir::Location)> condBuilder, llvm::function_ref< void(mlir::OpBuilder &, mlir::Location)> bodyBuilder, llvm::function_ref< void(mlir::OpBuilder &, mlir::Location)> stepBuilder, llvm::function_ref< void(mlir::OpBuilder &, mlir::Location)> cleanupBuilder, cir::CleanupKind cleanupKind)
Create a for operation with a per-iteration cleanup region.
cir::PtrStrideOp createPtrStride(mlir::Location loc, mlir::Value base, mlir::Value stride)
mlir::Value createIntToPtr(mlir::Value src, mlir::Type newTy)
mlir::Value createRem(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
cir::ForOp createFor(mlir::Location loc, llvm::function_ref< void(mlir::OpBuilder &, mlir::Location)> condBuilder, llvm::function_ref< void(mlir::OpBuilder &, mlir::Location)> bodyBuilder, llvm::function_ref< void(mlir::OpBuilder &, mlir::Location)> stepBuilder)
Create a for operation.
cir::GlobalViewAttr getGlobalViewAttr(cir::PointerType type, cir::GlobalOp globalOp, mlir::ArrayAttr indices={}, bool addressPoint=false)
Get constant address of a global variable as an MLIR attribute.
mlir::FloatType getF64Type()=delete
static OpBuilder::InsertPoint getBestAllocaInsertPoint(mlir::Block *block)
mlir::Value createPtrToInt(mlir::Value src, mlir::Type newTy)
mlir::Value createFDiv(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
mlir::Value createNUWSub(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
cir::ConstantOp getFalse(mlir::Location loc)
cir::CallOp createCallOp(mlir::Location loc, mlir::SymbolRefAttr callee, mlir::ValueRange operands=mlir::ValueRange(), llvm::ArrayRef< mlir::NamedAttribute > attrs={}, llvm::ArrayRef< mlir::NamedAttrList > argAttrs={}, llvm::ArrayRef< mlir::NamedAttribute > resAttrs={})
cir::GetMemberOp createGetMember(mlir::Location loc, mlir::Type resultTy, mlir::Value base, llvm::StringRef name, unsigned index)
cir::PointerType getPointerTo(mlir::Type ty)
cir::VecFCmpOp createVecFCompare(mlir::Location loc, cir::FCmpOpKind kind, mlir::Value lhs, mlir::Value rhs, bool signaling=false)
Compares lhs and rhs element-wise.
mlir::Value createFNeg(mlir::Location loc, mlir::Value operand)
mlir::Value createComplexSub(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
mlir::Value createAlloca(mlir::Location loc, cir::PointerType addrType, llvm::StringRef name, clang::CharUnits alignment)
cir::StoreOp createStore(mlir::Location loc, mlir::Value val, mlir::Value dst, bool isVolatile=false, bool isNontemporal=false, mlir::IntegerAttr align={}, cir::SyncScopeKindAttr scope={}, cir::MemOrderAttr order={}, cir::TBAATagAttr tbaa={})
mlir::Value createNot(mlir::Value value)
cir::CallOp createCallOp(mlir::Location loc, mlir::SymbolRefAttr callee, mlir::Type returnType, mlir::ValueRange operands, llvm::ArrayRef< mlir::NamedAttribute > attrs={}, llvm::ArrayRef< mlir::NamedAttrList > argAttrs={}, llvm::ArrayRef< mlir::NamedAttribute > resAttrs={}, cir::CallingConv callingConv=cir::CallingConv::C)
mlir::Value createAddSat(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
mlir::Value createMul(mlir::Location loc, mlir::Value lhs, mlir::Value rhs, OverflowFlags flags=OverflowFlags::None)
mlir::Value createFAdd(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
mlir::Value createExtractElement(mlir::Location loc, mlir::Value vec, cir::IntType idxTy, uint64_t idx)
mlir::Value createComplexImag(mlir::Location loc, mlir::Value operand)
cir::ConstantOp getTrue(mlir::Location loc)
mlir::Value createNSWMul(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
cir::ConstantOp getNullPtr(mlir::Type ty, mlir::Location loc)
cir::CallOp createCallOp(mlir::Location loc, cir::FuncOp callee, mlir::ValueRange operands, llvm::ArrayRef< mlir::NamedAttribute > attrs={}, llvm::ArrayRef< mlir::NamedAttrList > argAttrs={}, llvm::ArrayRef< mlir::NamedAttribute > resAttrs={}, cir::CallingConv callingConv=cir::CallingConv::C)
cir::GetGlobalOp createGetGlobal(cir::GlobalOp global, bool threadLocal=false)
cir::IntType getUIntNTy(int n)
mlir::Value createComplexDiv(mlir::Location loc, mlir::Value lhs, mlir::Value rhs, cir::ComplexRangeKind rangeKind)
cir::DoWhileOp createDoWhile(mlir::Location loc, llvm::function_ref< void(mlir::OpBuilder &, mlir::Location)> condBuilder, llvm::function_ref< void(mlir::OpBuilder &, mlir::Location)> bodyBuilder)
Create a do-while operation.
mlir::Value createNUWAMul(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
mlir::Value createInsertElement(mlir::Location loc, mlir::Value vec, mlir::Value newElt, mlir::Value idx)
mlir::Value createPtrBitcast(mlir::Value src, mlir::Type newPointeeTy)
cir::GetGlobalOp createGetGlobal(mlir::Location loc, cir::GlobalOp global, bool threadLocal=false)
mlir::Value createShiftLeft(mlir::Location loc, mlir::Value lhs, unsigned bits)
mlir::Value createAlloca(mlir::Location loc, cir::PointerType addrType, llvm::StringRef name, mlir::IntegerAttr alignment, mlir::Value dynAllocSize)
cir::LoadOp createLoad(mlir::Location loc, mlir::Value ptr, bool isVolatile=false, uint64_t alignment=0, bool isNontemporal=false)
mlir::Value createAlloca(mlir::Location loc, cir::PointerType addrType, mlir::Type type, llvm::StringRef name, clang::CharUnits alignment, mlir::Value dynAllocSize)
mlir::Value getSignedInt(mlir::Location loc, int64_t val, unsigned numBits)
cir::WhileOp createWhile(mlir::Location loc, llvm::function_ref< void(mlir::OpBuilder &, mlir::Location)> condBuilder, llvm::function_ref< void(mlir::OpBuilder &, mlir::Location)> bodyBuilder, llvm::function_ref< void(mlir::OpBuilder &, mlir::Location)> cleanupBuilder, cir::CleanupKind cleanupKind)
Create a while operation with a per-iteration cleanup region.
mlir::Value createMax(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
mlir::Value createAnd(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
mlir::FloatType getF16Type()=delete
cir::PointerType getPointerTo(mlir::Type ty, clang::LangAS langAS)
cir::VecCmpOp createVecCompare(mlir::Location loc, cir::CmpOpKind kind, mlir::Value lhs, mlir::Value rhs)
Compares lhs and rhs element-wise.
mlir::Value createIntCast(mlir::Value src, mlir::Type newTy)
cir::GlobalViewAttr getGlobalViewAttr(cir::PointerType type, cir::GlobalOp globalOp, llvm::ArrayRef< int64_t > indices, bool addressPoint=false)
Get constant address of a global variable as an MLIR attribute.
llvm::RoundingMode defaultConstrainedRounding
cir::FastMathFlagsAttr getFastMathFlagsAttr()
Returns a null attribute when no fast-math flags are set.
mlir::Value createBitcast(mlir::Value src, mlir::Type newTy)
mlir::Value createFMul(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
CIRBaseBuilderTy(mlir::MLIRContext &mlirContext)
mlir::Value createBitcast(mlir::Location loc, mlir::Value src, mlir::Type newTy)
cir::FuncType getVoidFnTy(mlir::TypeRange argTypes={})
Returns void (T...) as a cir::FuncType.
mlir::Value createSubSat(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
mlir::TypedAttr getNullDataMemberAttr(cir::DataMemberType ty)
mlir::Value createBuiltinIntCast(mlir::Location loc, mlir::Value src, mlir::Type newTy)
clang::LangOptions::FPExceptionModeKind defaultConstrainedExcept
cir::CallOp createIndirectCallOp(mlir::Location loc, mlir::Value indirectTarget, cir::FuncType funcType, mlir::ValueRange operands, llvm::ArrayRef< mlir::NamedAttribute > attrs={}, llvm::ArrayRef< mlir::NamedAttrList > argAttrs={}, llvm::ArrayRef< mlir::NamedAttribute > resAttrs={}, cir::CallingConv callingConv=cir::CallingConv::C)
cir::CmpOp createCompare(mlir::Location loc, cir::CmpOpKind kind, mlir::Value lhs, mlir::Value rhs)
mlir::IntegerAttr getAlignmentAttr(clang::CharUnits alignment)
mlir::Value createNot(mlir::Location loc, mlir::Value value)
mlir::Value createExtractElement(mlir::Location loc, mlir::Value vec, mlir::Value idx)
void setIsFPConstrained(bool isCon)
Enable/Disable use of constrained floating point math.
mlir::Value createMin(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
mlir::Value createSelect(mlir::Location loc, mlir::Value condition, mlir::Value trueValue, mlir::Value falseValue)
cir::ContinueOp createContinue(mlir::Location loc)
Create a continue operation.
llvm::RoundingMode getDefaultConstrainedRounding() const
Get the rounding mode handling used with constrained floating point.
cir::PointerType getPointerTo(mlir::Type ty, mlir::ptr::MemorySpaceAttrInterface as)
mlir::FloatType getF32Type()=delete
mlir::TypedAttr getZeroInitAttr(mlir::Type ty)
mlir::Value createMinus(mlir::Location loc, mlir::Value input, bool nsw=false)
CIRBaseBuilderTy(mlir::OpBuilder &builder)
mlir::Value createPtrIsNotNull(mlir::Value ptr)
static unsigned getCIRIntOrFloatBitWidth(mlir::Type eltTy)
cir::ConstantOp getConstantInt(mlir::Location loc, mlir::Type ty, int64_t value)
mlir::Value createComplexCreate(mlir::Location loc, mlir::Value real, mlir::Value imag)
mlir::Value createBoolIntToIntCast(mlir::Value src, mlir::Type newTy)
mlir::Value createAddrSpaceCast(mlir::Value src, mlir::Type newTy)
mlir::Value createComplexConj(mlir::Location loc, mlir::Value operand)
mlir::Value createPtrToBoolCast(mlir::Value v)
cir::BoolAttr getTrueAttr()
cir::PointerType getVoidPtrTy(clang::LangAS langAS=clang::LangAS::Default)
mlir::Value createFRem(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
mlir::Value createShiftRight(mlir::Location loc, mlir::Value lhs, unsigned bits)
mlir::Value createIsNaN(mlir::Location loc, mlir::Value operand)
cir::IntType getSIntNTy(int n)
void setDefaultConstrainedExcept(clang::LangOptions::FPExceptionModeKind newExcept)
Set the exception handling to be used with constrained floating point.
mlir::Value createAlignedLoad(mlir::Location loc, mlir::Value ptr, uint64_t alignment)
bool getIsFPConstrained() const
Query for the use of constrained floating point math.
mlir::TypedAttr getConstPtrAttr(mlir::Type type, int64_t value)
mlir::Value createAddrSpaceCast(mlir::Location loc, mlir::Value src, mlir::Type newTy)
cir::FastMathFlags fastMathFlags
mlir::Value createDummyValue(mlir::Location loc, mlir::Type type, clang::CharUnits alignment)
cir::BoolAttr getFalseAttr()
void setDefaultConstrainedRounding(llvm::RoundingMode newRounding)
Set the rounding mode handling to be used with constrained floating point.
mlir::Value createShiftRight(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
mlir::FloatType getBF16Type()=delete
mlir::Value createXor(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
mlir::FloatType getF128Type()=delete
cir::YieldOp createYield(mlir::Location loc, mlir::ValueRange value={})
Create a yield operation.
cir::ConstantOp getAlignment(mlir::Location loc, mlir::Type t, clang::CharUnits alignment)
mlir::Value createLogicalAnd(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
cir::GlobalOp createGlobal(mlir::ModuleOp mlirModule, mlir::Location loc, mlir::StringRef name, mlir::Type type, bool isConstant, cir::GlobalLinkageKind linkage, mlir::ptr::MemorySpaceAttrInterface addrSpace)
void setFastMathFlags(cir::FastMathFlags flags)
Set the fast-math flags attached to floating-point operations.
mlir::IntegerAttr getAlignmentAttr(llvm::Align alignment)
mlir::Value createFSub(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
cir::LoadOp createFlagLoad(mlir::Location loc, mlir::Value addr)
Emit a load from an boolean flag variable.
cir::BoolType getBoolTy()
mlir::Value createComplexAdd(mlir::Location loc, mlir::Value lhs, mlir::Value rhs)
mlir::Value getUnsignedInt(mlir::Location loc, uint64_t val, unsigned numBits)
GetMethodResults createGetMethod(mlir::Location loc, mlir::Value method, mlir::Value objectPtr)
mlir::Value createComplexReal(mlir::Location loc, mlir::Value operand)
This is an opaque type for sizes expressed in character units.
QuantityType getQuantity() const
Get the raw integer representation of this quantity.
FPExceptionModeKind
Possible floating point exception behavior.
@ FPE_Strict
Strictly preserve the floating-point exception semantics.
@ FPE_MayTrap
Transformations do not cause new exceptions but may hide some.
@ FPE_Ignore
Assume that floating-point exceptions are masked.
LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE()
mlir::ptr::MemorySpaceAttrInterface toCIRAddressSpaceAttr(mlir::MLIRContext &ctx, clang::LangAS langAS)
Convert an AST LangAS to the appropriate CIR address space attribute interface.
PtrOffsetFlags
No-wrap flags of a pointer offset computation: the subset of llvm::GEPNoWrapFlags that cir....
LangAS
Defines the address space values used by the address space qualifier of QualType.
__builtin_elementwise_add_sat __builtin_elementwise_sub_sat uint32_t int64_t
__builtin_elementwise_add_sat __builtin_elementwise_sub_sat uint32_t uint64_t __builtin_riscv_ssha_i32 __builtin_riscv_sshl_u32 uint64_t
static bool metaDataNode()
static bool addressSpace()
static bool targetCodeGenInfoGetNullPointer()