Lines Matching defs:exv
343 fir::ExtendedValue exv = fir::factory::readBoxValue(builder, loc, oldBox);
344 auto extents = fir::factory::getExtents(loc, builder, exv);
345 auto origins = fir::factory::getNonDefaultLowerBounds(builder, loc, exv);
359 /// Place \p exv in memory if it is not already a memory reference. If
365 const fir::ExtendedValue &exv,
367 mlir::Value valBase = fir::getBase(exv);
369 return exv;
382 return fir::substBase(exv, temp);
385 // Copy a copy of scalar \p exv in a new temporary.
388 const fir::ExtendedValue &exv) {
389 assert(exv.rank() == 0 && "input to scalar memory copy must be a scalar");
390 if (exv.getCharBox() != nullptr)
391 return fir::factory::CharacterExprHelper{builder, loc}.createTempFrom(exv);
392 if (fir::isDerivedWithLenParameters(exv))
394 mlir::Type type = fir::unwrapPassByRefType(fir::getBase(exv).getType());
396 fir::factory::genScalarAssignment(builder, loc, temp, exv);
460 /// Create an optional dummy argument value from entity \p exv that may be
461 /// absent. This can only be called with numerical or logical scalar \p exv.
462 /// If \p exv is considered absent according to 15.5.2.12 point 1., the returned
463 /// value is zero (or false), otherwise it is the value of \p exv.
466 const fir::ExtendedValue &exv,
468 mlir::Type eleType = fir::getBaseTypeOf(exv);
469 assert(exv.rank() == 0 && fir::isa_trivial(eleType) &&
475 mlir::Value val = fir::getBase(genLoad(builder, loc, exv));
485 /// Create an optional dummy argument address from entity \p exv that may be
486 /// absent. If \p exv is considered absent according to 15.5.2.12 point 1., the
487 /// returned value is a null pointer, otherwise it is the address of \p exv.
490 const fir::ExtendedValue &exv,
492 // If it is an exv pointer/allocatable, then it cannot be absent
494 if (const auto *box = exv.getBoxOf<fir::MutableBoxValue>())
498 return exv;
501 /// Create an optional dummy argument address from entity \p exv that may be
502 /// absent. If \p exv is considered absent according to 15.5.2.12 point 1., the
504 /// exv.
507 const fir::ExtendedValue &exv,
510 if (exv.getBoxOf<fir::BoxValue>())
511 return exv;
513 fir::ExtendedValue newExv = exv;
516 if (const auto *box = exv.getBoxOf<fir::MutableBoxValue>())
519 // createBox will not do create any invalid memory dereferences if exv is
593 const fir::ExtendedValue &exv,
595 mlir::Value box = fir::getBase(exv);
602 return fir::substBase(exv, safeToReadBox);
718 ExtValue exv = Fortran::common::visit(
721 exv.getBoxOf<fir::MutableBoxValue>();
869 fir::ExtendedValue exv = converter.getSymbolExtendedValue(sym, &symMap);
870 if (const auto *box = exv.getBoxOf<fir::MutableBoxValue>())
872 return exv;
875 ExtValue genLoad(const ExtValue &exv) {
876 return ::genLoad(builder, getLoc(), exv);
1032 ExtValue exv = desc.base().IsSymbol() ? gen(getLastSym(desc.base()))
1043 return castResult(fir::factory::readCharLen(builder, loc, exv));
1046 builder, loc, exv, desc.dimension(),
1050 fir::factory::readExtent(builder, loc, exv, desc.dimension()));
1379 ExtValue exv = gen(x.complex());
1380 mlir::Value base = fir::getBase(exv);
1710 ExtValue genArrayCoorOp(const ExtValue &exv,
1713 mlir::Value addr = fir::getBase(exv);
1727 mlir::Value shape = builder.createShape(loc, exv);
1730 fir::getTypeParams(exv));
1731 return fir::factory::arrayElementToExtendedValue(builder, loc, exv,
1824 ExtValue exv = genBoxArg(expr);
1825 auto exvTy = fir::getBase(exv).getType();
1830 fir::getBase(exv));
1832 mlir::Value box = builder.createBox(loc, exv, exv.isPolymorphic());
1839 box, fir::factory::getNonDefaultLowerBounds(builder, loc, exv),
1840 fir::factory::getNonDeferredLenParams(exv));
1913 ExtValue exv =
1922 !mlir::isa<fir::BaseBoxType>(fir::getBase(exv).getType())) {
1924 fir::factory::createBoxValue(builder, loc, exv));
1928 operands.emplace_back(std::move(exv));
2176 /// should only be called if \p exv is known to be contiguous or if its base
2177 /// address will be replaced by a contiguous one. If \p exv is not a
2179 ExtValue readIfBoxValue(const ExtValue &exv) {
2180 if (const auto *box = exv.getBoxOf<fir::BoxValue>())
2182 return exv;
3316 ExtValue exv = lowerArrayExpression(rhs);
3319 builder.create<fir::ResultOp>(loc, fir::getBase(exv));
3322 loc, destination, fir::getBase(exv), destination.getMemref(),
3434 ExtValue exv = lowerArrayExpression(rhsCC, destination.getType());
3437 loc, destination, fir::getBase(exv), destination.getMemref(),
3529 ExtValue exv = f(IterationSpace{});
3530 if (mlir::isa<fir::BaseBoxType>(fir::getBase(exv).getType()))
3531 return exv;
3684 auto exv = lowerArrayExpression(rhs);
3687 builder.create<fir::ResultOp>(loc, fir::getBase(exv));
3690 loc, destination, fir::getBase(exv), destination.getMemref(),
3821 fir::ExtendedValue exv =
3823 genScalarUserDefinedAssignmentCall(builder, loc, userAssignment, exv,
3880 ExtValue exv = x.base().IsSymbol() ? asScalarRef(getFirstSym(x.base()))
3885 fir::factory::getExtents(loc, builder, exv);
3896 return getLBound(exv, ss.index(), one);
3901 return getUBound(exv, ss.index(), one);
3959 ExtValue lowerArrayExpression(const ExtValue &exv) {
3961 mlir::Type resTy = fir::unwrapPassByRefType(fir::getBase(exv).getType());
3962 return lowerArrayExpression(genarr(exv), resTy);
4039 fir::ExtendedValue exv = iterSpace.elementExv();
4057 loc, builder, arrayOp, dstLen, exv, innerArg, substringBounds);
4062 loc, destination, builder, arrayOp, exv, eleTy, innerArg);
4069 auto ele = convertElementForUpdate(loc, eleTy, fir::getBase(exv));
4090 auto exv = f(iterSpace);
4091 iterSpace.setElement(std::move(exv));
4177 ExtValue exv = asScalarRef(*passArg->UnwrapExpr());
4179 auto extents = fir::factory::getExtents(getLoc(), *builder, exv);
4836 ExtValue exv = asScalarRef(*expr);
4837 operands.emplace_back([=](IterSpace iters) { return exv; });
4877 ExtValue exv = asScalarRef(*expr);
4879 if (fir::isPolymorphicType(fir::getBase(exv).getType()))
4880 sourceBox = fir::getBase(exv);
4882 fir::dyn_cast_ptrOrBoxEleTy(fir::getBase(exv).getType());
4886 loc, fir::ReferenceType::get(innerTy), fir::getBase(exv),
4895 ExtValue exv = asScalarRef(*expr);
4896 if (mlir::isa<fir::BaseBoxType>(fir::getBase(exv).getType())) {
4898 [=](IterSpace iters) -> ExtValue { return exv; });
4901 fir::dyn_cast_ptrOrBoxEleTy(fir::getBase(exv).getType());
4906 loc, fir::ClassType::get(baseTy), fir::getBase(exv), empty,
4929 auto exv = cc(iters);
4930 auto arg = exv.match(
4935 [&](const auto &) { return fir::getBase(exv); });
5049 auto exv = isPtrAssn ? sel.genRawProcedureRef(procRef, retTy)
5051 return genarr(exv);
5095 const ExtValue &exv) {
5096 return exv.match(
5103 ExtValue{result}, exv);
5118 auto exv = lambda(iters);
5119 mlir::Value val = fir::getBase(exv);
5123 return convertAdjustedType(builder, loc, ty, exv);
5995 ExtValue exv = optionalArg;
6001 exv = absentBoxToUnallocatedBox(builder, loc, exv, isPresent);
6005 if (const auto *mutableBox = exv.getBoxOf<fir::MutableBoxValue>())
6006 exv = fir::factory::genMutableBoxRead(builder, loc, *mutableBox);
6008 mlir::Value memref = fir::getBase(exv);
6009 mlir::Value shape = builder.createShape(loc, exv);
6012 loc, arrType, memref, shape, noSlice, fir::getTypeParams(exv));
6030 builder, loc, exv, arrFetch, noSlice);
6141 mlir::Value computeElementSize(const ExtValue &exv, mlir::Type eleTy,
6150 // `exv`.
6151 exv.match(
6239 mlir::Value copyNextArrayCtorSection(const ExtValue &exv, mlir::Value buffPos,
6260 mlir::Value length = fir::getLen(exv);
6342 exv.match(
6343 [&](mlir::Value) { doTrivialScalar(exv); },
6347 doTrivialScalar(exv, eleSz);
6421 auto [exv, copyNeeded] = Fortran::common::visit(
6427 mlir::Value eleSz = computeElementSize(exv, eleTy, resTy);
6428 mem = copyNeeded ? copyNextArrayCtorSection(exv, buffPos, buffSize, mem,
6430 : fir::getBase(exv);
6434 builder.createConvert(loc, builder.getI64Type(), fir::getLen(exv));
6505 auto [exv, copyNeeded] = Fortran::common::visit(
6511 mlir::Value eleSz = computeElementSize(exv, eleTy, resTy);
6512 mem = copyNeeded ? copyNextArrayCtorSection(exv, buffPos, buffSize, mem,
6514 : fir::getBase(exv);
6518 builder.createConvert(loc, builder.getI64Type(), fir::getLen(exv));
7042 ExtValue exv = asScalarRef(x);
7043 lowerPath(exv, components);
7044 auto lambda = genarr(exv, components);
7064 ExtValue exv = asScalarRef(x);
7065 lowerPath(exv, components);
7066 auto lambda = genarr(exv, components, ptrVal);
7076 ExtValue exv = asScalarRef(x);
7077 mlir::Value addr = fir::getBase(exv);
7082 exv, iters.elementExv());
7092 return exv;
7646 auto exv = ScalarExprLowering{loc, converter, symMap, stmtCtx}.gen(*x);
7647 mlir::Value addr = fir::getBase(exv);
7648 mlir::Value shapeOp = builder.createShape(loc, exv);
7652 fir::getTypeParams(exv));