Home
last modified time | relevance | path

Searched refs:mlir (Results 1 – 25 of 84) sorted by relevance

1234

/freebsd/contrib/llvm-project/clang/lib/CIR/Lowering/DirectToLLVM/
H A DLowerToLLVM.h26 mlir::Value lowerCirAttrAsValue(mlir::Operation *parentOp, mlir::Attribute attr,
27 mlir::ConversionPatternRewriter &rewriter,
28 const mlir::TypeConverter *converter);
30 mlir::LLVM::Linkage convertLinkage(cir::GlobalLinkageKind linkage);
32 void convertSideEffectForCall(mlir::Operation *callOp, bool isNothrow,
34 mlir::LLVM::MemoryEffectsAttr &memoryEffect,
38 : public mlir::OpConversionPattern<cir::AssumeOp> {
40 using mlir::OpConversionPattern<cir::AssumeOp>::OpConversionPattern;
42 mlir::LogicalResult
44 mlir::ConversionPatternRewriter &) const override;
[all …]
H A DLowerToLLVM.cpp57 mlir::Type elementTypeIfVector(mlir::Type type) { in elementTypeIfVector()
58 return llvm::TypeSwitch<mlir::Type, mlir::Type>(type) in elementTypeIfVector()
59 .Case<cir::VectorType, mlir::VectorType>( in elementTypeIfVector()
61 .Default([](mlir::Type p) { return p; }); in elementTypeIfVector()
68 static mlir::Type convertTypeForMemory(const mlir::TypeConverter &converter, in convertTypeForMemory()
69 mlir::DataLayout const &dataLayout, in convertTypeForMemory()
70 mlir::Type type) { in convertTypeForMemory()
74 return mlir::IntegerType::get(type.getContext(), in convertTypeForMemory()
81 static mlir::Value createIntCast(mlir::OpBuilder &bld, mlir::Value src, in createIntCast()
82 mlir::IntegerType dstTy, in createIntCast()
[all …]
/freebsd/contrib/llvm-project/clang/include/clang/CIR/Dialect/Builder/
H A DCIRBaseBuilder.h57 class CIRBaseBuilderTy : public mlir::OpBuilder {
60 CIRBaseBuilderTy(mlir::MLIRContext &mlirContext) in CIRBaseBuilderTy()
61 : mlir::OpBuilder(&mlirContext) {} in CIRBaseBuilderTy()
62 CIRBaseBuilderTy(mlir::OpBuilder &builder) : mlir::OpBuilder(builder) {} in CIRBaseBuilderTy()
64 mlir::Value getConstAPInt(mlir::Location loc, mlir::Type typ, in getConstAPInt()
69 cir::ConstantOp getConstant(mlir::Location loc, mlir::TypedAttr attr) { in getConstant()
73 cir::ConstantOp getConstantInt(mlir::Location loc, mlir::Type ty, in getConstantInt()
79 cir::ConstantOp getNullValue(mlir::Type ty, mlir::Location loc) { in getNullValue()
83 mlir::TypedAttr getConstNullPtrAttr(mlir::Type t) { in getConstNullPtrAttr()
84 assert(mlir::isa<cir::PointerType>(t) && "expected cir.ptr"); in getConstNullPtrAttr()
[all …]
/freebsd/contrib/llvm-project/clang/lib/CIR/CodeGen/
H A DCIRGenOpenACCClause.cpp41 mlir::acc::LoopOp loopOp;
64 llvm::SmallVector<mlir::acc::DeviceType> lastDeviceTypeValues;
69 llvm::SmallVector<mlir::Operation *> dataOperands;
82 mlir::Value emitIntExpr(const Expr *intExpr) { in emitIntExpr()
90 mlir::Value createCondition(const Expr *condExpr) { in createCondition()
91 mlir::Value condition = cgf.evaluateExprAsBool(condExpr); in createCondition()
92 mlir::Location exprLoc = cgf.cgm.getLoc(condExpr->getBeginLoc()); in createCondition()
93 mlir::IntegerType targetType = mlir::IntegerType::get( in createCondition()
95 mlir::IntegerType::SignednessSemantics::Signless); in createCondition()
96 auto conversionOp = builder.create<mlir::UnrealizedConversionCastOp>( in createCondition()
[all …]
H A DCIRGenBuilder.h31 CIRGenBuilderTy(mlir::MLIRContext &mlirContext, const CIRGenTypeCache &tc) in CIRGenBuilderTy()
37 mlir::Attribute getString(llvm::StringRef str, mlir::Type eltTy, in getString()
57 mlir::StringAttr::get(str.drop_back(trailingZerosNum), in getString()
107 cir::RecordType getCompleteRecordTy(llvm::ArrayRef<mlir::Type> members, in getCompleteRecordTy()
136 const mlir::StringAttr nameAttr = getStringAttr(name); in getIncompleteRecordTy()
145 bool isNullValue(mlir::Attribute attr) const { in isNullValue()
146 if (mlir::isa<cir::ZeroAttr>(attr)) in isNullValue()
149 if (const auto ptrVal = mlir::dyn_cast<cir::ConstPtrAttr>(attr)) in isNullValue()
152 if (const auto intVal = mlir::dyn_cast<cir::IntAttr>(attr)) in isNullValue()
155 if (const auto boolVal = mlir::dyn_cast<cir::BoolAttr>(attr)) in isNullValue()
[all …]
H A DCIRGenStmtOpenACC.cpp22 using namespace mlir::acc;
25 mlir::LogicalResult CIRGenFunction::emitOpenACCOpAssociatedStmt( in emitOpenACCOpAssociatedStmt()
26 mlir::Location start, mlir::Location end, OpenACCDirectiveKind dirKind, in emitOpenACCOpAssociatedStmt()
29 mlir::LogicalResult res = mlir::success(); in emitOpenACCOpAssociatedStmt()
31 llvm::SmallVector<mlir::Type> retTy; in emitOpenACCOpAssociatedStmt()
32 llvm::SmallVector<mlir::Value> operands; in emitOpenACCOpAssociatedStmt()
38 mlir::Block &block = op.getRegion().emplaceBlock(); in emitOpenACCOpAssociatedStmt()
39 mlir::OpBuilder::InsertionGuard guardCase(builder); in emitOpenACCOpAssociatedStmt()
53 static constexpr mlir::acc::CombinedConstructsType value =
54 mlir::acc::CombinedConstructsType::ParallelLoop;
[all …]
H A DCIRGenStmt.cpp36 mlir::Location scopeLoc = getLoc(s.getSourceRange()); in emitCompoundStmt()
37 mlir::OpBuilder::InsertPoint scopeInsPt; in emitCompoundStmt()
39 scopeLoc, [&](mlir::OpBuilder &b, mlir::Type &type, mlir::Location loc) { in emitCompoundStmt()
43 mlir::OpBuilder::InsertionGuard guard(builder); in emitCompoundStmt()
56 mlir::LogicalResult CIRGenFunction::emitStmt(const Stmt *s, in emitStmt()
59 if (mlir::succeeded(emitSimpleStmt(s, useCurrentScope))) in emitStmt()
60 return mlir::success(); in emitStmt()
83 mlir::Block *incoming = builder.getInsertionBlock(); in emitStmt()
88 mlir::Block *outgoing = builder.getInsertionBlock(); in emitStmt()
90 return mlir::success(); in emitStmt()
[all …]
H A DCIRGenExprComplex.cpp10 class ComplexExprEmitter : public StmtVisitor<ComplexExprEmitter, mlir::Value> {
22 LValue emitBinAssignLValue(const BinaryOperator *e, mlir::Value &val);
24 mlir::Value emitCast(CastKind ck, Expr *op, QualType destTy);
26 mlir::Value emitConstant(const CIRGenFunction::ConstantEmission &constant,
32 mlir::Value emitLoadOfLValue(const Expr *e) { in emitLoadOfLValue()
36 mlir::Value emitLoadOfLValue(LValue lv, SourceLocation loc);
39 void emitStoreOfComplex(mlir::Location loc, mlir::Value val, LValue lv,
42 mlir::Value
44 mlir::Value VisitArraySubscriptExpr(Expr *e);
45 mlir::Value VisitBinAssign(const BinaryOperator *e);
[all …]
H A DCIRGenFunction.h37 namespace mlir {
62 std::optional<mlir::Value> fnRetAlloca;
67 mlir::Value cxxabiThisValue = nullptr;
68 mlir::Value cxxThisValue = nullptr;
87 llvm::SmallVector<mlir::Type, 2> condTypeStack;
96 mlir::Block *getCurFunctionEntryBlock() { return &curFn.getRegion().front(); } in getCurFunctionEntryBlock()
105 mlir::Type convertTypeForMem(QualType t);
107 mlir::Type convertType(clang::QualType t);
108 mlir::Type convertType(const TypeDecl *t) { in convertType()
130 mlir::MLIRContext &getMLIRContext() { return cgm.getMLIRContext(); } in getMLIRContext()
[all …]
H A DCIRGenExprConstant.cpp50 : public StmtVisitor<ConstExprEmitter, mlir::Attribute, QualType> {
62 mlir::Attribute VisitStmt(Stmt *S, QualType T) { return {}; } in VisitStmt()
64 mlir::Attribute VisitConstantExpr(ConstantExpr *ce, QualType t) { in VisitConstantExpr()
65 if (mlir::Attribute result = emitter.tryEmitConstantExpr(ce)) in VisitConstantExpr()
70 mlir::Attribute VisitParenExpr(ParenExpr *pe, QualType t) { in VisitParenExpr()
74 mlir::Attribute
80 mlir::Attribute VisitGenericSelectionExpr(GenericSelectionExpr *ge, in VisitGenericSelectionExpr()
85 mlir::Attribute VisitChooseExpr(ChooseExpr *ce, QualType t) { in VisitChooseExpr()
89 mlir::Attribute VisitCompoundLiteralExpr(CompoundLiteralExpr *e, QualType t) { in VisitCompoundLiteralExpr()
93 mlir::Attribute VisitCastExpr(CastExpr *e, QualType destType) { in VisitCastExpr()
[all …]
H A DCIRGenOpenACC.cpp22 mlir::Value createBound(CIRGenFunction &cgf, CIRGen::CIRGenBuilderTy &builder, in createBound()
23 mlir::Location boundLoc, mlir::Value lowerBound, in createBound()
24 mlir::Value upperBound, mlir::Value extent) { in createBound()
26 mlir::Value startIdx = cgf.createOpenACCConstantInt(boundLoc, 64, 0); in createBound()
28 mlir::Value stride = cgf.createOpenACCConstantInt(boundLoc, 64, 1); in createBound()
31 builder.create<mlir::acc::DataBoundsOp>(boundLoc, lowerBound, upperBound); in createBound()
41 mlir::Value CIRGenFunction::emitOpenACCIntExpr(const Expr *intExpr) { in emitOpenACCIntExpr()
42 mlir::Value expr = emitScalarExpr(intExpr); in emitOpenACCIntExpr()
43 mlir::Location exprLoc = cgm.getLoc(intExpr->getBeginLoc()); in emitOpenACCIntExpr()
45 mlir::IntegerType targetType = mlir::IntegerType::get( in emitOpenACCIntExpr()
[all …]
H A DCIRGenExprScalar.cpp32 mlir::Value lhs;
33 mlir::Value rhs;
78 class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
91 mlir::Value emitPromotedValue(mlir::Value result, QualType promotionType) { in emitPromotedValue()
95 mlir::Value emitUnPromotedValue(mlir::Value result, QualType exprType) { in emitUnPromotedValue()
99 mlir::Value emitPromoted(const Expr *e, QualType promotionType);
101 mlir::Value maybePromoteBoolResult(mlir::Value value, in maybePromoteBoolResult()
102 mlir::Type dstTy) const { in maybePromoteBoolResult()
103 if (mlir::isa<cir::IntType>(dstTy)) in maybePromoteBoolResult()
105 if (mlir::isa<cir::BoolType>(dstTy)) in maybePromoteBoolResult()
[all …]
H A DCIRGenBuilder.cpp13 mlir::Value CIRGenBuilderTy::maybeBuildArrayDecay(mlir::Location loc, in maybeBuildArrayDecay()
14 mlir::Value arrayPtr, in maybeBuildArrayDecay()
15 mlir::Type eltTy) { in maybeBuildArrayDecay()
16 const auto arrayPtrTy = mlir::cast<cir::PointerType>(arrayPtr.getType()); in maybeBuildArrayDecay()
17 const auto arrayTy = mlir::dyn_cast<cir::ArrayType>(arrayPtrTy.getPointee()); in maybeBuildArrayDecay()
30 mlir::Value CIRGenBuilderTy::getArrayElement(mlir::Location arrayLocBegin, in getArrayElement()
31 mlir::Location arrayLocEnd, in getArrayElement()
32 mlir::Value arrayPtr, in getArrayElement()
33 mlir::Type eltTy, mlir::Value idx, in getArrayElement()
35 mlir::Value basePtr = arrayPtr; in getArrayElement()
[all …]
H A DCIRGenModule.h60 CIRGenModule(mlir::MLIRContext &mlirContext, clang::ASTContext &astContext,
79 mlir::ModuleOp theModule;
94 mlir::ModuleOp getModule() const { return theModule; } in getModule()
103 mlir::MLIRContext &getMLIRContext() { return *builder.getContext(); } in getMLIRContext()
115 mlir::Operation *lastGlobalOp = nullptr;
119 mlir::Operation *getGlobalValue(llvm::StringRef ref);
134 cir::GlobalOp getOrCreateCIRGlobal(llvm::StringRef mangledName, mlir::Type ty,
138 cir::GlobalOp getOrCreateCIRGlobal(const VarDecl *d, mlir::Type ty,
141 static cir::GlobalOp createGlobalOp(CIRGenModule &cgm, mlir::Location loc,
142 llvm::StringRef name, mlir::Type t,
[all …]
H A DAddress.h30 llvm::PointerIntPair<mlir::Value, 1, bool> pointerAndKnownNonNull;
35 mlir::Type elementType;
43 Address(mlir::Value pointer, mlir::Type elementType, in Address()
47 assert(mlir::isa<cir::PointerType>(pointer.getType()) && in Address()
54 assert(mlir::cast<cir::PointerType>(pointer.getType()).getPointee() == in Address()
58 Address(mlir::Value pointer, clang::CharUnits alignment) in Address()
60 mlir::cast<cir::PointerType>(pointer.getType()).getPointee(), in Address()
73 Address withElementType(CIRGenBuilderTy &builder, mlir::Type ElemTy) const;
75 mlir::Value getPointer() const { in getPointer()
80 mlir::Value getBasePointer() const { in getBasePointer()
[all …]
H A DCIRGenExpr.cpp45 mlir::Location loc = getLoc(field->getLocation()); in emitAddrOfFieldStorage()
47 mlir::Type fieldType = convertType(field->getType()); in emitAddrOfFieldStorage()
218 const mlir::Location loc = dst.getVectorPointer().getLoc(); in emitStoreThroughLValue()
219 const mlir::Value vector = in emitStoreThroughLValue()
221 const mlir::Value newVector = builder.create<cir::VecInsertOp>( in emitStoreThroughLValue()
259 mlir::Value v = cgf.cgm.getAddrOfGlobalVar(vd); in emitGlobalVarDeclLValue()
262 mlir::Type realVarTy = cgf.convertTypeForMem(vd->getType()); in emitGlobalVarDeclLValue()
279 void CIRGenFunction::emitStoreOfScalar(mlir::Value value, Address addr, in emitStoreOfScalar()
291 const mlir::Type elementType = addr.getElementType(); in emitStoreOfScalar()
312 srcAlloca.setInitAttr(mlir::UnitAttr::get(&getMLIRContext())); in emitStoreOfScalar()
[all …]
/freebsd/contrib/llvm-project/clang/lib/CIR/Lowering/
H A DLoweringHelpers.cpp17 mlir::DenseElementsAttr
19 mlir::Type type) { in convertStringAttrToDenseElementsAttr()
20 auto values = llvm::SmallVector<mlir::APInt, 8>{}; in convertStringAttrToDenseElementsAttr()
21 const auto stringAttr = mlir::cast<mlir::StringAttr>(attr.getElts()); in convertStringAttrToDenseElementsAttr()
26 const auto arrayTy = mlir::cast<cir::ArrayType>(attr.getType()); in convertStringAttrToDenseElementsAttr()
30 return mlir::DenseElementsAttr::get( in convertStringAttrToDenseElementsAttr()
31 mlir::RankedTensorType::get({(int64_t)values.size()}, type), in convertStringAttrToDenseElementsAttr()
35 template <> mlir::APInt getZeroInitFromType(mlir::Type ty) { in getZeroInitFromType()
36 assert(mlir::isa<cir::IntType>(ty) && "expected int type"); in getZeroInitFromType()
37 const auto intTy = mlir::cast<cir::IntType>(ty); in getZeroInitFromType()
[all …]
/freebsd/contrib/llvm-project/clang/lib/CIR/Dialect/IR/
H A DCIRTypes.cpp24 bool cir::isSized(mlir::Type ty) { in isSized()
25 if (auto sizedTy = mlir::dyn_cast<cir::SizedTypeInterface>(ty)) in isSized()
35 static mlir::ParseResult
36 parseFuncTypeParams(mlir::AsmParser &p, llvm::SmallVector<mlir::Type> &params,
38 static void printFuncTypeParams(mlir::AsmPrinter &p,
39 mlir::ArrayRef<mlir::Type> params,
55 using namespace mlir;
95 Type RecordType::parse(mlir::AsmParser &parser) { in parse()
98 const mlir::Location eLoc = parser.getEncodedSourceLoc(loc); in parse()
102 mlir::MLIRContext *context = parser.getContext(); in parse()
[all …]
H A DCIRDialect.cpp28 using namespace mlir;
65 if (auto boolAttr = mlir::dyn_cast<cir::BoolAttr>(attr)) { in getAlias()
69 if (auto bitfield = mlir::dyn_cast<cir::BitfieldInfoAttr>(attr)) { in getAlias()
88 Operation *cir::CIRDialect::materializeConstant(mlir::OpBuilder &builder, in materializeConstant()
89 mlir::Attribute value, in materializeConstant()
90 mlir::Type type, in materializeConstant()
91 mlir::Location loc) { in materializeConstant()
93 mlir::cast<mlir::TypedAttr>(value)); in materializeConstant()
186 static bool omitRegionTerm(mlir::Region &r) { in omitRegionTerm()
219 static mlir::ParseResult parseOmittedTerminatorRegion(mlir::OpAsmParser &parser, in parseOmittedTerminatorRegion()
[all …]
H A DCIRAttrs.cpp22 static void printIntLiteral(mlir::AsmPrinter &p, llvm::APInt value,
24 static mlir::ParseResult parseIntLiteral(mlir::AsmParser &parser,
31 static void printFloatLiteral(mlir::AsmPrinter &p, llvm::APFloat value,
32 mlir::Type ty);
33 static mlir::ParseResult
34 parseFloatLiteral(mlir::AsmParser &parser,
35 mlir::FailureOr<llvm::APFloat> &value,
38 static mlir::ParseResult parseConstPtr(mlir::AsmParser &parser,
39 mlir::IntegerAttr &value);
41 static void printConstPtr(mlir::AsmPrinter &p, mlir::IntegerAttr value);
[all …]
/freebsd/contrib/llvm-project/clang/include/clang/CIR/
H A DLoweringHelpers.h19 mlir::DenseElementsAttr
20 convertStringAttrToDenseElementsAttr(cir::ConstArrayAttr attr, mlir::Type type);
22 template <typename StorageTy> StorageTy getZeroInitFromType(mlir::Type ty);
23 template <> mlir::APInt getZeroInitFromType(mlir::Type ty);
24 template <> mlir::APFloat getZeroInitFromType(mlir::Type ty);
31 mlir::DenseElementsAttr
34 mlir::Type type);
36 std::optional<mlir::Attribute>
38 const mlir::TypeConverter *converter);
40 mlir::Value getConstAPInt(mlir::OpBuilder &bld, mlir::Location loc,
[all …]
/freebsd/contrib/llvm-project/clang/lib/CIR/Dialect/OpenACC/
H A DCIROpenACCTypeInterfaces.cpp19 mlir::Type getBaseType(mlir::Value varPtr) { in getBaseType()
20 mlir::Operation *op = varPtr.getDefiningOp(); in getBaseType()
24 if (auto allocaOp = mlir::dyn_cast<cir::AllocaOp>(*op)) in getBaseType()
28 if (auto castOp = mlir::dyn_cast<cir::CastOp>(*op)) in getBaseType()
32 if (auto ptrStrideOp = mlir::dyn_cast<cir::PtrStrideOp>(*op)) in getBaseType()
35 if (auto getMemberOp = mlir::dyn_cast<cir::GetMemberOp>(*op)) in getBaseType()
38 return mlir::cast<cir::PointerType>(varPtr.getType()).getPointee(); in getBaseType()
42 mlir::acc::VariableTypeCategory
44 mlir::Type pointer, mlir::TypedValue<mlir::acc::PointerLikeType> varPtr, in getPointeeTypeCategory()
45 mlir::Type varType) const { in getPointeeTypeCategory()
[all …]
/freebsd/contrib/llvm-project/clang/lib/CIR/Dialect/Transforms/
H A DFlattenCFG.cpp26 using namespace mlir;
32 void lowerTerminator(mlir::Operation *op, mlir::Block *dest, in lowerTerminator()
33 mlir::PatternRewriter &rewriter) { in lowerTerminator()
34 assert(op->hasTrait<mlir::OpTrait::IsTerminator>() && "not a terminator"); in lowerTerminator()
35 mlir::OpBuilder::InsertionGuard guard(rewriter); in lowerTerminator()
44 mlir::Region &region, in walkRegionSkipping()
45 mlir::function_ref<mlir::WalkResult(mlir::Operation *)> callback) { in walkRegionSkipping()
46 region.walk<mlir::WalkOrder::PreOrder>([&](mlir::Operation *op) { in walkRegionSkipping()
48 return mlir::WalkResult::skip(); in walkRegionSkipping()
59 struct CIRIfFlattening : public mlir::OpRewritePattern<cir::IfOp> {
[all …]
H A DCIRSimplify.cpp21 using namespace mlir;
57 return mlir::failure(); in matchAndRewrite()
61 return mlir::failure(); in matchAndRewrite()
64 mlir::cast<cir::YieldOp>(op.getTrueRegion().front().getTerminator()); in matchAndRewrite()
66 mlir::cast<cir::YieldOp>(op.getFalseRegion().front().getTerminator()); in matchAndRewrite()
67 mlir::Value trueValue = trueBranchYieldOp.getArgs()[0]; in matchAndRewrite()
68 mlir::Value falseValue = falseBranchYieldOp.getArgs()[0]; in matchAndRewrite()
77 return mlir::success(); in matchAndRewrite()
81 bool isSimpleTernaryBranch(mlir::Region &region) const { in isSimpleTernaryBranch()
85 mlir::Block &onlyBlock = region.front(); in isSimpleTernaryBranch()
[all …]
/freebsd/contrib/llvm-project/clang/include/clang/CIR/Interfaces/
H A DCIRLoopOpInterface.td12 include "mlir/IR/OpBase.td"
13 include "mlir/Interfaces/ControlFlowInterfaces.td"
14 include "mlir/Interfaces/LoopLikeInterface.td"
30 /*retTy=*/"mlir::Region &",
36 /*retTy=*/"mlir::Region &",
42 /*retTy=*/"mlir::Region *",
51 /*retTy=*/"mlir::Region &",
60 /*retTy=*/"llvm::SmallVector<mlir::Region *>",
65 return llvm::SmallVector<mlir::Region *, 2>{&$_op.getRegion(0), &$_op.getRegion(1)};
72 /*retTy=*/"mlir::WalkResult",
[all …]

1234