<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in shape.cpp</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>be68a6ad - [flang] Error detection/avoidance for TRANSFER with empty MOLD= type</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp#be68a6ad</link>
        <description>[flang] Error detection/avoidance for TRANSFER with empty MOLD= typeWhen MOLD= is an array and there is no SIZE= in a call to TRANSFER(),the size of an element of the MOLD= is used as the denominator in adivision to establish the extent of the vector result.  When thetotal storage size of the SOURCE= is known to be zero, the result isempty and no division is needed.To avoid a division by zero at runtime, we need to check for a zero-sizedMOLD= element type when the storage size of SOURCE= is nonzero and thereis no SIZE=.  Further, in the compilation-time rewriting of calls toSHAPE(TRANSFER(...)) and SIZE(TRANSFER(...)) for constant folding andsimplification purposes, we can&apos;t replace the call with an arithmeticelement count expression when the storage size of SOURCE= is not knownto be zero and the element size of MOLD= is not known to be nonzero atcompilation time.These changes mostly affect tests using a MOLD= argument that is anassumed-length character.Differential Revision: https://reviews.llvm.org/D129680

            List of files:
            /llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp</description>
        <pubDate>Fri, 08 Jul 2022 23:16:42 +0000</pubDate>
        <dc:creator>Peter Klausler &lt;pklausler@nvidia.com&gt;</dc:creator>
    </item>
<item>
        <title>cd03e96f - [flang] Add &amp; use a better visit() (take 2)</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp#cd03e96f</link>
        <description>[flang] Add &amp; use a better visit() (take 2)Adds flang/include/flang/Common/log2-visit.h, which definesa Fortran::common::visit() template function that is a drop-inreplacement for std::visit().  Modifies most use sites inthe front-end and runtime to use common::visit().The C++ standard mandates that std::visit() have O(1) executiontime, which forces implementations to build dispatch tables.This new common::visit() is O(log2 N) in the number of alternativesin a variant&lt;&gt;, but that N tends to be small and so this changeproduces a fairly significant improvement in compiler buildmemory requirements, a 5-10% improvement in compiler build time,and a small improvement in compiler execution time.Building with -DFLANG_USE_STD_VISIT causes common::visit()to be an alias for std::visit().Calls to common::visit() with multiple variant argumentsare referred to std::visit(), pending further work.This change is enabled only for GCC builds with GCC &gt;= 9;an earlier attempt (D122441) ran into bugs in some versions ofclang and was reverted rather than simply disabled; and it isnot well tested with MSVC. In non-GCC and older GCC builds,common::visit() is simply an alias for std::visit().

            List of files:
            /llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp</description>
        <pubDate>Wed, 23 Mar 2022 21:05:50 +0000</pubDate>
        <dc:creator>Peter Klausler &lt;pklausler@nvidia.com&gt;</dc:creator>
    </item>
<item>
        <title>ca2be81e - [flang] Fix Symbol::Rank for ProcEntityDetails</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp#ca2be81e</link>
        <description>[flang] Fix Symbol::Rank for ProcEntityDetailsWhen a procedure pointer or procedure dummy argument has adefined interface, the rank of the pointer (or dummy) is therank of the interface.Also tweak code discovered in shape analysis when investigatingthis problam so that it returns a vector of emptied extents ratherthan std::nullopt when the extents are not scope-invariant, so thatthe rank can at least be known.Differential Revision: https://reviews.llvm.org/D123727

            List of files:
            /llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp</description>
        <pubDate>Wed, 06 Apr 2022 22:55:53 +0000</pubDate>
        <dc:creator>Peter Klausler &lt;pklausler@nvidia.com&gt;</dc:creator>
    </item>
<item>
        <title>d0549597 - [flang] Fix shape analysis of RESHAPE result</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp#d0549597</link>
        <description>[flang] Fix shape analysis of RESHAPE resultShape analysis of RESHAPE(..., SHAPE=s) should of course returnthe SHAPE= actual argument when it is constant; but when it isnot, its length is still known, and thus so is the rank of theresult of RESHAPE(), and shape analysis should at least returna shape vector of the right length rather than a result thatmakes the result appear to be a scalar, which can lead to somebogus error messages.Also, while here: rename a private GetShapeHelper::AsShape()routine so that it can&apos;t be confused with the ones in the APIof shape.h.Differential Revision: https://reviews.llvm.org/D123712

            List of files:
            /llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp</description>
        <pubDate>Fri, 01 Apr 2022 23:01:04 +0000</pubDate>
        <dc:creator>Peter Klausler &lt;pklausler@nvidia.com&gt;</dc:creator>
    </item>
