History log of /llvm-project-15.0.7/flang/lib/Lower/ConvertExpr.cpp (Results 1 – 25 of 79)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
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
# afb9d89f 20-Jul-2022 Kazu Hirata <[email protected]>

[flang] Use value instead of getValue (NFC)

Flang C++ Style Guide tells us to use x.value() when no presence test
is obviously protecting the reference.


# 009ab172 16-Jul-2022 Kazu Hirata <[email protected]>

[flang] Use *X instead of X.getValue() (NFC)

Per Flang C++ Style Guide, this patch replaces X.getValue() with *X
where *X is protected by a presence test.


# a280043b 08-Jul-2022 Slava Zakharin <[email protected]>

[flang] Lower TRANSPOSE without using runtime.

Calling runtime TRANSPOSE requires a temporary array for the result,
and, sometimes, a temporary array for the argument. Lowering it inline
should prov

[flang] Lower TRANSPOSE without using runtime.

Calling runtime TRANSPOSE requires a temporary array for the result,
and, sometimes, a temporary array for the argument. Lowering it inline
should provide faster code.

I added -opt-transpose control just for debugging purposes temporary.
I am going to make driver changes that will disable inline lowering
for -O0. For the time being I would like to enable it by default
to expose the code to more tests.

Differential Revision: https://reviews.llvm.org/D129497

show more ...


# c82fb16f 12-Jul-2022 Kazu Hirata <[email protected]>

[flang] Use has_value instead of hasValue (NFC)

This patch replaces hasValue with has_value in an effort to deprecate
Optional<X>::hasValue.

Differential Revision: https://reviews.llvm.org/D129458


# 86b8c1d9 10-Jul-2022 Kazu Hirata <[email protected]>

[flang] Don't use Optional::hasValue (NFC)

Flang C++ Style Guide tells us to avoid .has_value() in the predicate
expressions of control flow statements. I am treating ternary
expressions as control

[flang] Don't use Optional::hasValue (NFC)

Flang C++ Style Guide tells us to avoid .has_value() in the predicate
expressions of control flow statements. I am treating ternary
expressions as control flow statements for the purpose of this patch.

Differential Revision: https://reviews.llvm.org/D128622

show more ...


# 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 ...


# 53804e42 07-Jul-2022 Valentin Clement <[email protected]>

[flang][NFC] Make LEN parameters homogenous

This patch is part of the upstreaming effort from fir-dev branch.
This is the last patch for the upstreaming effort.

Reviewed By: jeanPerier

Differentia

[flang][NFC] Make LEN parameters homogenous

This patch is part of the upstreaming effort from fir-dev branch.
This is the last patch for the upstreaming effort.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D129187

Co-authored-by: Eric Schweitz <[email protected]>

show more ...


# 8c44bef1 01-Jul-2022 Valentin Clement <[email protected]>

[flang] File omp_lib.f90 is not a standard intrinsic module

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.or

[flang] File omp_lib.f90 is not a standard intrinsic module

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D128976

Co-authored-by: V Donaldson <[email protected]>

show more ...


# 0dd4fb04 01-Jul-2022 Valentin Clement <[email protected]>

[flang] Fix for broken/degenerate forall case

Fix for broken/degenerate forall case where there is no assignment to an
array under the explicit iteration space. While this is a multiple
assignment,

[flang] Fix for broken/degenerate forall case

Fix for broken/degenerate forall case where there is no assignment to an
array under the explicit iteration space. While this is a multiple
assignment, semantics only raises a warning.
The fix is to add a test that the explicit space has any sort of array
to be updated, and if not then the do_loop nest will not require a
terminator to forward array values to the next iteration.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D128973

Co-authored-by: Eric Schweitz <[email protected]>

show more ...


# 39377d52 01-Jul-2022 Valentin Clement <[email protected]>

[flang] Fix APFloat conversion cases

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D128935

Co-author

[flang] Fix APFloat conversion cases

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D128935

Co-authored-by: Eric Schweitz <[email protected]>
Co-authored-by: Peter Steinfeld <[email protected]>

show more ...


# 13f9089a 30-Jun-2022 Peixin Qiao <[email protected]>

[flang] Fix one corner case in reshape intrinsic

As Fortran 2018 16.9.163, the reshape is the only intrinsic which
requires the shape argument to be rank-one integer array and the SIZE
of it to be o

[flang] Fix one corner case in reshape intrinsic

