Lines Matching +defs:add +defs:to +defs:list

76 // to the correct FIR representation in SSA form.
84 // The default attempts to balance a modest allocation size with expected user
85 // input to minimize bounds checks and reallocations during dynamic array
103 // If it is set to false, then TRANSPOSE will be lowered using
104 // a runtime call. If it is set to true, then the lowering is controlled
113 // either produce loops to copy the data or call the Fortran runtime's
116 // to optimizations, instead, the optimizer just wastes compilation
120 // to true. It is false by default.
124 // such objects is contiguous, it may be better to expose them
125 // to the optimizer.
149 /// In line 1, `vp1` is a BoxAddr to copy a box value into. The box value is
151 /// In line 2, `v1` is a DataAddr to copy a value into. The value is constructed
165 DataValue, // refers to the value `x`
166 DataAddr, // refers to the address `v`
167 BoxValue, // refers to a box value containing `v`
168 BoxAddr, // refers to the address of a box value containing `v`
175 // Referentially transparent. Refers to the array's value, `[xs]`.
177 // Refers to an ephemeral address `tmp` containing value `x_i` (15.5.2.3.p7
178 // note 2). (Passing a copy by reference to simulate pass-by-value.)
180 // Refers to the merge of array value `[xs]` with another array value `[ys]`.
183 // Similar to CopyInCopyOut but `a` may be a transient projection (rather than
186 // Similar to ProjectedCopyInCopyOut, except the merge value is not assigned
188 // accessible so that custom assignments to `[xs]` can be implemented.
190 // Referentially opaque. Refers to the address of `x_i`.
194 /// Convert parser's INTEGER relational operators to MLIR. TODO: using
195 /// unordered, but we may want to cons ordered in certain situation.
234 /// Convert parser's REAL relational operators to MLIR.
268 // when passed to CMPLX as per 15.5.2.12 point 3 (7) and (8)). It is
269 // therefore possible to catch them in the `then` case above.
274 /// Convert the array_load, `load`, to an extended value. If `path` is not
288 fir::emitFatalError(loc, "path does not apply to type");
354 TODO(loc, "path to a POINTER, ALLOCATABLE, or other component that requires "
360 /// \p forceValueType is provided, the value is first casted to the provided
362 /// may be `i1` but needed to be stored as Fortran logicals).
372 "only expect statically sized scalars to be by value");
389 assert(exv.rank() == 0 && "input to scalar memory copy must be a scalar");
456 loc, "attempting to load whole array or procedure address");
462 /// If \p exv is considered absent according to 15.5.2.12 point 1., the returned
486 /// absent. If \p exv is considered absent according to 15.5.2.12 point 1., the
493 // because it is passed to a non-pointer/non-allocatable.
502 /// absent. If \p exv is considered absent according to 15.5.2.12 point 1., the
514 // Optional allocatable/pointer -> Cannot be absent, but need to translate
530 /// Is this a call to an elemental procedure with at least one array argument?
552 /// \p funcAddr argument to a boxproc value, with the host-association as
553 /// required. Call the factory function to finish creating the tuple value.
564 // actual arguments of other types to be passed instead.
565 // To support this, we cast any reference to the expected type or extract
587 /// code may need to unconditionally read a fir.box that can be absent.
605 // Helper to get the ultimate first symbol. This works around the fact that
606 // symbol resolution in the front end doesn't always resolve a symbol to its
615 // Helper to get the ultimate last symbol.
629 // A set of visitors to detect if the given expression
693 /// Lower `expr` to be passed as a fir.box argument. Do not create a temp
707 /// Lower an expression that is a pointer or an allocatable to a
716 // NULL() requires some context to be lowered, so it is not handled
717 // here and must be lowered according to the context where it appears.
723 fir::emitFatalError(getLoc(), "expr was not lowered to MutableBoxValue");
736 /// scalar fir.box is created: it should not be cast to an array box type
737 /// later, but there is no way to enforce that here.
853 /// Create a call to the runtime to compare two CHARACTER values.
866 /// Returns a reference to a symbol or its box/boxChar descriptor if it has
885 // tags all result variables with one of the largest types to allow
886 // them to share the same storage. A reference to a result variable
887 // of one of the other types requires conversion to the actual type.
919 /// Return indirection to function designated in ProcedureDesignator.
920 /// The type of the function indirection is not guaranteed to match the one
921 /// of the ProcedureDesignator due to Fortran implicit typing rules.
941 /// constructed inline. This allows it to be the body of a GlobalOp.
979 ExtValue to = fir::factory::componentToExtendedValue(builder, loc, coor);
980 to.match(
983 fir::factory::genScalarAssignment(builder, loc, to, value);
987 fir::factory::genScalarAssignment(builder, loc, to, value);
990 Fortran::lower::createSomeArrayAssignment(converter, to, expr,
994 Fortran::lower::createSomeArrayAssignment(converter, to, expr,
1026 // the original data type. So we need to cast it appropriately.
1395 /// Reference to a substring.
1406 // TODO: convert StaticDataObject to Constant<T> and use normal
1465 // Helper function to turn the Component structure into a list of nested
1466 // components, ordered from largest/leftmost to smallest/rightmost:
1474 std::list<const Fortran::evaluate::Component *> &list) {
1476 list.push_front(&cmpt);
1482 return reverseComponents(x, list);
1491 std::list<const Fortran::evaluate::Component *> list;
1492 const Fortran::evaluate::DataRef *base = reverseComponents(cmpt, list);
1498 // FIXME: need to thread the LEN type parameters here.
1499 for (const Fortran::evaluate::Component *field : list) {
1519 // aspect is lost to simplify handling on the client side. To retain the
1569 /// Lower an ArrayRef to a fir.coordinate_of given its lowered base.
1573 // References to array of rank > 1 with non constant shape that are not
1618 /// Lower an ArrayRef to a fir.coordinate_of using an element offset instead
1621 /// and use the offset to access the element with a fir.coordinate_of. This
1622 /// must only be used if it is not possible to generate a normal
1677 // Convert to expected, original type after address arithmetic.
1709 /// Lower an ArrayRef to a fir.array_coor.
1719 // The ArrayRef is expected to be scalar here, arrays are handled in array
1739 // Check for command-line override to use array_coor op.
1797 /// Lower function call `funcRef` and return a reference to the resultant
1806 /// Helper to lower intrinsic arguments for inquiry intrinsic.
1811 /// Do not create temps for array sections whose properties only need to be
1819 /// Helper to lower intrinsic arguments to a fir::BoxValue.
1843 /// Generate a call to a Fortran intrinsic or intrinsic module procedure.
1919 // IS_CONTIGUOUS may require an assumed size TYPE(*) to be passed to
1988 /// helper to detect statement functions
2004 // Statement functions have their own scope, we just need to associate
2005 // the dummy symbols to argument expressions. They are no
2007 // recursive (directly or indirectly) so it is safe to add dummy symbols to
2020 // scalars, so just pass the box with the address. The only care is to
2021 // to use the dummy character explicit length if any instead of the
2037 // Explicitly map statement function host associated symbols to their
2053 /// length parameters and type as mold. It is up to the caller to deallocate
2107 // parentheses to avoid creating array temporary in sub-expressions. It only
2157 /// Helper structure to track potential copy-in of non contiguous variable
2158 /// argument into a contiguous temp. It is used to deallocate the temp that
2159 /// may have been created as well as to the copy-out from the temp to the
2164 // Flag to indicate if the argument may have been modified by the
2165 // callee, in which case it must be copied-out to the variable.
2173 /// Helper to read any fir::BoxValue into other fir::ExtendedValue categories
2176 /// should only be called if \p exv is known to be contiguous or if its base
2185 /// Generate a contiguous temp to pass \p actualArg as argument \p arg. The
2214 // So we need to make a copy, if finalization may occur.
2215 // TODO: do we have to avoid the copying for an actual
2219 // If it has to be automatically deallocated at the end
2224 // We have to initialize the temp if it may have components
2238 // Generate AssignTemporary() call to copy data from the actualArg
2239 // to a temporary. AssignTemporary() will initialize the temporary,
2299 // Otherwise, need to be careful to only copy-in if allowed at runtime.
2363 // Generate CopyOutAssign() call to copy data from the temporary
2364 // to the actualArg. Note that in case the actual argument
2384 // Create descriptor pointer to variable descriptor if copy out is needed,
2406 /// Lower a designator to a variable that may be absent at runtime into an
2408 /// parameters) can be safely read (set to zero if not present). It also
2411 /// This is useful to later be able to do conditional copy-in/copy-out
2412 /// or to retrieve the base address without having to deal with the case
2419 // it is as if the argument was absent. The main care here is to
2421 // pointing to a null size storage, would not be a nullptr and
2424 // absent as per 15.5.2.12 point 7. and 8. We rely on this to
2435 // create an descriptor pointing to a null address here if the
2486 /// copying has to be conditional at runtime.
2498 // It must be possible to modify VALUE arguments on the callee side, even
2571 // Scalar and contiguous expressions may be lowered to a fir.box,
2572 // either to account for potential polymorphism, or because lowering
2575 // is passed, not one of the dynamic type), and the expr is known to
2576 // be simply contiguous, so it is safe to unbox it and pass the
2586 fir::emitFatalError(loc, "trying to lower elemental procedure with array "
2609 // Lower the actual arguments and map the lowered values to the dummy
2642 // callee side, and it is illegal to use NULL without a MOLD if any
2656 // Passing a non POINTER actual argument to a POINTER dummy argument.
2658 // argument to it.
2671 // Passing a POINTER to a POINTER, or an ALLOCATABLE to an ALLOCATABLE.
2721 // type to be passed to a procedure expecting a CHARACTER in the
2723 // argument is simply assumed to point to CHARACTER data and the
2725 // free-casting the base address to be a !fir.char reference and
2726 // setting the LEN argument to undefined. What could go wrong?
2741 // prepareActualToBaseAddressLike that is intended to prepare
2745 TODO(loc, "passing a polymorphic entity to an OPTIONAL "
2749 TODO(loc, "passing to an OPTIONAL CONTIGUOUS derived type argument "
2752 TODO(loc, "passing an assumed rank entity to an OPTIONAL "
2772 // Before lowering to an address, handle the allocatable/pointer
2773 // actual argument to optional fir.box dummy. It is legal to pass
2774 // unallocated/disassociated entity to an optional. In this case, an
2778 // Note that passing an absent allocatable to a non-allocatable
2780 // nothing has to be done to generate an absent argument in this case,
2781 // and it is OK to unconditionally read the mutable box here.
2787 /// For now, assume it is not OK to pass the allocatable/pointer
2788 /// descriptor to a non pointer/allocatable dummy. That is a strict
2796 // !fir.box<none> to !fir.class<none> when the argument is
2809 // Need the box types to be exactly similar for the selectOp.
2817 // Special case when an intrinsic scalar variable is passed to a
2820 // The presence test needs to be performed before emboxing otherwise
2948 /// Helper to detect Transformational function reference.
2970 /// value, so it may be possible to avoid making a temporary.
2983 // Designator is being passed as an argument to a procedure. Lower the
2984 // expression to a boxed value.
2991 // If the expression to pass as an argument is not a designator, then create
3013 // is used to not create a new temporary storage.
3109 /// Helper to generate calls to scalar user defined assignment procedures.
3154 /// Convert the result of a fir.array_modify to an ExtendedValue given the
3216 // Update the LEN to the substring's LEN.
3228 /// the actual extents and lengths. This is only to allow their propagation as
3231 /// ExtendedValue should be used, it is undefined to use the length or extents
3256 /// Structure to keep track of lowered array operands in the
3257 /// array expression. Useful to later deduce the shape of the
3358 // Array assignment to array of pointer box values.
3361 /// Entry point for assignment to pointer in an array of pointers.
3378 /// Pointers may be bound to targets in a FORALL context. This is a scalar
3380 /// the pointer is to a target with non-zero rank. Since the pointer
3401 // Array assignment to allocatable array
3404 /// Entry point for assignment to allocatable array.
3417 /// Lower an assignment to allocatable array, where the LHS array
3429 // destShape is either non-null on entry to this function,
3443 // in different branches, so we have to reset it,
3449 /// Assignment to allocatable array.
3453 /// resized/reallocated to fit if necessary.
3456 // With assignment to allocatable, we want to lower the rhs first and use
3457 // its shape to determine if we need to reallocate, etc.
3460 // be to an array of allocatable arrays rather than a single allocatable
3463 TODO(loc, "assignment to whole allocatable array inside FORALL");
3475 // Currently no safe way to gather length from rhs (at least for
3480 TODO(loc, "gather rhs LEN parameters in assignment to allocatable");
3576 /// variable containing the pointer to the buffer is \p var and the variable
3594 // Create a dummy array_load before the loop. We're storing to a lazy
3611 // Custom lowering of the element store to deal with the extra indirection
3612 // to the lazy allocated buffer.
3637 // was stored to the ragged array temporary. The local temps will not
3719 // resolved to the correct procedure. Look for the pass object in the
3755 // 2) Lower the lhs expression to an array_update.
3762 // in which case there is no array to thread.
3779 // to thread through the iteration space.
3809 // 2) Lower the lhs expression to an array_modify.
3826 // LHS is ill formed, it is a scalar with no references to FORALL
3867 TODO(getLoc(), "coarray: reference to a coarray in an expression");
3924 /// When in an explicit space, the ranked component must be evaluated to
3930 // FIXME: We may not want to use ExtractDataRef here since it doesn't deal
3942 assert(pathTy && "indices failed to apply to type");
3974 /// Convert the original value, \p origVal, to type \p eleTy. When in a
3992 // This is a pointer assignment and the rhs is a raw reference to a TARGET
3993 // in memory. Embox the reference so it can be stored to the boxed
4031 /// Default store to destination implementation.
4032 /// This implements the default case, which is to assign the value in
4047 // Get a reference to the array element to be amended.
4083 /// \p resultTy will be created to hold the evaluated expression.
4149 // is allowed to be absent as per 15.5.2.12 point 3. (6). Just pick the
4151 // TODO: There is an opportunity to add a runtime check here that
4171 // Otherwise, in elemental context, try to find the passed object and
4187 "failed to compute the array expression shape");
4284 /// WHERE syntax. Since it is legal for mask expressions to have side-effects
4321 // Index into the ragged buffer to retrieve cached results.
4375 // Convert any implied shape to closed interval form. The fir.do_loop will
4376 // run from 0 to `extent - 1` inclusive.
4416 // Move insertion point to the start of the innermost loop in the nest.
4418 // Set `afterLoopNest` to just after the entire loop nest.
4424 // Put the implicit loop variables in row to column order to match FIR's
4425 // Ops. (The loops were constructed from outermost column to innermost
4435 /// The resultType is used to create a temporary, if needed.
4466 // clauses. See 10.2.3.2p4 as to why this control structure is produced.
4498 // We're ready to lower the body (an assignment statement) for this context
4513 // TODO: Need to thread the LEN parameters here. For character, they may
4563 /// space, the expression may be scalar and refer to an array. We want to
4564 /// raise the array access to array operations in FIR to analyze potential
4573 /// Lower the expression in a scalar context to a memory reference.
4582 /// meant to inquire about its status before addressing the related entity.
4601 /// and deallocate the resources now. This should be done just prior to the
4624 // Parenthesised variables are lowered to a reference to the variable
4648 // A reference to a Fortran elemental intrinsic or intrinsic module procedure.
4723 // a potentially absent argument to something else than a value (apart
4766 /// Lower a procedure reference to a user-defined elemental procedure.
4807 "passing dynamically optional argument to elemental procedures");
4815 // VALUE attribute or pass-by-reference to a copy semantics. (byval*)
4820 // Store scalar value in a temp to fulfill VALUE attribute.
5003 // according to 15.8.3 p1.
5047 // the iterations to the result, which may be an array value.
5372 // A vector subscript expression may be wrapped with a cast to INTEGER*8.
5396 // be used to determine the lbound, ubound of the vector.
5428 auto add = builder.create<mlir::arith::AddIOp>(loc, lb, extent);
5429 return builder.create<mlir::arith::SubIOp>(loc, add, one);
5466 TODO(getLoc(), "expected vector to have an extent");
5496 /// resulting type, and a continuation to adjust the default iteration space.
5567 // from a vector to determine the temporary array value.
5569 // multiple updates to any specific array element through a
5611 // array, so the iteration space must also be extended to
5612 // include this expression in this dimension to adjust to
5620 // Cast `e` to index type.
5627 // Add lbound adjusted value of `e` to the iteration vector
5740 // Append the substring operator to emboxing Op as it will become an
5741 // interior adjustment (add offset, adjust LEN) to the CHARACTER value
5745 // Convert to (offset, size)
5762 // Convert the lower bound to 0-based substring.
5767 // Convert the upper bound to a length.
5801 // Semantics are a reference to a boxed array.
5802 // This case just requires that an embox operation be created to box the
5810 // Adjust char length to substring size.
5841 // Semantics are an opaque reference to an array.
5843 // arithmetic to the array element. This does not have copy-in/copy-out
5844 // semantics. No attempt to copy the array value will be made during the
5898 // Create an array_modify to get the LHS element address and indicate
5984 // Generate an array load and access to an array that may be an absent
6015 // Mark the load to tell later passes it is unsafe to use this array_load
6020 // shape will only be used as a fallback to induce the implicit loop nest
6035 /// Generate a continuation to pass \p expr to an OPTIONAL argument of an
6036 /// elemental procedure. This is meant to handle the cases where \p expr might
6038 /// OPTIONAL variable). If p\ expr is guaranteed to be present genarr() can
6078 /// Reduce the rank of a array to be boxed based on the slice's operands.
6148 // Array of char with dynamic LEN parameter. Downcast to an array
6190 /// Create a call to the LLVM memcpy intrinsic.
6200 // Construct code to check for a buffer overrun and realloc the buffer when
6201 // space is depleted. This is done between each item in the ac-value-list.
6292 // Lambda to lower an abstract array box value.
6303 // Copy the elements to the buffer.
6375 // Lower the expr cases in an ac-value-list.
6387 // Lower an ac-implied-do in an ac-value-list.
6407 // create a new binding for x.name(), to ac-do-variable, to the iteration
6448 // Convert to extended value.
6458 // constructors are always lowered to the incremental construction code
6460 // MemToReg pass and constant folding, the optimizer should be able to
6475 // Allocate space for the array to be constructed.
6725 /// Lower the path (`revPath`, in reverse) to be appended to an array_fetch or
6730 /// TODO: This needs to deal with array's with initial bounds other than 1.
6793 // Lower scalar index expression, append it to
6797 // arrayExv is the base array. It needs to reflect
6956 // Create an array_modify to get the LHS element address and indicate
6957 // the assignment, and create the call to the user defined assignment.
7009 // Rhs is a regular expression that will need to be boxed before
7010 // assigning to the boxed variable.
7020 // FIXME: The typeparams to the load may be different than those of
7023 TODO(loc, "need to adjust typeparameter(s) to reflect the final "
7194 TODO(getLoc(), "coarray: reference to a coarray in an expression");
7273 /// element is passed to an impure procedure.
7283 /// Semantics to use when lowering the next array path.
7326 /// The continuation to generate code to update the destination.
7349 // Will be set to false if any of the expression parts prevent this.
7351 // ProcedureRef currently being lowered. Used to retrieve the iteration shape
7499 // MutableBox lowering StatementContext does not need to be propagated
7500 // to the caller because the result value is a variable, not a temporary
7517 // Handling special case where the last component is referring to the
7528 // y(:)%t ! just need to update the box with a slice pointing to the first
7530 // a%t ! simple conversion to TYPE(t).
7596 // Elemental user defined assignment has special requirements to deal with
7608 // TODO: need to array fetch/modify sub-arrays?
7618 // end does not add parentheses around the RHS argument in the call as it
7619 // should according to 15.4.3.4.3 p2.