Lines Matching refs:ty
91 mlir::Type convertType(mlir::Type ty) const { in convertType()
92 return lowerTy().convertType(ty); in convertType()
124 mlir::Type ty, mlir::Value val) const { in integerCast() argument
130 auto toSize = mlir::LLVM::getPrimitiveTypeSizeInBits(ty); in integerCast()
133 return rewriter.create<mlir::LLVM::TruncOp>(loc, ty, val); in integerCast()
135 return rewriter.create<mlir::LLVM::SExtOp>(loc, ty, val); in integerCast()
174 mlir::Type ty, in loadFromOffset() argument
176 auto pty = mlir::LLVM::LLVMPointerType::get(ty); in loadFromOffset()
179 return rewriter.create<mlir::LLVM::LoadOp>(loc, ty, p); in loadFromOffset()
195 loadBaseAddrFromBox(mlir::Location loc, mlir::Type ty, mlir::Value box, in loadBaseAddrFromBox() argument
200 auto pty = mlir::LLVM::LLVMPointerType::get(ty); in loadBaseAddrFromBox()
202 return rewriter.create<mlir::LLVM::LoadOp>(loc, ty, p); in loadBaseAddrFromBox()
206 loadElementSizeFromBox(mlir::Location loc, mlir::Type ty, mlir::Value box, in loadElementSizeFromBox() argument
211 auto pty = mlir::LLVM::LLVMPointerType::get(ty); in loadElementSizeFromBox()
213 return rewriter.create<mlir::LLVM::LoadOp>(loc, ty, p); in loadElementSizeFromBox()
262 mlir::LLVM::GEPOp genGEP(mlir::Location loc, mlir::Type ty, in genGEP() argument
266 return rewriter.create<mlir::LLVM::GEPOp>(loc, ty, base, cv); in genGEP()
286 mlir::Type ty = this->convertType(op.getType()); in matchAndRewrite() local
287 return doRewrite(op, ty, adaptor, rewriter); in matchAndRewrite()
291 doRewrite(FromOp addr, mlir::Type ty, OpAdaptor adaptor,
304 auto ty = convertType(addr.getType()); in matchAndRewrite() local
306 addr, ty, addr.getSymbol().getRootReference().getValue()); in matchAndRewrite()
365 mlir::Type ty = convertType(alloc.getType()); in matchAndRewrite() local
366 mlir::Type resultTy = ty; in matchAndRewrite()
376 ty = mlir::LLVM::LLVMPointerType::get(convertType(rawCharTy)); in matchAndRewrite()
389 ty = ::getVoidPtrType(alloc.getContext()); in matchAndRewrite()
403 if (ty == resultTy) { in matchAndRewrite()
405 rewriter.replaceOpWithNewOp<mlir::LLVM::AllocaOp>(alloc, ty, size, in matchAndRewrite()
408 auto al = rewriter.create<mlir::LLVM::AllocaOp>(loc, ty, size, in matchAndRewrite()
420 genExtractValueWithIndex(mlir::Location loc, mlir::Value tuple, mlir::Type ty, in genExtractValueWithIndex() argument
424 auto xty = ty.cast<mlir::LLVM::LLVMStructType>().getBody()[x]; in genExtractValueWithIndex()
439 mlir::Type ty = convertType(boxaddr.getType()); in matchAndRewrite() local
441 rewriter.replaceOp(boxaddr, loadBaseAddrFromBox(loc, ty, a, rewriter)); in matchAndRewrite()
445 rewriter.replaceOpWithNewOp<mlir::LLVM::ExtractValueOp>(boxaddr, ty, a, in matchAndRewrite()
507 auto ty = convertType(boxelesz.getType()); in matchAndRewrite() local
508 auto elemSize = getValueFromBox(loc, a, ty, rewriter, kElemLenPosInBox); in matchAndRewrite()
576 mlir::Type ty = convertType(boxrank.getType()); in matchAndRewrite() local
577 auto result = getValueFromBox(loc, a, ty, rewriter, kRankPosInBox); in matchAndRewrite()
624 auto ty = convertType(constop.getType()); in matchAndRewrite() local
627 rewriter.replaceOpWithNewOp<mlir::LLVM::ConstantOp>(constop, ty, attr); in matchAndRewrite()
635 mlir::Value cst = rewriter.create<mlir::LLVM::UndefOp>(loc, ty); in matchAndRewrite()
637 cst = rewriter.create<mlir::LLVM::ConstantOp>(loc, ty, arr); in matchAndRewrite()
648 cst = rewriter.create<mlir::LLVM::InsertValueOp>(loc, ty, cst, elemCst, in matchAndRewrite()
740 mlir::Type ty = convertType(conc.getType()); in matchAndRewrite() local
750 auto undef = rewriter.create<mlir::LLVM::UndefOp>(loc, ty); in matchAndRewrite()
752 loc, ty, undef, realPart, realIndex); in matchAndRewrite()
753 rewriter.replaceOpWithNewOp<mlir::LLVM::InsertValueOp>(conc, ty, setReal, in matchAndRewrite()
767 static bool isFloatingPointTy(mlir::Type ty) { in isFloatingPointTy()
768 return ty.isa<mlir::FloatType>(); in isFloatingPointTy()
806 auto ty = convertType(getComplexEleTy(convert.getValue().getType())); in matchAndRewrite() local
807 auto rp = rewriter.create<mlir::LLVM::ExtractValueOp>(loc, ty, op0, zero); in matchAndRewrite()
808 auto ip = rewriter.create<mlir::LLVM::ExtractValueOp>(loc, ty, op0, one); in matchAndRewrite()
810 auto fromBits = mlir::LLVM::getPrimitiveTypeSizeInBits(ty); in matchAndRewrite()
1028 mlir::Type ty = convertType(heapTy); in matchAndRewrite() local
1035 mlir::Value size = genTypeSizeInBytes(loc, ity, rewriter, ty); in matchAndRewrite()
1044 rewriter.replaceOpWithNewOp<mlir::LLVM::BitcastOp>(heap, ty, in matchAndRewrite()
1081 static unsigned getDimension(mlir::LLVM::LLVMArrayType ty) { in getDimension() argument
1083 for (auto eleTy = ty.getElementType().dyn_cast<mlir::LLVM::LLVMArrayType>(); in getDimension()
1211 if (auto ty = boxEleTy.dyn_cast<mlir::IntegerType>()) local
1212 return doInteger(ty.getWidth());
1213 auto ty = boxEleTy.cast<fir::IntegerType>(); local
1214 return doInteger(getKindMap().getIntegerBitsize(ty.getFKind()));
1218 if (auto ty = boxEleTy.dyn_cast<mlir::FloatType>()) local
1219 return doFloat(ty.getWidth());
1220 auto ty = boxEleTy.cast<fir::RealType>(); local
1221 return doFloat(getKindMap().getRealBitsize(ty.getFKind()));
1225 if (auto ty = boxEleTy.dyn_cast<mlir::ComplexType>()) local
1227 ty.getElementType().cast<mlir::FloatType>().getWidth());
1228 auto ty = boxEleTy.cast<fir::ComplexType>(); local
1229 return doComplex(getKindMap().getRealBitsize(ty.getFKind()));
1232 if (auto ty = boxEleTy.dyn_cast<fir::CharacterType>()) { local
1233 auto charWidth = getKindMap().getCharacterBitsize(ty.getFKind());
1234 if (ty.getLen() != fir::CharacterType::unknownLen()) {
1235 auto len = this->genConstantOffset(loc, rewriter, ty.getLen());
1242 if (auto ty = boxEleTy.dyn_cast<fir::LogicalType>()) local
1243 return doLogical(getKindMap().getLogicalBitsize(ty.getFKind()));
1328 auto ty = mlir::LLVM::LLVMPointerType::get( in getTypeDescriptor() local
1330 return rewriter.create<mlir::LLVM::AddressOfOp>(loc, ty, in getTypeDescriptor()
1336 auto ty = mlir::LLVM::LLVMPointerType::get(global.getType()); in getTypeDescriptor() local
1337 return rewriter.create<mlir::LLVM::AddressOfOp>(loc, ty, in getTypeDescriptor()
1941 auto ty = fir::dyn_cast_ptrOrBoxEleTy(rebox.box().getType()); in getInputEleTy() local
1942 if (auto seqTy = ty.dyn_cast<fir::SequenceType>()) in getInputEleTy()
1944 return ty; in getInputEleTy()
1966 mlir::Type ty) { in toRowMajor()
1967 assert(ty && "type is null"); in toRowMajor()
1970 if (auto seq = ty.dyn_cast<mlir::LLVM::LLVMArrayType>()) { in toRowMajor()
1977 ty = getArrayElementType(seq); in toRowMajor()
1978 } else if (auto st = ty.dyn_cast<mlir::LLVM::LLVMStructType>()) { in toRowMajor()
1979 ty = st.getBody()[attrs[i].cast<mlir::IntegerAttr>().getInt()]; in toRowMajor()
1996 auto ty = i->cast<mlir::TypeAttr>().getValue(); in collectIndices() local
1997 auto index = ty.cast<fir::RecordType>().getFieldIndex(fieldName); in collectIndices()
2005 static mlir::Type getArrayElementType(mlir::LLVM::LLVMArrayType ty) { in getArrayElementType()
2006 auto eleTy = ty.getElementType(); in getArrayElementType()
2021 doRewrite(fir::ExtractValueOp extractVal, mlir::Type ty, OpAdaptor adaptor, in doRewrite()
2028 extractVal, ty, operands[0], position); in doRewrite()
2041 doRewrite(fir::InsertValueOp insertVal, mlir::Type ty, OpAdaptor adaptor, in doRewrite()
2048 insertVal, ty, operands[0], operands[1], position); in doRewrite()
2070 doRewrite(fir::InsertOnRangeOp range, mlir::Type ty, OpAdaptor adaptor, in doRewrite()
2105 loc, ty, lastOp, insertVal, in doRewrite()
2119 range, ty, lastOp, insertVal, in doRewrite()
2137 doRewrite(fir::cg::XArrayCoorOp coor, mlir::Type ty, OpAdaptor adaptor, in doRewrite()
2220 rewriter.replaceOpWithNewOp<mlir::LLVM::BitcastOp>(coor, ty, addr); in doRewrite()
2235 rewriter.replaceOpWithNewOp<mlir::LLVM::GEPOp>(coor, ty, casted, args); in doRewrite()
2260 base = rewriter.create<mlir::LLVM::BitcastOp>(loc, ty, operands[0]); in doRewrite()
2276 rewriter.replaceOpWithNewOp<mlir::LLVM::GEPOp>(coor, ty, base, args); in doRewrite()
2292 doRewrite(fir::CoordinateOp coor, mlir::Type ty, OpAdaptor adaptor, in doRewrite()
2307 mlir::Value gep = genGEP(loc, ty, rewriter, base, offs); in doRewrite()
2314 return doRewriteBox(coor, ty, operands, loc, rewriter); in doRewrite()
2318 return doRewriteRefOrPtr(coor, ty, operands, loc, rewriter); in doRewrite()
2324 static unsigned getFieldNumber(fir::RecordType ty, mlir::Value op) { in getFieldNumber()
2325 return fir::hasDynamicSize(ty) in getFieldNumber()
2391 doRewriteBox(fir::CoordinateOp coor, mlir::Type ty, mlir::ValueRange operands, in doRewriteBox()
2479 rewriter.replaceOpWithNewOp<mlir::LLVM::BitcastOp>(coor, ty, resultAddr); in doRewriteBox()
2484 doRewriteRefOrPtr(fir::CoordinateOp coor, mlir::Type ty, in doRewriteRefOrPtr()
2580 mlir::Value retval = genGEP(loc, ty, rewriter, base, offs); in doRewriteRefOrPtr()
2850 auto ty = caseOp.getSelector().getType(); in matchAndRewrite() local
2851 if (ty.isa<fir::CharacterType>()) { in matchAndRewrite()
3078 mlir::Type ty = convertType(zero.getType()); in matchAndRewrite() local
3079 if (ty.isa<mlir::LLVM::LLVMPointerType>()) { in matchAndRewrite()
3080 rewriter.replaceOpWithNewOp<mlir::LLVM::NullOp>(zero, ty); in matchAndRewrite()
3081 } else if (ty.isa<mlir::IntegerType>()) { in matchAndRewrite()
3083 zero, ty, mlir::IntegerAttr::get(zero.getType(), 0)); in matchAndRewrite()
3084 } else if (mlir::LLVM::isCompatibleFloatingPointType(ty)) { in matchAndRewrite()
3086 zero, ty, mlir::FloatAttr::get(zero.getType(), 0.0)); in matchAndRewrite()
3129 mlir::Type ty = structTy.getBody()[0]; in matchAndRewrite() local
3132 ptr = rewriter.create<mlir::LLVM::ExtractValueOp>(loc, ty, ptr, c0); in matchAndRewrite()
3152 mlir::Type ty = convertType(absent.getType()); in matchAndRewrite() local
3156 auto structTy = ty.cast<mlir::LLVM::LLVMStructType>(); in matchAndRewrite()
3158 auto undefStruct = rewriter.create<mlir::LLVM::UndefOp>(loc, ty); in matchAndRewrite()
3164 absent, ty, undefStruct, nullField, c0); in matchAndRewrite()
3166 rewriter.replaceOpWithNewOp<mlir::LLVM::NullOp>(absent, ty); in matchAndRewrite()
3189 mlir::Type ty = lowering.convertType(sumop.getType()); in complexSum() local
3196 auto r0 = rewriter.create<mlir::LLVM::UndefOp>(loc, ty); in complexSum()
3197 auto r1 = rewriter.create<mlir::LLVM::InsertValueOp>(loc, ty, r0, rx, c0); in complexSum()
3198 return rewriter.create<mlir::LLVM::InsertValueOp>(loc, ty, r1, ry, c1); in complexSum()
3250 mlir::Type ty = convertType(mulc.getType()); in matchAndRewrite() local
3261 auto ra = rewriter.create<mlir::LLVM::UndefOp>(loc, ty); in matchAndRewrite()
3262 auto r1 = rewriter.create<mlir::LLVM::InsertValueOp>(loc, ty, ra, rr, c0); in matchAndRewrite()
3263 auto r0 = rewriter.create<mlir::LLVM::InsertValueOp>(loc, ty, r1, ri, c1); in matchAndRewrite()
3287 mlir::Type ty = convertType(divc.getType()); in matchAndRewrite() local
3303 auto ra = rewriter.create<mlir::LLVM::UndefOp>(loc, ty); in matchAndRewrite()
3304 auto r1 = rewriter.create<mlir::LLVM::InsertValueOp>(loc, ty, ra, rr, c0); in matchAndRewrite()
3305 auto r0 = rewriter.create<mlir::LLVM::InsertValueOp>(loc, ty, r1, ri, c1); in matchAndRewrite()
3322 auto ty = convertType(neg.getType()); in matchAndRewrite() local
3331 auto r = rewriter.create<mlir::LLVM::InsertValueOp>(loc, ty, o0, nrp, c0); in matchAndRewrite()
3332 rewriter.replaceOpWithNewOp<mlir::LLVM::InsertValueOp>(neg, ty, r, nip, c1); in matchAndRewrite()