As Fortran 2018 16.9.163, the reshape is the only intrinsic which
requires the shape argument to be rank-one integer array and the SIZE
of it to be one constant expression. The current expression lowering
converts the shape expression with slice in intrinsic into one box value
with the box element type of unknown extent. However, the genReshape
requires the box element type to be constant size. So, convert the box
value into one with box element type of sequence of 1 x constant. This
corner case is found in cam4 in SPEC 2017
https://github.com/llvm/llvm-project/issues/56140.

Reviewed By: Jean Perier

Differential Revision: https://reviews.llvm.org/D128597

show more ...


# 06d103ff 30-Jun-2022 Valentin Clement <[email protected]>

[flang] Correct bug in literal CHARACTER constant names

The names of CHARACTER strings were being truncated leading to invalid
collisions and other failures. This change makes sure to use the entire

[flang] Correct bug in literal CHARACTER constant names

The names of CHARACTER strings were being truncated leading to invalid
collisions and other failures. This change makes sure to use the entire
string as the seed for the unique name.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D128884

Co-authored-by: Eric Schweitz <[email protected]>

show more ...


# 1e55ec66 30-Jun-2022 Valentin Clement <[email protected]>

[flang] SELECT CASE constructs with character selectors that require a temp

Here is a character SELECT CASE construct that requires a temp to hold the
result of the TRIM intrinsic call:

