Lines Matching defs:ExtValue
678 using ExtValue = fir::ExtendedValue;
689 ExtValue genExtAddr(const Fortran::lower::SomeExpr &expr) {
695 ExtValue genBoxArg(const Fortran::lower::SomeExpr &expr) {
698 ExtValue result = gen(expr);
703 ExtValue genExtValue(const Fortran::lower::SomeExpr &expr) {
718 ExtValue exv = Fortran::common::visit(
728 ExtValue genMutableBoxValueImpl(const T &) {
738 ExtValue genMutableBoxValueImpl(const Fortran::evaluate::NullPointer &) {
751 ExtValue
757 ExtValue
761 [&](const Fortran::evaluate::SymbolRef &sym) -> ExtValue {
764 [&](const Fortran::evaluate::Component &comp) -> ExtValue {
767 [&](const auto &) -> ExtValue {
775 ExtValue genMutableBoxValueImpl(const Fortran::evaluate::Expr<T> &expr) {
784 ExtValue e = genval(expr);
815 const ExtValue &left, const ExtValue &right,
835 ExtValue left = genval(ex.left());
841 const ExtValue &left, const ExtValue &right) {
849 ExtValue left = genval(ex.left());
856 const ExtValue &left, const ExtValue &right) {
862 ExtValue left = genval(ex.left());
868 ExtValue gen(Fortran::semantics::SymbolRef sym) {
875 ExtValue genLoad(const ExtValue &exv) {
879 ExtValue genval(Fortran::semantics::SymbolRef sym) {
881 ExtValue var = gen(sym);
898 ExtValue ptr = gen(ptrSym);
902 ExtValue pte = gen(sym);
915 ExtValue genval(const Fortran::evaluate::BOZLiteralConstant &) {
922 ExtValue genval(const Fortran::evaluate::ProcedureDesignator &proc) {
926 ExtValue genval(const Fortran::evaluate::NullPointer &) {
944 ExtValue genval(const Fortran::evaluate::StructureConstructor &ctor) {
959 ExtValue from = gen(expr);
979 ExtValue to = fir::factory::componentToExtendedValue(builder, loc, coor);
982 ExtValue value = genval(expr);
986 ExtValue value = genval(expr);
1022 ExtValue genval(const Fortran::evaluate::ImpliedDoIndex &var) {
1031 ExtValue genval(const Fortran::evaluate::DescriptorInquiry &desc) {
1032 ExtValue exv = desc.base().IsSymbol() ? gen(getLastSym(desc.base()))
1060 ExtValue genval(const Fortran::evaluate::TypeParamInquiry &) {
1070 ExtValue genval(const Fortran::evaluate::ComplexComponent<KIND> &part) {
1075 ExtValue genval(const Fortran::evaluate::Negate<Fortran::evaluate::Type<
1083 ExtValue genval(const Fortran::evaluate::Negate<Fortran::evaluate::Type<
1095 ExtValue genval(const Fortran::evaluate::Negate<Fortran::evaluate::Type<
1100 ExtValue genval(const Fortran::evaluate::Negate<Fortran::evaluate::Type<
1106 mlir::Value createBinaryOp(const ExtValue &left, const ExtValue &right) {
1116 ExtValue left = genval(ex.left());
1123 ExtValue genval(const Fortran::evaluate::GenBinEvOp<Fortran::evaluate::Type< \
1145 ExtValue genval(const Fortran::evaluate::Divide<Fortran::evaluate::Type<
1155 ExtValue genval(
1164 ExtValue genval(
1174 ExtValue genval(const Fortran::evaluate::ComplexConstructor<KIND> &op) {
1181 ExtValue genval(const Fortran::evaluate::Concat<KIND> &op) {
1182 ExtValue lhs = genval(op.left());
1183 ExtValue rhs = genval(op.right());
1194 ExtValue
1237 ExtValue genval(const Fortran::evaluate::SetLength<KIND> &x) {
1248 ExtValue genval(const Fortran::evaluate::Relational<Fortran::evaluate::Type<
1254 ExtValue genval(const Fortran::evaluate::Relational<Fortran::evaluate::Type<
1260 ExtValue genval(const Fortran::evaluate::Relational<Fortran::evaluate::Type<
1266 ExtValue genval(const Fortran::evaluate::Relational<Fortran::evaluate::Type<
1271 ExtValue genval(const Fortran::evaluate::Relational<Fortran::evaluate::Type<
1276 ExtValue
1284 ExtValue
1291 [&](const fir::CharBoxValue &boxchar) -> ExtValue {
1302 [&](const fir::UnboxedValue &value) -> ExtValue {
1305 [&](auto &) -> ExtValue {
1311 ExtValue genval(const Fortran::evaluate::Parentheses<A> &op) {
1312 ExtValue input = genval(op.left());
1320 ExtValue genval(const Fortran::evaluate::Not<KIND> &op) {
1329 ExtValue genval(const Fortran::evaluate::LogicalOperation<KIND> &op) {
1354 ExtValue
1372 ExtValue genval(const Fortran::evaluate::ArrayConstructor<A> &) {
1376 ExtValue gen(const Fortran::evaluate::ComplexPart &x) {
1379 ExtValue exv = gen(x.complex());
1391 ExtValue genval(const Fortran::evaluate::ComplexPart &x) {
1396 ExtValue gen(const Fortran::evaluate::Substring &s) {
1402 -> ExtValue {
1423 [&](const fir::CharBoxValue &x) -> ExtValue {
1426 [&](const fir::CharArrayBoxValue &) -> ExtValue {
1431 [&](const auto &) -> ExtValue {
1437 ExtValue genval(const Fortran::evaluate::Substring &ss) {
1443 ExtValue genval(const Fortran::evaluate::Subscript &subs) {
1452 ExtValue genSubscript(const Fortran::evaluate::Subscript &subs) {
1456 ExtValue gen(const Fortran::evaluate::DataRef &dref) {
1460 ExtValue genval(const Fortran::evaluate::DataRef &dref) {
1490 ExtValue genComponent(const Fortran::evaluate::Component &cmpt) {
1494 ExtValue obj = gen(*base);
1517 ExtValue gen(const Fortran::evaluate::Component &cmpt) {
1525 [](auto &box) -> ExtValue { return box; });
1528 ExtValue genval(const Fortran::evaluate::Component &cmpt) {
1552 ExtValue genval(const Fortran::semantics::Bound &bound) {
1570 ExtValue genCoordinateOp(const ExtValue &array,
1585 ExtValue subVal = genSubscript(subsc.value());
1625 ExtValue genOffsetAndCoordinateOp(const ExtValue &array,
1646 ExtValue subVal = genSubscript(sub);
1681 [&](const fir::ArrayBoxValue &arr) -> ExtValue {
1689 [&](const fir::CharArrayBoxValue &arr) -> ExtValue {
1697 [&](const fir::BoxValue &arr) -> ExtValue {
1704 [&](const auto &) -> ExtValue {
1710 ExtValue genArrayCoorOp(const ExtValue &exv,
1722 ExtValue subVal = genSubscript(sub);
1736 ExtValue gen(const Fortran::evaluate::ArrayRef &aref) {
1737 ExtValue base = aref.base().IsSymbol() ? gen(getFirstSym(aref.base()))
1748 mlir::Value getLBound(const ExtValue &box, unsigned dim, mlir::Type ty) {
1756 ExtValue genval(const Fortran::evaluate::ArrayRef &aref) {
1760 ExtValue gen(const Fortran::evaluate::CoarrayRef &coref) {
1765 ExtValue genval(const Fortran::evaluate::CoarrayRef &coref) {
1771 ExtValue gen(const Fortran::evaluate::Designator<A> &des) {
1775 ExtValue genval(const Fortran::evaluate::Designator<A> &des) {
1790 ExtValue genFunctionRef(const Fortran::evaluate::FunctionRef<A> &funcRef) {
1800 ExtValue gen(const Fortran::evaluate::FunctionRef<A> &funcRef) {
1801 ExtValue retVal = genFunctionRef(funcRef);
1807 ExtValue
1822 ExtValue lowerIntrinsicArgumentAsBox(const Fortran::lower::SomeExpr &expr) {
1824 ExtValue exv = genBoxArg(expr);
1844 ExtValue genIntrinsicRef(
1849 llvm::SmallVector<ExtValue> operands;
1857 using ExvAndPresence = std::pair<ExtValue, std::optional<mlir::Value>>;
1860 ExtValue optionalArg = lowerIntrinsicArgumentAsInquired(expr);
1888 auto getArgument = [&](std::size_t i, bool loadArg) -> ExtValue {
1913 ExtValue exv =
1946 ExtValue optional = lowerIntrinsicArgumentAsInquired(*expr);
1999 ExtValue genStmtFunctionRef(const Fortran::evaluate::ProcedureRef &procRef) {
2046 ExtValue result = genval(details.stmtFunction().value());
2055 ExtValue genArrayTempFromMold(const ExtValue &mold,
2085 void genArrayCopy(ExtValue dest, ExtValue source) {
2091 ExtValue genProcedureRef(const Fortran::evaluate::ProcedureRef &procRef,
2093 ExtValue res = genRawProcedureRef(procRef, resultType);
2105 ExtValue genTempExtAddr(const Fortran::lower::SomeExpr &expr) {
2119 [&](const fir::CharBoxValue &boxChar) -> ExtValue {
2123 [&](const fir::UnboxedValue &v) -> ExtValue {
2132 [&](const fir::BoxValue &x) -> ExtValue {
2149 [&](const fir::PolymorphicValue &p) -> ExtValue {
2152 [&](const auto &) -> ExtValue {
2162 ExtValue var;
2163 ExtValue temp;
2179 ExtValue readIfBoxValue(const ExtValue &exv) {
2189 ExtValue genCopyIn(const ExtValue &actualArg,
2208 auto doCopyIn = [&]() -> ExtValue {
2209 ExtValue temp = genArrayTempFromMold(actualArg, tempName);
2282 ExtValue temp = doCopyIn();
2294 ExtValue temp = doCopyIn();
2314 ExtValue temp = doCopyIn();
2321 ExtValue temp = doCopyIn();
2414 std::pair<ExtValue, mlir::Value>
2437 ExtValue actualArg = gen(expr);
2443 ExtValue safeToReadBox =
2451 createScalarTempForArgThatMayBeAbsent(ExtValue actualArg,
2490 std::pair<ExtValue, std::optional<mlir::Value>>
2513 [&]() -> std::pair<ExtValue, std::optional<mlir::Value>> {
2518 ExtValue baseAddr;
2522 const ExtValue &actualArg = actualArgBind;
2531 ExtValue temp =
2554 ExtValue box = genBoxArg(expr);
2565 ExtValue actualArg = genExtAddr(expr);
2582 ExtValue genRawProcedureRef(const Fortran::evaluate::ProcedureRef &procRef,
2626 ExtValue argVal = genval(*expr);
2688 ExtValue argAddr =
2826 ExtValue opt = lowerIntrinsicArgumentAsInquired(*expr);
2895 ExtValue argRef = genExtAddr(*expr);
2899 ExtValue argRef = genExtAddr(*expr);
2912 auto &result = std::get<ExtValue>(loweredResult);
2929 ExtValue genval(const Fortran::evaluate::FunctionRef<A> &funcRef) {
2930 ExtValue result = genFunctionRef(funcRef);
2936 ExtValue genval(const Fortran::evaluate::ProcedureRef &procRef) {
2964 ExtValue asArray(const A &x) {
2972 ExtValue asArrayArg(const Fortran::evaluate::Expr<A> &x) {
2977 ExtValue asArrayArg(const Fortran::evaluate::Expr<A> &x, const B &y) {
2982 ExtValue asArrayArg(const Fortran::evaluate::Designator<A> &, const B &x) {
2990 ExtValue asArrayArg(const A &, const B &x) {
3008 ExtValue gen(const Fortran::evaluate::Expr<A> &x) {
3024 ExtValue genval(const Fortran::evaluate::Expr<A> &x) {
3035 ExtValue genval(const Fortran::evaluate::Expr<Fortran::evaluate::Type<
3052 ExtValue genref(const A &a) {
3056 ExtValue genref(const A &a) {
3072 ExtValue genref(const T<A> &x) {
3254 using ExtValue = fir::ExtendedValue;
3316 ExtValue exv = lowerArrayExpression(rhs);
3421 void lowerAllocatableArrayAssignment(ExtValue lhs, CC rhsCC) {
3434 ExtValue exv = lowerArrayExpression(rhsCC, destination.getType());
3514 static ExtValue
3524 ExtValue lowerBoxedArrayExpr(const Fortran::lower::SomeExpr &exp) {
3529 ExtValue exv = f(IterationSpace{});
3539 static ExtValue
3546 ExtValue loopRes = ael.lowerArrayExpression(expr);
3640 [[maybe_unused]] ExtValue loopRes = lowerArrayExpression(expr);
3671 ccStoreToDest = [=](IterSpace iters) -> ExtValue {
3749 ExtValue lowerScalarAssignment(const Fortran::lower::SomeExpr &lhs,
3785 static ExtValue lowerScalarUserAssignment(
3799 ExtValue lowerScalarUserAssignment(mlir::func::FuncOp userAssignment,
3880 ExtValue exv = x.base().IsSymbol() ? asScalarRef(getFirstSym(x.base()))
3947 ExtValue lowerArrayExpression(const Fortran::lower::SomeExpr &exp) {
3959 ExtValue lowerArrayExpression(const ExtValue &exv) {
4036 return [=](IterSpace iterSpace) -> ExtValue {
4087 ExtValue lowerArrayExpression(CC f, mlir::Type resultTy) {
4177 ExtValue exv = asScalarRef(*passArg->UnwrapExpr());
4558 ExtValue asScalar(const A &x) {
4567 ExtValue asScalarArray(const A &x) {
4575 ExtValue asScalarRef(const A &x) {
4584 ExtValue asInquired(const A &x) {
4626 return [=](IterSpace iters) -> ExtValue {
4632 return [=](IterSpace iters) -> ExtValue {
4668 ExtValue optionalArg = this->asInquired(expr);
4672 [=](IterSpace iters) -> ExtValue {
4693 return [=](IterSpace iters) -> ExtValue {
4694 auto getArgument = [&](std::size_t i, bool) -> ExtValue {
4758 llvm::SmallVector<ExtValue> args;
4828 [=](IterSpace iters) -> ExtValue { return temp; });
4836 ExtValue exv = asScalarRef(*expr);
4852 [=](IterSpace iters) -> ExtValue { return argVal; });
4866 ExtValue argRef = asScalarRef(*expr);
4870 [=](IterSpace iters) -> ExtValue { return tuple; });
4877 ExtValue exv = asScalarRef(*expr);
4884 operands.emplace_back([=](IterSpace iters) -> ExtValue {
4895 ExtValue exv = asScalarRef(*expr);
4898 [=](IterSpace iters) -> ExtValue { return exv; });
4902 operands.emplace_back([=](IterSpace iters) -> ExtValue {
4926 caller = std::move(caller)](IterSpace iters) mutable -> ExtValue {
4943 return std::get<ExtValue>(res);
5065 ExtValue result = asScalar(x);
5093 static ExtValue convertAdjustedType(fir::FirOpBuilder &builder,
5095 const ExtValue &exv) {
5097 [&](const fir::CharBoxValue &cb) -> ExtValue {
5103 ExtValue{result}, exv);
5106 [&](const auto &) -> ExtValue {
5117 return [=](IterSpace iters) -> ExtValue {
5133 return [=](IterSpace iters) -> ExtValue {
5151 return [=](IterSpace iters) -> ExtValue {
5164 return [=](IterSpace iters) -> ExtValue {
5193 return [=](IterSpace iters) -> ExtValue {
5202 return [=](IterSpace iters) -> ExtValue {
5216 return [=](IterSpace iters) -> ExtValue {
5256 return [=](IterSpace iters) -> ExtValue {
5270 return [=](IterSpace iters) -> ExtValue {
5284 return [=](IterSpace iters) -> ExtValue {
5290 return [=](IterSpace iters) -> ExtValue {
5319 return [=](IterSpace iters) -> ExtValue {
5332 return [=](IterSpace iters) -> ExtValue {
5355 return [=](IterSpace iters) -> ExtValue {
5418 mlir::Value getLBound(const ExtValue &x, unsigned dim, mlir::Value one) {
5424 mlir::Value getUBound(const ExtValue &x, unsigned dim, mlir::Value one) {
5433 mlir::Value getExtent(const ExtValue &x, unsigned dim) {
5438 ExtValue genArrayBase(const A &base) {
5497 void genSliceIndices(ComponentPath &cmptData, const ExtValue &arrayExv,
5685 ExtValue abstractArrayExtValue(mlir::Value val, mlir::Value len = {}) {
5689 CC genarr(const ExtValue &extMemref) {
5729 CC genarr(const ExtValue &extMemref, ComponentPath &components,
5835 return [=](IterSpace) -> ExtValue {
5847 return [=](IterSpace iters) -> ExtValue {
5895 return [=](IterSpace iters) -> ExtValue { return lambda(iters); };
5902 return [=](IterSpace iters) -> ExtValue {
5920 return [=](IterSpace) -> ExtValue { return arrLd; };
5929 return [=](IterSpace iters) -> ExtValue {
5951 return [=](IterSpace iters) -> ExtValue {
5982 ExtValue optionalArg = asInquired(expr);
5995 ExtValue exv = optionalArg;
6026 auto cc = [=](IterSpace iters) -> ExtValue {
6049 ExtValue optionalArg = asInquired(expr);
6053 return [=](IterSpace iters) -> ExtValue { return elementValue; };
6060 return [=](IterSpace iters) -> ExtValue {
6141 mlir::Value computeElementSize(const ExtValue &exv, mlir::Type eleTy,
6239 mlir::Value copyNextArrayCtorSection(const ExtValue &exv, mlir::Value buffPos,
6318 auto doTrivialScalar = [&](const ExtValue &v, mlir::Value len = {}) {
6332 [&]() -> ExtValue {
6377 std::pair<ExtValue, bool>
6389 std::pair<ExtValue, bool>
6547 return [](IterSpace iters) -> ExtValue { return mlir::Value{}; };
6551 return [](IterSpace iters) -> ExtValue { return mlir::Value{}; };
6555 return [](IterSpace iters) -> ExtValue { return mlir::Value{}; };
6568 return [=](IterSpace iters) -> ExtValue {
6580 return [=](IterSpace iters) -> ExtValue {
6594 return [=](IterSpace iters) -> ExtValue {
6631 return [=](IterSpace iters) -> ExtValue {
6649 return [=](IterSpace iters) -> ExtValue {
6732 mlir::Type lowerPath(const ExtValue &arrayExv, ComponentPath &components) {
7042 ExtValue exv = asScalarRef(x);
7060 ExtValue ptr = converter.getSymbolExtendedValue(ptrSym);
7064 ExtValue exv = asScalarRef(x);
7075 IterSpace iters) -> ExtValue {
7076 ExtValue exv = asScalarRef(x);
7121 return [=](IterSpace) -> ExtValue {
7150 return [=](IterSpace) -> ExtValue {
7188 return [=](IterSpace) -> ExtValue {