<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/flang/runtime/pointer.cpp, branch users/shawbyoung/spr/main.boltnfc-refactoring-callgraph</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[flang][runtime] Interoperable POINTER deallocation validation (#96100)</title>
<updated>2024-06-24T17:46:30+00:00</updated>
<author>
<name>Peter Klausler</name>
<email>35819229+klausler@users.noreply.github.com</email>
</author>
<published>2024-06-24T17:46:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=514c1ec5477a48e4f639c0b15ab757832b67dd10'/>
<id>514c1ec5477a48e4f639c0b15ab757832b67dd10</id>
<content type='text'>
Extend the runtime validation of deallocated pointers so that it also
works when pointers are allocated &amp;/or deallocated outside Fortran.
Previously, bogus runtime errors would be reported for pointers
allocated via CFI_allocate() and deallocated in Fortran, and
CFI_deallocate() did not check that it was deallocating a whole
contiguous pointer that was allocated as such.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Extend the runtime validation of deallocated pointers so that it also
works when pointers are allocated &amp;/or deallocated outside Fortran.
Previously, bogus runtime errors would be reported for pointers
allocated via CFI_allocate() and deallocated in Fortran, and
CFI_deallocate() did not check that it was deallocating a whole
contiguous pointer that was allocated as such.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][runtime] Prepare enabling PRINT of integer32 for device. (#86247)</title>
<updated>2024-03-25T23:01:25+00:00</updated>
<author>
<name>Slava Zakharin</name>
<email>szakharin@nvidia.com</email>
</author>
<published>2024-03-25T23:01:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8ebf741136c66f51053315bf4f0ef828c6f66094'/>
<id>8ebf741136c66f51053315bf4f0ef828c6f66094</id>
<content type='text'>
This commit adds required files into the offload build closure,
which means adding RT_API_ATTRS and other markers.

The implementation does not work for CUDA yet, because of
std::variant,swap,reverse usage. These issues will be resolved
separately (e.g. by using libcudacxx header files).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit adds required files into the offload build closure,
which means adding RT_API_ATTRS and other markers.

The implementation does not work for CUDA yet, because of
std::variant,swap,reverse usage. These issues will be resolved
separately (e.g. by using libcudacxx header files).</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][runtime] Temporary fix for unresolved reference in CUDA F18 runtime. (#85294)</title>
<updated>2024-03-14T20:00:46+00:00</updated>
<author>
<name>Slava Zakharin</name>
<email>szakharin@nvidia.com</email>
</author>
<published>2024-03-14T20:00:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c08d70a5cbc61efc5c8636c8788f39270f59dec5'/>
<id>c08d70a5cbc61efc5c8636c8788f39270f59dec5</id>
<content type='text'>
Avoid referencing executionEnvironment in the device code, since
environment.cpp is not part of the CUDA build yet.
This is a temporary fix before #85182 is merged.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Avoid referencing executionEnvironment in the device code, since
environment.cpp is not part of the CUDA build yet.
This is a temporary fix before #85182 is merged.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][runtime] Let FORT_CHECK_POINTER_DEALLOCATION=0 disable runtime … (#84956)</title>
<updated>2024-03-13T21:52:25+00:00</updated>
<author>
<name>Peter Klausler</name>
<email>35819229+klausler@users.noreply.github.com</email>
</author>
<published>2024-03-13T21:52:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=af964c7e31f0728e84c97b734933fcb9a1912bce'/>
<id>af964c7e31f0728e84c97b734933fcb9a1912bce</id>
<content type='text'>
…check

Add an environment variable by which a user can disable the pointer
validation check in DEALLOCATE statement handling. This is not safe, but
it can help make a code work that allocates a pointer with an extended
derived type, associates its target with a pointer to one of its
ancestor types, and then deallocates that pointer.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
…check

Add an environment variable by which a user can disable the pointer
validation check in DEALLOCATE statement handling. This is not safe, but
it can help make a code work that allocates a pointer with an extended
derived type, associates its target with a pointer to one of its
ancestor types, and then deallocates that pointer.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][runtime] Validate pointer DEALLOCATE (#78612)</title>
<updated>2024-01-25T22:44:09+00:00</updated>
<author>
<name>Peter Klausler</name>
<email>35819229+klausler@users.noreply.github.com</email>
</author>
<published>2024-01-25T22:44:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a3bbe627d2d8d3a64c60dbec57c885d5303f4398'/>
<id>a3bbe627d2d8d3a64c60dbec57c885d5303f4398</id>
<content type='text'>
The standard requires a compiler to diagnose an incorrect use of a
pointer in a DEALLOCATE statement. The pointer must be associated with
an entire object that was allocated as a pointer (not allocatable) by an
ALLOCATE statement.

Implement by appending a validation footer to pointer allocations. This
is an extra allocated word that encodes the base address of the
allocation. If it is not found after the data payload when the pointer
is deallocated, signal an error. There is a chance of a false positive
result, but that should be vanishingly unlikely.

This change requires all pointer allocations (not allocatables) to take
place in the runtime in PointerAllocate(), which might be slower in
cases that could otherwise be handled with a native memory allocation
operation. I believe that memory allocation of pointers is less common
than with allocatables, which are not affected. If this turns out to
become a performance problem, we can inline the creation and
initialization of the footer word.

Fixes https://github.com/llvm/llvm-project/issues/78391.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The standard requires a compiler to diagnose an incorrect use of a
pointer in a DEALLOCATE statement. The pointer must be associated with
an entire object that was allocated as a pointer (not allocatable) by an
ALLOCATE statement.

Implement by appending a validation footer to pointer allocations. This
is an extra allocated word that encodes the base address of the
allocation. If it is not found after the data payload when the pointer
is deallocated, signal an error. There is a chance of a false positive
result, but that should be vanishingly unlikely.

This change requires all pointer allocations (not allocatables) to take
place in the runtime in PointerAllocate(), which might be slower in
cases that could otherwise be handled with a native memory allocation
operation. I believe that memory allocation of pointers is less common
than with allocatables, which are not affected. If this turns out to
become a performance problem, we can inline the creation and
initialization of the footer word.

Fixes https://github.com/llvm/llvm-project/issues/78391.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][runtime] Enable more APIs in the offload build. (#76486)</title>
<updated>2023-12-28T21:50:43+00:00</updated>
<author>
<name>Slava Zakharin</name>
<email>szakharin@nvidia.com</email>
</author>
<published>2023-12-28T21:50:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=76facde32c2151c3ba6774ff7416281c680bf8bf'/>
<id>76facde32c2151c3ba6774ff7416281c680bf8bf</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][runtime] Fix SAME_TYPE_AS()/EXTENDS_TYPE_OF() for CLASS(*) (#67727)</title>
<updated>2023-10-17T15:20:38+00:00</updated>
<author>
<name>Peter Klausler</name>
<email>35819229+klausler@users.noreply.github.com</email>
</author>
<published>2023-10-17T15:20:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=dffd93b30b56557a4b98f8b68fec0aa6cc706deb'/>
<id>dffd93b30b56557a4b98f8b68fec0aa6cc706deb</id>
<content type='text'>
Ensure that the f18Addendum flag is preserved in AllocatableApplyMold(),
that raw().type is reinitialized in AllocatableDeallocatePolymorphic(),
and that the implementations of SameTypeAs() and ExtendsTypeOf() handle
unallocated unlimited polymorphic arguments correctly.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ensure that the f18Addendum flag is preserved in AllocatableApplyMold(),
that raw().type is reinitialized in AllocatableDeallocatePolymorphic(),
and that the implementations of SameTypeAs() and ExtendsTypeOf() handle
unallocated unlimited polymorphic arguments correctly.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][runtime] zero size allocation in source allocation (#66124)</title>
<updated>2023-09-18T06:51:07+00:00</updated>
<author>
<name>jeanPerier</name>
<email>jperier@nvidia.com</email>
</author>
<published>2023-09-18T06:51:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=79508db494c99e0b8748827be2e39aa42e9f225b'/>
<id>79508db494c99e0b8748827be2e39aa42e9f225b</id>
<content type='text'>
Source allocation with a zero sized array is legal, and the resulting
allocatable/pointer should be allocated/associated.

The current code skipped the actual allocation, leading the allocatable
or pointer to look unallocated/disassociated.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Source allocation with a zero sized array is legal, and the resulting
allocatable/pointer should be allocated/associated.

The current code skipped the actual allocation, leading the allocatable
or pointer to look unallocated/disassociated.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][runtime] Recognize and handle FINAL subroutines with contiguous dummy arrays when data are not so</title>
<updated>2023-08-01T20:46:45+00:00</updated>
<author>
<name>Peter Klausler</name>
<email>pklausler@nvidia.com</email>
</author>
<published>2023-07-29T15:34:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b21c24c3080394e41db4019be3e646296e7f5b05'/>
<id>b21c24c3080394e41db4019be3e646296e7f5b05</id>
<content type='text'>
When a FINAL subroutine is being invoked for a discontiguous array, which can
happen for INTENT(OUT) dummy arguments and for some left-hand side variables
in intrinsic assignment statements, it may be the case that the subroutine
being called was defined with a dummy argument that requires contiguous data.