<item>
        <title>4ca111d4 - Revert &quot;[flang] Add &amp; use a better visit()&quot;</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp#4ca111d4</link>
        <description>Revert &quot;[flang] Add &amp; use a better visit()&quot;This reverts commit 2ab9990c9eb79682a4d4b183dfbc7612d3e55328. It hascaused multiple build failures:*  https://lab.llvm.org/buildbot/#/builders/177/builds/4346*  https://lab.llvm.org/buildbot/#/builders/180/builds/3803*  https://lab.llvm.org/buildbot/#/builders/175/builds/10419*  https://lab.llvm.org/buildbot/#/builders/191/builds/4318*  https://lab.llvm.org/buildbot/#/builders/173/builds/4274*  https://lab.llvm.org/buildbot/#/builders/181/builds/4297All these bots failed with a time-out:```command timed out: 1200 seconds without output running [b&apos;ninja&apos;, b&apos;-j&apos;, b&apos;32&apos;], attempting to kill```I&apos;m guessing that that&apos;s due to template instantiations failing at somepoint (https://reviews.llvm.org/D122441 introduced a customimplementation of std::visit). Everything seems fine when either:* building on X86 with GCC or Clang (tested with GCC 9.3 and Clang 12)* building on AArch64 with GCC (tested with GCC 11)

            List of files:
            /llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp</description>
        <pubDate>Mon, 28 Mar 2022 10:46:47 +0000</pubDate>
        <dc:creator>Andrzej Warzynski &lt;andrzej.warzynski@arm.com&gt;</dc:creator>
    </item>
<item>
        <title>2ab9990c - [flang] Add &amp; use a better visit()</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp#2ab9990c</link>
        <description>[flang] Add &amp; use a better visit()Adds flang/include/flang/Common/visit.h, which definesa Fortran::common::visit() template function that is a drop-inreplacement for std::visit().  Modifies most use sites inthe front-end and runtime to use common::visit().The C++ standard mandates that std::visit() have O(1) executiontime, which forces implementations to build dispatch tables.This new common::visit() is O(log2 N) in the number of alternativesin a variant&lt;&gt;, but that N tends to be small and so this changeproduces a fairly significant improvement in compiler buildmemory requirements, a 5-10% improvement in compiler build time,and a small improvement in compiler execution time.Building with -DFLANG_USE_STD_VISIT causes common::visit()to be an alias for std::visit().Calls to common::visit() with multiple variant argumentsare referred to std::visit(), pending further work.Differential Revision: https://reviews.llvm.org/D122441

            List of files:
            /llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp</description>
        <pubDate>Wed, 23 Mar 2022 21:05:50 +0000</pubDate>
        <dc:creator>Peter Klausler &lt;pklausler@nvidia.com&gt;</dc:creator>
    </item>
<item>
        <title>7f1adbab - [flang] Fix LBOUND rewrite on descriptor components</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp#7f1adbab</link>
        <description>[flang] Fix LBOUND rewrite on descriptor componentsGetLowerBoundHelper rewrite in https://reviews.llvm.org/D121488 wasincorrect with POINTER/ALLOCATABLE components. The rewrite created adescriptor inquiry to the component symbol only instead of the wholenamed entity. The base information was lost, and not retrievable.LBOUND(a(10)%p) became LBOUND(p).Fix this regression, and also update DescriptorInquiry unparsing tocarry the kind information. DescriptorInquiries are KIND 8 expressions,while LBOUND/SIZE/RANK, %LEN are default kind expressions.This caused `print *,lbound(x,kind=8)` to unparse as `print*,lbound(x)` which is notsemantically the same (this unparsing issue was not an issue forlowering, but I noticed it while writing my regression test).Differential Revision: https://reviews.llvm.org/D122406

            List of files:
            /llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp</description>
        <pubDate>Fri, 25 Mar 2022 08:00:23 +0000</pubDate>
        <dc:creator>Jean Perier &lt;jperier@nvidia.com&gt;</dc:creator>
    </item>
