Lines Matching defs:builder

49 Type getOverheadType(Builder &builder, OverheadType ot);
85 SmallVector<Value> genCallOrInline(OpBuilder &builder, Location loc) {
87 return genImplementation(retTypes, params, builder, loc);
91 ModuleOp module = getParentOpOf<ModuleOp>(builder);
98 OpBuilder::InsertionGuard insertionGuard(builder);
99 builder.setInsertionPoint(getParentOpOf<func::FuncOp>(builder));
100 func = builder.create<func::FuncOp>(
106 builder.setInsertionPointToStart(entryBB);
110 genImplementation(retTypes, args, builder, loc);
111 builder.create<func::ReturnOp>(loc, result);
114 func::CallOp call = builder.create<func::CallOp>(loc, func, params);
120 OpTp getParentOpOf(OpBuilder &builder) {
121 return builder.getInsertionBlock()->getParent()->getParentOfType<OpTp>();
131 OpBuilder &builder, Location loc) {
133 builder, loc);
143 Value genCast(OpBuilder &builder, Location loc, Value value, Type dstTy);
146 Value genScalarToTensor(OpBuilder &builder, Location loc, Value elem,
152 Value genIndexLoad(OpBuilder &builder, Location loc, Value mem, ValueRange s);
158 TypedAttr getOneAttr(Builder &builder, Type tp);
163 Value genIsNonzero(OpBuilder &builder, Location loc, Value v);
168 void genReshapeDstShape(OpBuilder &builder, Location loc,
174 void reshapeCvs(OpBuilder &builder, Location loc,
187 /// the builder's module.
188 func::CallOp createFuncCall(OpBuilder &builder, Location loc, StringRef name,
195 Type getOpaquePointerType(Builder &builder);
200 Value genAlloca(OpBuilder &builder, Location loc, Value sz, Type tp);
205 Value genAlloca(OpBuilder &builder, Location loc, unsigned sz, Type tp,
210 Value genAllocaScalar(OpBuilder &builder, Location loc, Type tp);
215 Value allocaBuffer(OpBuilder &builder, Location loc, ValueRange values);
221 Value allocDenseTensor(OpBuilder &builder, Location loc,
225 void deallocDenseTensor(OpBuilder &builder, Location loc, Value buffer);
228 void sizesFromSrc(OpBuilder &builder, SmallVectorImpl<Value> &sizes,
251 OpBuilder &builder, Location loc, SparseElementsAttr attr, AffineMap order,
258 SmallVector<Value> loadAll(OpBuilder &builder, Location loc, size_t size,
266 void storeAll(OpBuilder &builder, Location loc, Value mem, ValueRange vs,
270 TypedValue<BaseMemRefType> genToMemref(OpBuilder &builder, Location loc,
275 Value createOrFoldSliceOffsetOp(OpBuilder &builder, Location loc, Value tensor,
280 Value createOrFoldSliceStrideOp(OpBuilder &builder, Location loc, Value tensor,
284 Value genReader(OpBuilder &builder, Location loc, SparseTensorType stt,
290 Value genMapBuffers(OpBuilder &builder, Location loc, SparseTensorType stt,
309 inline Value constantZero(OpBuilder &builder, Location loc, Type tp) {
311 auto zeroe = builder.getZeroAttr(ctp.getElementType());
312 auto zeroa = builder.getArrayAttr({zeroe, zeroe});
313 return builder.create<complex::ConstantOp>(loc, tp, zeroa);
315 return builder.create<arith::ConstantOp>(loc, tp, builder.getZeroAttr(tp));
320 inline Value constantOne(OpBuilder &builder, Location loc, Type tp) {
322 auto zeroe = builder.getZeroAttr(ctp.getElementType());
323 auto onee = getOneAttr(builder, ctp.getElementType());
324 auto zeroa = builder.getArrayAttr({onee, zeroe});
325 return builder.create<complex::ConstantOp>(loc, tp, zeroa);
327 return builder.create<arith::ConstantOp>(loc, tp, getOneAttr(builder, tp));
331 inline Value constantIndex(OpBuilder &builder, Location loc, int64_t i) {
332 return builder.create<arith::ConstantIndexOp>(loc, i);
336 inline Value constantI64(OpBuilder &builder, Location loc, int64_t i) {
337 return builder.create<arith::ConstantIntOp>(loc, i, 64);
341 inline Value constantI32(OpBuilder &builder, Location loc, int32_t i) {
342 return builder.create<arith::ConstantIntOp>(loc, i, 32);
346 inline Value constantI16(OpBuilder &builder, Location loc, int16_t i) {
347 return builder.create<arith::ConstantIntOp>(loc, i, 16);
351 inline Value constantI8(OpBuilder &builder, Location loc, int8_t i) {
352 return builder.create<arith::ConstantIntOp>(loc, i, 8);
356 inline Value constantI1(OpBuilder &builder, Location loc, bool b) {
357 return builder.create<arith::ConstantIntOp>(loc, b, 1);
361 inline Value constantAction(OpBuilder &builder, Location loc, Action action) {
362 return constantI32(builder, loc, static_cast<uint32_t>(action));
366 inline Value constantOverheadTypeEncoding(OpBuilder &builder, Location loc,
368 return constantI32(builder, loc,
374 inline Value constantPosTypeEncoding(OpBuilder &builder, Location loc,
376 return constantOverheadTypeEncoding(builder, loc, enc.getPosWidth());
381 inline Value constantCrdTypeEncoding(OpBuilder &builder, Location loc,
383 return constantOverheadTypeEncoding(builder, loc, enc.getCrdWidth());
387 inline Value constantPrimaryTypeEncoding(OpBuilder &builder, Location loc,
389 return constantI32(builder, loc,
394 inline Value constantLevelTypeEncoding(OpBuilder &builder, Location loc,
396 return constantI64(builder, loc, static_cast<uint64_t>(lt));
400 inline Value genValFromAttr(OpBuilder &builder, Location loc, Attribute attr) {
403 return builder.create<complex::ConstantOp>(
405 builder.getArrayAttr({FloatAttr::get(tp, complexAttr.getReal()),
408 return builder.create<arith::ConstantOp>(loc, cast<TypedAttr>(attr));