llvm-project/flang/test/Evaluate
Jean Perier f1fa3b7f6e [flang] AMAX0, MIN1... rewrite to MAX/MIN: make result conversion explicit
Summary:
This patch changes speficic extremum functions rewrite to generic MIN/MAX.
It applies to AMAX0, AMIN0, AMAX1, AMIN1, MAX0, MIN0, MAX1, MIN1, DMAX1,
and DMIN1.

- Do not re-write specific extremums to MAX/MIN in intrinsic Probe and let
folding rewrite it and introduc the conversion on the MIN/MAX result.
- Also make operand promotion explicit in MIN/MAX folding.

For instance, after this patch:
AMAX0(int8, int4) is rewritten to REAL(MAX(int8, INT(int4, 8)))

All this care is to avoid rewritting it to MAX(REAL(int8), REAL(int4))
that may not always be numerically equivalent to the first rewrite.

Reviewers: klausler, schweitz, sscalpone, jdoerfert, DavidTruby

Reviewed By: klausler, schweitz

Subscribers: llvm-commits, flang-commits

Tags: #flang, #llvm

Differential Revision: https://reviews.llvm.org/D81940
2020-06-18 08:14:58 +02:00
..
folding01.f90 [flang][NFC] Simplify semantics test scripts 2020-05-11 11:49:25 -07:00
folding02.f90 [flang][NFC] Simplify semantics test scripts 2020-05-11 11:49:25 -07:00
folding03.f90 [flang][NFC] Simplify semantics test scripts 2020-05-11 11:49:25 -07:00
folding04.f90 [flang] AMAX0, MIN1... rewrite to MAX/MIN: make result conversion explicit 2020-06-18 08:14:58 +02:00
folding05.f90 [flang][NFC] Simplify semantics test scripts 2020-05-11 11:49:25 -07:00
folding06.f90 [flang][NFC] Simplify semantics test scripts 2020-05-11 11:49:25 -07:00
folding07.f90 [flang][NFC] Simplify semantics test scripts 2020-05-11 11:49:25 -07:00
folding08.f90 [flang][NFC] Simplify semantics test scripts 2020-05-11 11:49:25 -07:00
folding09.f90 [flang][NFC] Simplify semantics test scripts 2020-05-11 11:49:25 -07:00
test_folding.sh [flang][NFC] Simplify semantics test scripts 2020-05-11 11:49:25 -07:00