Lines Matching refs:ctx

73   static LLVM::LLVMPointerType opaquePointerType(MLIRContext *ctx) {  in opaquePointerType()
74 return LLVM::LLVMPointerType::get(IntegerType::get(ctx, 8)); in opaquePointerType()
77 static LLVM::LLVMTokenType tokenType(MLIRContext *ctx) { in tokenType()
78 return LLVM::LLVMTokenType::get(ctx); in tokenType()
81 static FunctionType addOrDropRefFunctionType(MLIRContext *ctx) { in addOrDropRefFunctionType()
82 auto ref = opaquePointerType(ctx); in addOrDropRefFunctionType()
83 auto count = IntegerType::get(ctx, 64); in addOrDropRefFunctionType()
84 return FunctionType::get(ctx, {ref, count}, {}); in addOrDropRefFunctionType()
87 static FunctionType createTokenFunctionType(MLIRContext *ctx) { in createTokenFunctionType()
88 return FunctionType::get(ctx, {}, {TokenType::get(ctx)}); in createTokenFunctionType()
91 static FunctionType createValueFunctionType(MLIRContext *ctx) { in createValueFunctionType()
92 auto i64 = IntegerType::get(ctx, 64); in createValueFunctionType()
93 auto value = opaquePointerType(ctx); in createValueFunctionType()
94 return FunctionType::get(ctx, {i64}, {value}); in createValueFunctionType()
97 static FunctionType createGroupFunctionType(MLIRContext *ctx) { in createGroupFunctionType()
98 auto i64 = IntegerType::get(ctx, 64); in createGroupFunctionType()
99 return FunctionType::get(ctx, {i64}, {GroupType::get(ctx)}); in createGroupFunctionType()
102 static FunctionType getValueStorageFunctionType(MLIRContext *ctx) { in getValueStorageFunctionType()
103 auto value = opaquePointerType(ctx); in getValueStorageFunctionType()
104 auto storage = opaquePointerType(ctx); in getValueStorageFunctionType()
105 return FunctionType::get(ctx, {value}, {storage}); in getValueStorageFunctionType()
108 static FunctionType emplaceTokenFunctionType(MLIRContext *ctx) { in emplaceTokenFunctionType()
109 return FunctionType::get(ctx, {TokenType::get(ctx)}, {}); in emplaceTokenFunctionType()
112 static FunctionType emplaceValueFunctionType(MLIRContext *ctx) { in emplaceValueFunctionType()
113 auto value = opaquePointerType(ctx); in emplaceValueFunctionType()
114 return FunctionType::get(ctx, {value}, {}); in emplaceValueFunctionType()
117 static FunctionType setTokenErrorFunctionType(MLIRContext *ctx) { in setTokenErrorFunctionType()
118 return FunctionType::get(ctx, {TokenType::get(ctx)}, {}); in setTokenErrorFunctionType()
121 static FunctionType setValueErrorFunctionType(MLIRContext *ctx) { in setValueErrorFunctionType()
122 auto value = opaquePointerType(ctx); in setValueErrorFunctionType()
123 return FunctionType::get(ctx, {value}, {}); in setValueErrorFunctionType()
126 static FunctionType isTokenErrorFunctionType(MLIRContext *ctx) { in isTokenErrorFunctionType()
127 auto i1 = IntegerType::get(ctx, 1); in isTokenErrorFunctionType()
128 return FunctionType::get(ctx, {TokenType::get(ctx)}, {i1}); in isTokenErrorFunctionType()
131 static FunctionType isValueErrorFunctionType(MLIRContext *ctx) { in isValueErrorFunctionType()
132 auto value = opaquePointerType(ctx); in isValueErrorFunctionType()
133 auto i1 = IntegerType::get(ctx, 1); in isValueErrorFunctionType()
134 return FunctionType::get(ctx, {value}, {i1}); in isValueErrorFunctionType()
137 static FunctionType isGroupErrorFunctionType(MLIRContext *ctx) { in isGroupErrorFunctionType()
138 auto i1 = IntegerType::get(ctx, 1); in isGroupErrorFunctionType()
139 return FunctionType::get(ctx, {GroupType::get(ctx)}, {i1}); in isGroupErrorFunctionType()
142 static FunctionType awaitTokenFunctionType(MLIRContext *ctx) { in awaitTokenFunctionType()
143 return FunctionType::get(ctx, {TokenType::get(ctx)}, {}); in awaitTokenFunctionType()
146 static FunctionType awaitValueFunctionType(MLIRContext *ctx) { in awaitValueFunctionType()
147 auto value = opaquePointerType(ctx); in awaitValueFunctionType()
148 return FunctionType::get(ctx, {value}, {}); in awaitValueFunctionType()
151 static FunctionType awaitGroupFunctionType(MLIRContext *ctx) { in awaitGroupFunctionType()
152 return FunctionType::get(ctx, {GroupType::get(ctx)}, {}); in awaitGroupFunctionType()
155 static FunctionType executeFunctionType(MLIRContext *ctx) { in executeFunctionType()
156 auto hdl = opaquePointerType(ctx); in executeFunctionType()
157 auto resume = LLVM::LLVMPointerType::get(resumeFunctionType(ctx)); in executeFunctionType()
158 return FunctionType::get(ctx, {hdl, resume}, {}); in executeFunctionType()
161 static FunctionType addTokenToGroupFunctionType(MLIRContext *ctx) { in addTokenToGroupFunctionType()
162 auto i64 = IntegerType::get(ctx, 64); in addTokenToGroupFunctionType()
163 return FunctionType::get(ctx, {TokenType::get(ctx), GroupType::get(ctx)}, in addTokenToGroupFunctionType()
167 static FunctionType awaitTokenAndExecuteFunctionType(MLIRContext *ctx) { in awaitTokenAndExecuteFunctionType()
168 auto hdl = opaquePointerType(ctx); in awaitTokenAndExecuteFunctionType()
169 auto resume = LLVM::LLVMPointerType::get(resumeFunctionType(ctx)); in awaitTokenAndExecuteFunctionType()
170 return FunctionType::get(ctx, {TokenType::get(ctx), hdl, resume}, {}); in awaitTokenAndExecuteFunctionType()
173 static FunctionType awaitValueAndExecuteFunctionType(MLIRContext *ctx) { in awaitValueAndExecuteFunctionType()
174 auto value = opaquePointerType(ctx); in awaitValueAndExecuteFunctionType()
175 auto hdl = opaquePointerType(ctx); in awaitValueAndExecuteFunctionType()
176 auto resume = LLVM::LLVMPointerType::get(resumeFunctionType(ctx)); in awaitValueAndExecuteFunctionType()
177 return FunctionType::get(ctx, {value, hdl, resume}, {}); in awaitValueAndExecuteFunctionType()
180 static FunctionType awaitAllAndExecuteFunctionType(MLIRContext *ctx) { in awaitAllAndExecuteFunctionType()
181 auto hdl = opaquePointerType(ctx); in awaitAllAndExecuteFunctionType()
182 auto resume = LLVM::LLVMPointerType::get(resumeFunctionType(ctx)); in awaitAllAndExecuteFunctionType()
183 return FunctionType::get(ctx, {GroupType::get(ctx), hdl, resume}, {}); in awaitAllAndExecuteFunctionType()
186 static FunctionType getNumWorkerThreads(MLIRContext *ctx) { in getNumWorkerThreads()
187 return FunctionType::get(ctx, {}, {IndexType::get(ctx)}); in getNumWorkerThreads()
191 static Type resumeFunctionType(MLIRContext *ctx) { in resumeFunctionType()
192 auto voidTy = LLVM::LLVMVoidType::get(ctx); in resumeFunctionType()
193 auto i8Ptr = opaquePointerType(ctx); in resumeFunctionType()
210 MLIRContext *ctx = module.getContext(); in addAsyncRuntimeApiDeclarations() local
211 addFuncDecl(kAddRef, AsyncAPI::addOrDropRefFunctionType(ctx)); in addAsyncRuntimeApiDeclarations()
212 addFuncDecl(kDropRef, AsyncAPI::addOrDropRefFunctionType(ctx)); in addAsyncRuntimeApiDeclarations()
213 addFuncDecl(kCreateToken, AsyncAPI::createTokenFunctionType(ctx)); in addAsyncRuntimeApiDeclarations()
214 addFuncDecl(kCreateValue, AsyncAPI::createValueFunctionType(ctx)); in addAsyncRuntimeApiDeclarations()
215 addFuncDecl(kCreateGroup, AsyncAPI::createGroupFunctionType(ctx)); in addAsyncRuntimeApiDeclarations()
216 addFuncDecl(kEmplaceToken, AsyncAPI::emplaceTokenFunctionType(ctx)); in addAsyncRuntimeApiDeclarations()
217 addFuncDecl(kEmplaceValue, AsyncAPI::emplaceValueFunctionType(ctx)); in addAsyncRuntimeApiDeclarations()
218 addFuncDecl(kSetTokenError, AsyncAPI::setTokenErrorFunctionType(ctx)); in addAsyncRuntimeApiDeclarations()
219 addFuncDecl(kSetValueError, AsyncAPI::setValueErrorFunctionType(ctx)); in addAsyncRuntimeApiDeclarations()
220 addFuncDecl(kIsTokenError, AsyncAPI::isTokenErrorFunctionType(ctx)); in addAsyncRuntimeApiDeclarations()
221 addFuncDecl(kIsValueError, AsyncAPI::isValueErrorFunctionType(ctx)); in addAsyncRuntimeApiDeclarations()
222 addFuncDecl(kIsGroupError, AsyncAPI::isGroupErrorFunctionType(ctx)); in addAsyncRuntimeApiDeclarations()
223 addFuncDecl(kAwaitToken, AsyncAPI::awaitTokenFunctionType(ctx)); in addAsyncRuntimeApiDeclarations()
224 addFuncDecl(kAwaitValue, AsyncAPI::awaitValueFunctionType(ctx)); in addAsyncRuntimeApiDeclarations()
225 addFuncDecl(kAwaitGroup, AsyncAPI::awaitGroupFunctionType(ctx)); in addAsyncRuntimeApiDeclarations()
226 addFuncDecl(kExecute, AsyncAPI::executeFunctionType(ctx)); in addAsyncRuntimeApiDeclarations()
227 addFuncDecl(kGetValueStorage, AsyncAPI::getValueStorageFunctionType(ctx)); in addAsyncRuntimeApiDeclarations()
228 addFuncDecl(kAddTokenToGroup, AsyncAPI::addTokenToGroupFunctionType(ctx)); in addAsyncRuntimeApiDeclarations()
230 AsyncAPI::awaitTokenAndExecuteFunctionType(ctx)); in addAsyncRuntimeApiDeclarations()
232 AsyncAPI::awaitValueAndExecuteFunctionType(ctx)); in addAsyncRuntimeApiDeclarations()
234 AsyncAPI::awaitAllAndExecuteFunctionType(ctx)); in addAsyncRuntimeApiDeclarations()
235 addFuncDecl(kGetNumWorkerThreads, AsyncAPI::getNumWorkerThreads(ctx)); in addAsyncRuntimeApiDeclarations()
251 MLIRContext *ctx = module.getContext(); in addResumeFunction() local
255 auto voidTy = LLVM::LLVMVoidType::get(ctx); in addResumeFunction()
256 auto i8Ptr = LLVM::LLVMPointerType::get(IntegerType::get(ctx, 8)); in addResumeFunction()
923 explicit RefCountingOpLowering(TypeConverter &converter, MLIRContext *ctx, in RefCountingOpLowering() argument
925 : OpConversionPattern<RefCountingOp>(converter, ctx), in RefCountingOpLowering()
948 explicit RuntimeAddRefOpLowering(TypeConverter &converter, MLIRContext *ctx) in RuntimeAddRefOpLowering() argument
949 : RefCountingOpLowering(converter, ctx, kAddRef) {} in RuntimeAddRefOpLowering()
955 explicit RuntimeDropRefOpLowering(TypeConverter &converter, MLIRContext *ctx) in RuntimeDropRefOpLowering() argument
956 : RefCountingOpLowering(converter, ctx, kDropRef) {} in RuntimeDropRefOpLowering()
989 MLIRContext *ctx = module->getContext(); in runOnOperation() local
1001 RewritePatternSet patterns(ctx); in runOnOperation()
1005 LLVMTypeConverter llvmConverter(ctx); in runOnOperation()
1014 patterns.add<ReturnOpOpConversion>(converter, ctx); in runOnOperation()
1022 ctx); in runOnOperation()
1028 ctx); in runOnOperation()
1034 converter, ctx); in runOnOperation()
1036 ConversionTarget target(*ctx); in runOnOperation()