|
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init |
|
| #
73026a4f |
| 01-Jul-2022 |
Slava Zakharin <[email protected]> |
[flang] Changed lowering for allocatable assignment to make array-value-copy correct.
Array-value-copy fails to generate a temporary array for case like this: subroutine bug(b) real, allocatable :
[flang] Changed lowering for allocatable assignment to make array-value-copy correct.
Array-value-copy fails to generate a temporary array for case like this: subroutine bug(b) real, allocatable :: b(:) b = b(2:1:-1) end subroutine
Since LHS may need to be reallocated, lowering produces the following FIR: %rhs_load = fir.array_load %b %slice
%lhs_mem = fir.if %b_is_allocated_with_right_shape { fir.result %b } else { %new_storage = fir.allocmem %rhs_shape fir.result %new_storage }
%lhs = fir.array_load %lhs_mem %loop = fir.do_loop { .... } fir.array_merge_store %lhs, %loop to %lhs_mem // deallocate old storage if reallocation occured, // and update b descriptor if needed.
Since %b in array_load and %lhs_mem in array_merge_store are not the same SSA values, array-value-copy does not detect the conflict and does not produce a temporary array. This causes incorrect result in runtime.
The suggested change in lowering is to generate this: %rhs_load = fir.array_load %b %slice %lhs_mem = fir.if %b_is_allocated_with_right_shape { %lhs = fir.array_load %b %loop = fir.do_loop { .... } fir.array_merge_store %lhs, %loop to %b fir.result %b } else { %new_storage = fir.allocmem %rhs_shape %lhs = fir.array_load %new_storage %loop = fir.do_loop { .... } fir.array_merge_store %lhs, %loop to %new_storage fir.result %new_storage } // deallocate old storage if reallocation occured, // and update b descriptor if needed.
Note that there are actually 3 branches in FIR, so the assignment loops are currently produced in three copies, which is a code-size issue. It is possible to generate just two branches with two copies of the loops, but it is not addressed in this change-set.
Differential Revision: https://reviews.llvm.org/D129314
show more ...
|
|
Revision tags: llvmorg-14.0.6, llvmorg-14.0.5 |
|
| #
68cfb6a8 |
| 10-Jun-2022 |
Eric Schweitz <[email protected]> |
Fixes assertion that arose from bad FIR being constructed.
* Fix assertion strings.
* Fixes assertion that arose from bad FIR being constructed.
With the default member-wise component assignment,
Fixes assertion that arose from bad FIR being constructed.
* Fix assertion strings.
* Fixes assertion that arose from bad FIR being constructed.
With the default member-wise component assignment, the LHS and RHS may be compatible but distinct types. This change to lowering manages both the LHS and RHS independently rather than assume the two types are identical. This avoids creating bogus FIR and asserting/crashing in codegen.
Update the tests with the member-wise copy code.
This patch is part of the upstreaming effort from fir-dev branch.
Co-authored-by: Eric Schweitz <[email protected]>
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D127297
show more ...
|
| #
f09b0c84 |
| 02-Jun-2022 |
Nikita Popov <[email protected]> |
[flang] Update memcpy intrinsic mangling for opaque pointers
Flang is manually mangling names for memset/memcpy/memmove intrinsics, so we need to update the mangling to use the opaque pointer format
[flang] Update memcpy intrinsic mangling for opaque pointers
Flang is manually mangling names for memset/memcpy/memmove intrinsics, so we need to update the mangling to use the opaque pointer format (p0 instead of p0i8).
show more ...
|
|
Revision tags: llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1 |
|
| #
fe252f8e |
| 22-Mar-2022 |
Valentin Clement <[email protected]> |
[flang] Lower boxed procedure
In FIR, we want to wrap function pointers in a special box known as a boxproc value. Fortran has a limited form of dynamic scoping [https://tinyurl.com/2p8v2hw7] betwee
[flang] Lower boxed procedure
In FIR, we want to wrap function pointers in a special box known as a boxproc value. Fortran has a limited form of dynamic scoping [https://tinyurl.com/2p8v2hw7] between "host procedures" and "internal procedures". There are a number of implementations possible.
Boxproc typed values abstract away the implementation details of when a function pointer can be passed directly (as a raw address) and when a function pointer has to account for the presence of a dynamic scope. When lowering Fortran syntax to FIR, all function pointers are emboxed as boxproc values.
When creating LLVM IR, we must strip away the abstraction and produce low-level LLVM "assembly" code. This patch implements that transformation as converting the boxproc values to either raw function pointers or executable trampolines on the stack as needed. The trampoline then captures the dynamic scope context within an executable thunk that can be passed instead of the function's raw address.
Some extra handling is required for Fortran functions that return a character value to deal with LEN values here.
Some of the code in Bridge.cpp and ConvertExpr.cpp and be re-arranged to faciliate the upstreaming effort.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: jeanPerier, PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D122223
Co-authored-by: mleair <[email protected]> Co-authored-by: Jean Perier <[email protected]> Co-authored-by: Eric Schweitz <[email protected]> Co-authored-by: V Donaldson <[email protected]> Co-authored-by: Kiran Chandramohan <[email protected]>
show more ...
|
|
Revision tags: llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3 |
|
| #
859d4a18 |
| 02-Mar-2022 |
Valentin Clement <[email protected]> |
[flang] Lower more cases of assignments on allocatable variables
This patch enables the lowering of various allocatable assignements for character type and numeric types.
This patch is part of the
[flang] Lower more cases of assignments on allocatable variables
This patch enables the lowering of various allocatable assignements for character type and numeric types.
This patch is part of the upstreaming effort from fir-dev branch.
Depends on D120819
Reviewed By: PeteSteinfeld, schweitz
Differential Revision: https://reviews.llvm.org/D120820
Co-authored-by: Eric Schweitz <[email protected]> Co-authored-by: Jean Perier <[email protected]>
show more ...
|
| #
17d71347 |
| 02-Mar-2022 |
Valentin Clement <[email protected]> |
[flang] Handle module in lowering pass
This patch enables the lowering of basic modules and functions/subroutines in modules.
This patch is part of the upstreaming effort from fir-dev branch.
Revi
[flang] Handle module in lowering pass
This patch enables the lowering of basic modules and functions/subroutines in modules.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D120819
Co-authored-by: Eric Schweitz <[email protected]> Co-authored-by: Jean Perier <[email protected]>
show more ...
|
|
Revision tags: llvmorg-14.0.0-rc2 |
|
| #
2a59ead1 |
| 24-Feb-2022 |
Valentin Clement <[email protected]> |
[flang] Lower allocatable assignment for scalar
Add lowering for simple assignement on allocatable scalars.
This patch is part of the upstreaming effort from fir-dev branch.
Depends on D120483
Re
[flang] Lower allocatable assignment for scalar
Add lowering for simple assignement on allocatable scalars.
This patch is part of the upstreaming effort from fir-dev branch.
Depends on D120483
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D120488
Co-authored-by: Eric Schweitz <[email protected]> Co-authored-by: Jean Perier <[email protected]>
show more ...
|