[flang-commits] [flang] [flang] Eliminate workaround for optimizing maxval Fortran intrinsic (PR #65814)

Daniil Dudkin via flang-commits flang-commits at lists.llvm.org
Sat Sep 9 02:44:09 PDT 2023


unterumarmung wrote:

So I used this program to reproduce:
```fortran
program quad_precision_maxval
  use, intrinsic :: iso_fortran_env, only: real128

  real(real128) :: quad_array(5)
  quad_array = [1.0_16, 2.0_16, 3.0_16, 4.0_16, 5.0_16]

  max_value = maxval(quad_array)
  print *, "Maximum value in the array:", max_value
end program quad_precision_maxval
```
1. No fast math:
```bash
$ ./build/bin/flang-new f.f90
```
```bash
$ ./a.out
Maximum value in the array: 5
```
```bash
$ objdump -d a.out | grep fmaxl

```

Works fine and no `fmaxl` mentions

2. Fast math enabled:
```bash
$ ./build/bin/flang-new -ffast-math f.f90
```
```bash
$ ./a.out
Maximum value in the array: 5
```
```bash
$ objdump -d a.out | grep fmaxl

```
Works fine and no `fmaxl` mentions

--------------------------------


So, is this enough or have I missed something?

https://github.com/llvm/llvm-project/pull/65814


More information about the flang-commits mailing list