<item>
        <title>ca46521a - [flang] UBOUND() edge case: empty dimension</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp#ca46521a</link>
        <description>[flang] UBOUND() edge case: empty dimensionSimilarly to LBOUND in https://reviews.llvm.org/D121488, UBOUND mustreturn zero for an empty dimension, no matter the specificationexpression.Add a GetUBOUND method to be used in expression rewrite that preventsfolding UBOUND to a bound specification expression if the extent isnot a compile time constant.Fold the case where the extents is known to be zero (and also deal withthis case in LBOUND since we can and should to comply with constantexpression requirements).Differential Revision: https://reviews.llvm.org/D122242

            List of files:
            /llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp</description>
        <pubDate>Thu, 24 Mar 2022 08:06:59 +0000</pubDate>
        <dc:creator>Jean Perier &lt;jperier@nvidia.com&gt;</dc:creator>
    </item>
<item>
        <title>3b61587c - [flang] LBOUND() edge case: empty dimension</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp#3b61587c</link>
        <description>[flang] LBOUND() edge case: empty dimensionLBOUND must return 1 for an empty dimension, no matter whatexplicit expression might appear in a declaration or arrive ina descriptor.Differential Revision: https://reviews.llvm.org/D121488

            List of files:
            /llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp</description>
        <pubDate>Wed, 09 Mar 2022 21:43:54 +0000</pubDate>
        <dc:creator>Peter Klausler &lt;pklausler@nvidia.com&gt;</dc:creator>
    </item>
<item>
        <title>59d38f1b - [flang] Check constraint C711 correctly</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp#59d38f1b</link>
        <description>[flang] Check constraint C711 correctlyAn assumed-type actual argument that corresponds to an assumed-rank dummyargument shall be assumed-shape or assumed-rank.Differential Revision: https://reviews.llvm.org/D120750

            List of files:
            /llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp</description>
        <pubDate>Fri, 18 Feb 2022 20:25:58 +0000</pubDate>
        <dc:creator>Peter Klausler &lt;pklausler@nvidia.com&gt;</dc:creator>
    </item>