Extend the derived type descriptions used by the runtime to signify when
a special procedure binding requires contiguity; set the flags accordingly;
check them in the runtime support library, and, when necessary, use a
temporary shallow copy of the finalized array data in the call to the
final subroutine.

Differential Revision: https://reviews.llvm.org/D156760
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When a FINAL subroutine is being invoked for a discontiguous array, which can
happen for INTENT(OUT) dummy arguments and for some left-hand side variables
in intrinsic assignment statements, it may be the case that the subroutine
being called was defined with a dummy argument that requires contiguous data.

Extend the derived type descriptions used by the runtime to signify when
a special procedure binding requires contiguity; set the flags accordingly;
check them in the runtime support library, and, when necessary, use a
temporary shallow copy of the finalized array data in the call to the
final subroutine.

Differential Revision: https://reviews.llvm.org/D156760
</pre>
</div>
</content>
</entry>
<entry>
<title>[flang] Only apply PointerIsAssociatedWith fix for derived-type</title>
<updated>2023-03-09T15:06:34+00:00</updated>
<author>
<name>Valentin Clement</name>
<email>clementval@gmail.com</email>
</author>
<published>2023-03-09T15:05:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a29d746377f70d517929830e18c20d7d5128ceab'/>
<id>a29d746377f70d517929830e18c20d7d5128ceab</id>
<content type='text'>
Only apply the change made in D145604 for derived-type.
zero-sized character for example are supposed to give a false result

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D145675
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Only apply the change made in D145604 for derived-type.
zero-sized character for example are supposed to give a false result

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D145675
</pre>
</div>
</content>
</entry>
</feed>
