Lines Matching defs:tp
46 OverheadType mlir::sparse_tensor::overheadTypeEncoding(Type tp) {
47 if (tp.isIndex())
49 if (auto intTp = dyn_cast<IntegerType>(tp))
101 StringRef mlir::sparse_tensor::overheadTypeFunctionSuffix(Type tp) {
102 return overheadTypeFunctionSuffix(overheadTypeEncoding(tp));
189 mlir::TypedAttr mlir::sparse_tensor::getOneAttr(Builder &builder, Type tp) {
190 if (isa<FloatType>(tp))
191 return builder.getFloatAttr(tp, 1.0);
192 if (isa<IndexType>(tp))
194 if (auto intTp = dyn_cast<IntegerType>(tp))
195 return builder.getIntegerAttr(tp, APInt(intTp.getWidth(), 1));
196 if (isa<RankedTensorType, VectorType>(tp)) {
197 auto shapedTp = cast<ShapedType>(tp);
206 Type tp = v.getType();
207 Value zero = constantZero(builder, loc, tp);
208 if (isa<FloatType>(tp))
211 if (tp.isIntOrIndex())
214 if (dyn_cast<ComplexType>(tp))
361 unsigned sz, Type tp, bool staticShape) {
363 auto memTp = MemRefType::get({sz}, tp);
366 return genAlloca(builder, loc, constantIndex(builder, loc, sz), tp);
370 Type tp) {
371 auto memTp = MemRefType::get({ShapedType::kDynamic}, tp);
376 Type tp) {
377 return builder.create<memref::AllocaOp>(loc, MemRefType::get({}, tp));