<item>
        <title>81c66933 - [flang] Prevent any non constant result extent to be inlined on caller side</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp#81c66933</link>
        <description>[flang] Prevent any non constant result extent to be inlined on caller sideUBOUND, SIZE, and SHAPE folding was still creating expressions that areinvalid on the caller side without the call expression context.A previous patch intended to deal with this situation (https://reviews.llvm.org/D116933)but it assumed the return expression would be a descriptor inquiry tothe result symbol, which is not the case if the extent expression is&quot;scope invariant&quot; inside the called subroutine (e.g., referring tointent(in) dummy arguments). Simply prevent folding from inlining nonconstant extent expression on the caller side.Folding could be later improved by having ad-hoc folding for UBOUND, SIZE, andSHAPE on function references where it could try replacing the dummy symbolsby the actual expression, but this is left as a possible later improvement.Differential Revision: https://reviews.llvm.org/D117686

            List of files:
            /llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp</description>
        <pubDate>Wed, 19 Jan 2022 18:12:12 +0000</pubDate>
        <dc:creator>Jean Perier &lt;jperier@nvidia.com&gt;</dc:creator>
    </item>
<item>
        <title>fb3faa8b - [flang] Do not lose call in shape inquiry on function reference</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp#fb3faa8b</link>
        <description>[flang] Do not lose call in shape inquiry on function referenceCurrently, something like `print *, size(foo(n,m))` was rewrittento `print *, size(foo_result_symbol)` when foo result is a non constantshape array. This cannot be processed by lowering or reprocessed by aFortran compiler since the syntax is wrong (`foo_result_symbol` isunknown on the caller side) and the arguments are lost when they mightbe required to compute the result shape.It is not possible (and probably not desired) to make GetShape fail ingeneral in such case since returning nullopt seems only expected forscalars or assumed rank (see GetRank usage in lib/Semantics/check-call.cpp),and returning a vector with nullopt extent may trigger some checks tobelieve they are facing an assumed size (like here in intrinsic argumentchecks: https://github.com/llvm/llvm-project/blob/196204c72c68a577c72af95d70f18e3550939a5e/flang/lib/Evaluate/intrinsics.cpp#L1530).Hence, I went for a solution that limits the rewrite change to folding(where the original expression is returned if the shape depends on a nonconstant shape from a call).I added a non default option to GetShapeHelper that prevents the rewriteof shape inquiry on calls to descriptor inquiries. At first I wanted toavoid touching GetShapeHelper, but it would require to re-implement allits logic to determine if the shape comes from a function call or not(the expression could be `size(1+foo(n,m))`). So added an alternateentry point to GetShapeHelper seemed the cleanest solution to me.Differential Revision: https://reviews.llvm.org/D116933

            List of files:
            /llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp</description>
        <pubDate>Mon, 10 Jan 2022 18:09:45 +0000</pubDate>
        <dc:creator>Jean Perier &lt;jperier@nvidia.com&gt;</dc:creator>
    </item>
<item>
        <title>44bc97c8 - [flang] Adjust names in Semantics that imply too much (NFC)</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp#44bc97c8</link>
        <description>[flang] Adjust names in Semantics that imply too much (NFC)Some kinds of Fortran arrays are declared with the same syntax,and it is impossible to tell from a shape (:, :) or (*) whetherthe object is assumed shape, deferred shape, assumed size, impliedshape, or whatever without recourse to more information about thesymbol in question.  This patch softens the names of some predicatefunctions (IsAssumedShape to CanBeAssumedShape) and makes othersmore reflective of the syntax they represent (isAssumed to isStar)in an attempt to encourage coders to seek and find definitivepredicate functions whose names deliver what they seem to mean.Address TODO comments in IsSimplyContiguous() by using theupdated IsAssumedShape() predicate.Differential Revision: https://reviews.llvm.org/D114829

            List of files:
            /llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp</description>
        <pubDate>Fri, 26 Nov 2021 21:26:50 +0000</pubDate>
        <dc:creator>Peter Klausler &lt;pklausler@nvidia.com&gt;</dc:creator>
    </item>
<item>
        <title>ca474479 - [flang] Don&apos;t reference non-invariant symbols in shape expressions</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp#ca474479</link>
        <description>[flang] Don&apos;t reference non-invariant symbols in shape expressionsWhen an array&apos;s shape involves references to symbols that are notinvariant in a scope -- the classic example being a dummy arraywith an explicit shape involving other dummy arguments -- thecompiler was creating shape expressions that referenced thosesymbols.  This might be valid if those symbols are somehowcaptured and copied at each entry point to a subprogram, andthe copies referenced in the shapes instead, but that&apos;s notthe case.This patch introduces a new expression predicate IsScopeInvariantExpr(),which defines a class of expressions that contains constant expressions(in the sense that the standard uses that term) as well as referencesto items that may be safely accessed in a context-free way throughouttheir scopes.   This includes dummy arguments that are INTENT(IN)and not VALUE, descriptor inquiries into descriptors that cannotchange, and bare LEN type parameters within the definitions ofderived types.  The new predicate is then used in shape analysisto winnow out results that would have otherwise been contextual.Differential Revision: https://reviews.llvm.org/D113309

            List of files:
            /llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp</description>
        <pubDate>Mon, 01 Nov 2021 23:24:01 +0000</pubDate>
        <dc:creator>Peter Klausler &lt;pklausler@nvidia.com&gt;</dc:creator>
    </item>
<item>
        <title>82568675 - [flang] Fold FINDLOC()</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp#82568675</link>
        <description>[flang] Fold FINDLOC()Fold the transformational intrinsic function FINDLOC() forall combinations of optional arguments and data types.Differential Revision: https://reviews.llvm.org/D110757

            List of files:
            /llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp</description>
        <pubDate>Tue, 28 Sep 2021 16:56:38 +0000</pubDate>
        <dc:creator>Peter Klausler &lt;pklausler@nvidia.com&gt;</dc:creator>
    </item>
<item>
        <title>9245f355 - [flang] Validate SIZE(x,DIM=n) dimension for assumed-size array x</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp#9245f355</link>
        <description>[flang] Validate SIZE(x,DIM=n) dimension for assumed-size array xCatch invalid attempts to extract the unknowable extent of the lastdimension of an assumed-size array dummy argument, and clean upproblems with assumed-rank arguments in similar circumstancesexposed by testing the fix.Differential Revision: https://reviews.llvm.org/D109918

            List of files:
            /llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp</description>
        <pubDate>Mon, 13 Sep 2021 20:45:30 +0000</pubDate>
        <dc:creator>peter klausler &lt;pklausler@nvidia.com&gt;</dc:creator>
    </item>
<item>
        <title>12ba7278 - [flang] Accept SIZE(assumed-rank, DIM=n)</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp#12ba7278</link>
        <description>[flang] Accept SIZE(assumed-rank, DIM=n)Silence a bogus error message about an out-of-range DIM= argumentwhen the argument is assumed-rank.  (More generally, don&apos;t pretendto be able to discern a shape of known rank for an assumed-rankobject.)Differential Revision: https://reviews.llvm.org/D109915

            List of files:
            /llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp</description>
        <pubDate>Mon, 13 Sep 2021 17:41:27 +0000</pubDate>
        <dc:creator>peter klausler &lt;pklausler@nvidia.com&gt;</dc:creator>
    </item>
<item>
        <title>3ad9826d - [flang] Fix the extent calculation when upper bounds are less than lower bounds</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp#3ad9826d</link>
        <description>[flang] Fix the extent calculation when upper bounds are less than lower boundsWhen the upper bound is less than the lower bound, the extent is zero.  This isspecified in section 8.5.8.2, paragraph 3.Note that similar problems exist in the lowering code.  This change only fixesthe problem for the front end.I also added a test.Differential Revision: https://reviews.llvm.org/D107832

            List of files:
            /llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp</description>
        <pubDate>Tue, 10 Aug 2021 15:20:30 +0000</pubDate>
        <dc:creator>Peter Steinfeld &lt;psteinfeld@nvidia.com&gt;</dc:creator>
    </item>
<item>
        <title>a48e4168 - [flang] Run-time derived type initialization and destruction</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp#a48e4168</link>
        <description>[flang] Run-time derived type initialization and destructionUse derived type information tables to drive default componentinitialization (when needed), component destruction, and calls tofinal subroutines.  Perform these operations automatically forALLOCATE()/DEALLOCATE() APIs for allocatables, automatics, andpointers.  Add APIs for use in lowering to perform these operationsfor non-allocatable/automatic non-pointer variables.Data pointer component initialization supports arbitrary constantdesignators, a F&apos;2008 feature, which may be a first for Fortranimplementations.Differential Revision: https://reviews.llvm.org/D106297

            List of files:
            /llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp</description>
        <pubDate>Mon, 19 Jul 2021 18:53:20 +0000</pubDate>
        <dc:creator>peter klausler &lt;pklausler@nvidia.com&gt;</dc:creator>
    </item>
<item>
        <title>1a4af2e4 - [flang] preserve symbol in DescriptorInquiry</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp#1a4af2e4</link>
        <description>[flang] preserve symbol in DescriptorInquiryDo not use ultimate symbols in DescriptorInquiry. Using the ultimatesymbol may lead to issues later for at least two reasons:- The original symbols may have volatile/asynchronous attributes that  the ultimate may not have. Later phases working on the DescriptorInquiry  would then not apply potential care required by these attributes.- HostAssociatedDetails symbols are used by OpenMP for symbols with  special OpenMP attributes inside OpenMP region (e.g variables with  private attribute), so it is very important to preserve this  aspect in the DescriptorInquiry, that would otherwise apply on the  symbol outside of the region.Differential Revision: https://reviews.llvm.org/D104385

            List of files:
            /llvm-project-15.0.7/flang/lib/Evaluate/shape.cpp</description>
        <pubDate>Thu, 17 Jun 2021 10:40:19 +0000</pubDate>
        <dc:creator>Jean Perier &lt;jperier@nvidia.com&gt;</dc:creator>
    </item>
</channel>
</rss>