```
module

[flang] SELECT CASE constructs with character selectors that require a temp

Here is a character SELECT CASE construct that requires a temp to hold the
result of the TRIM intrinsic call:

```
module m
character(len=6) :: s
contains
subroutine sc
n = 0
if (lge(s,'00')) then
select case(trim(s))
case('11')
n = 1
case default
continue
case('22')
n = 2
case('33')
n = 3
case('44':'55','66':'77','88':)
n = 4
end select
end if
print*, n
end subroutine
end module m
```

This SELECT CASE construct is implemented as an IF/ELSE-IF/ELSE comparison
sequence. The temp must be retained until some comparison is successful.
At that point the temp may be freed. Generalize statement context processing
to allow multiple finalize calls to do this, such that the program always
executes exactly one freemem call.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: klausler, vdonaldson

Differential Revision: https://reviews.llvm.org/D128852

Co-authored-by: V Donaldson <[email protected]>

show more ...


# 649439e7 29-Jun-2022 Valentin Clement <[email protected]>

[flang] Fix lowering issue with character temp

- Add verifiers that determine if an Op requires type parameters or
not and checks that the correct number of parameters is specified.

This patch is

[flang] Fix lowering issue with character temp

- Add verifiers that determine if an Op requires type parameters or
not and checks that the correct number of parameters is specified.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D128828

Co-authored-by: Eric Schweitz <[email protected]>

show more ...


# d542f9c2 28-Jun-2022 Valentin Clement <[email protected]>

[flang] Fix couple of issue with user defined assignment in FORALL and WHERE

This patch fixes a couple of issues with the lowering of user defined assignment.

This patch is part of the upstreaming

[flang] Fix couple of issue with user defined assignment in FORALL and WHERE

This patch fixes a couple of issues with the lowering of user defined assignment.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D128730

Co-authored-by: Jean Perier <[email protected]>
Co-authored-by: Eric Schweitz <[email protected]>

show more ...


# e2f313df 28-Jun-2022 Valentin Clement <[email protected]>

[flang] Make sure that conversions are applied in FORALL degenerate contexts

For the rapid triage push, just add a TODO for the degenerate POINTER
assignment case. The LHD ought to be a variable of

[flang] Make sure that conversions are applied in FORALL degenerate contexts

For the rapid triage push, just add a TODO for the degenerate POINTER
assignment case. The LHD ought to be a variable of type !fir.box, but it
is currently returning a shadow variable for the raw data pointer. More
investigation is needed there.
Make sure that conversions are applied in FORALL degenerate contexts.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D128724

Co-authored-by: Eric Schweitz <[email protected]>

show more ...


# dc97886f 25-Jun-2022 Kazu Hirata <[email protected]>

[flang] Restore Optional::value() (NFC)

This patch restores several calls to Optional::value() in preference
to Optional::operator*.

The Flang C++ Style Guide tells us to use x.value() where no pre

[flang] Restore Optional::value() (NFC)

This patch restores several calls to Optional::value() in preference
to Optional::operator*.

The Flang C++ Style Guide tells us to use x.value() where no presence
test is obviously protecting a *x reference to the contents.

Differential Revision: https://reviews.llvm.org/D128590

show more ...


# 3b7c3a65 25-Jun-2022 Kazu Hirata <[email protected]>

Revert "Don't use Optional::hasValue (NFC)"

This reverts commit aa8feeefd3ac6c78ee8f67bf033976fc7d68bc6d.


# aa8feeef 25-Jun-2022 Kazu Hirata <[email protected]>

Don't use Optional::hasValue (NFC)


# 753b766d 24-Jun-2022 Valentin Clement <[email protected]>

[flang] Fix forall issue with substring operation

When there is a substring operation on a scalar assignment in a FORALL
context, we have to lower the entire substring and not the entire
CHARACTER v

[flang] Fix forall issue with substring operation

When there is a substring operation on a scalar assignment in a FORALL
context, we have to lower the entire substring and not the entire
CHARACTER variable.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld, klausler

Differential Revision: https://reviews.llvm.org/D128459

Co-authored-by: Eric Schweitz <[email protected]>

show more ...


# 734ad031 23-Jun-2022 Valentin Clement <[email protected]>

[flang] Handle boxed characters that are values when doing a conversion

Character conversion requires memory storage as it operates on a
sequence of code points.

This patch is part of the upstreami

[flang] Handle boxed characters that are values when doing a conversion

Character conversion requires memory storage as it operates on a
sequence of code points.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D128438

Co-authored-by: Eric Schweitz <[email protected]>

show more ...


# 124338dd 23-Jun-2022 Val Donaldson <[email protected]>

[flang] Increase support for intrinsic module procedures

* Make Semantics test doconcurrent01.f90 an expected failure pending a fix
for a problem in recognizing a PURE prefix specifier for a specifi

[flang] Increase support for intrinsic module procedures

* Make Semantics test doconcurrent01.f90 an expected failure pending a fix
for a problem in recognizing a PURE prefix specifier for a specific procedure
that occurs in new intrinsic module source code,

* review update

* review update

* Increase support for intrinsic module procedures

The f18 standard defines 5 intrinsic modules that define varying numbers
of procedures, including several operators:

2 iso_fortran_env
55 ieee_arithmetic
10 ieee_exceptions
0 ieee_features
6 iso_c_binding

There are existing fortran source files for each of these intrinsic modules.
This PR adds generic procedure declarations to these files for procedures
that do not already have them, together with associated specific procedure
declarations. It also adds the capability of recognizing intrinsic module
procedures in lowering code, making it possible to use existing language
intrinsic code generation for intrinsic module procedures for both scalar
and elemental calls. Code can then be generated for intrinsic module
procedures using existing options, including front end folding, direct
inlining, and calls to runtime support routines. Detailed code generation
is provided for several procedures in this PR, with others left to future PRs.
Procedure calls that reach lowering and don't have detailed implementation
support will generate a "not yet implemented" message with a recognizable name.

The generic procedures in these modules may each have as many as 36 specific
procedures. Most specific procedures are generated via macros that generate
type specific interface declarations. These specific declarations provide
detailed argument information for each individual procedure call, similar
to what is done via other means for standard language intrinsics. The
modules only provide interface declarations. There are no procedure
definitions, again in keeping with how language intrinsics are processed.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier, PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D128431

Co-authored-by: V Donaldson <[email protected]>

show more ...


# ea387443 23-Jun-2022 Valentin Clement <[email protected]>

[flang] Lowering passing variables to OPTIONAL VALUE

The case where the dummy argument is OPTIONAL was missing in the
handling of VALUE numerical and logical dummies (passBy::BaseAddressValueAttribu

[flang] Lowering passing variables to OPTIONAL VALUE

The case where the dummy argument is OPTIONAL was missing in the
handling of VALUE numerical and logical dummies (passBy::BaseAddressValueAttribute).
This caused segfaults while unconditionally copying actual arguments that were legally
absent at runtime.

Takes this bug as an opportunity to share the code that lowers arguments
that must be passed by BaseAddress, BaseAddressValueAttribute, BoxChar,
and CharBoxValueAttribute.
It has to deal with the exact same issues (being able to make contiguous
copies of the actual argument, potentially conditionally at runtime,
and potentially requiring a copy-back).
The VALUE case is the same as the non value case, except there is never
a copy-back and there is always a copy-in for variables. This two
differences are easily controlled by a byValue flag.

This as the benefit of implementing CHARACTER, VALUE for free that was
previously a hard TODO.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D128418

Co-authored-by: Jean Perier <[email protected]>

show more ...


Revision tags: llvmorg-14.0.6
# ed8fceaa 21-Jun-2022 Kazu Hirata <[email protected]>

Don't use Optional::getValue (NFC)


# 5413bf1b 20-Jun-2022 Kazu Hirata <[email protected]>

Don't use Optional::hasValue (NFC)


1234