[flang] Fold LGE/LGT/LLE/LLT intrinsic functions
authorpeter klausler <pklausler@nvidia.com>
Wed, 13 Oct 2021 21:42:21 +0000 (14:42 -0700)
committerpeter klausler <pklausler@nvidia.com>
Thu, 14 Oct 2021 22:24:03 +0000 (15:24 -0700)
commit6965a776ee192cb4c1a2618c270254fbf70879df
tree17bf0eb9377335c9fe5d3d7c18ee61c62a1415e2
parent675ed4c82df6bb53536270d900843a985ef9036e
[flang] Fold LGE/LGT/LLE/LLT intrinsic functions

Fold the legacy intrinsic functions LGE, LGT, LLE, & LLT
by rewriting them into character relational expressions and
then folding those.  Also fix folding of comparisons of
character values of distinct lengths: the shorter value must
be padded with blanks.  (This fix exposed some bad test cases,
which are also fixed.)

Differential Revision: https://reviews.llvm.org/D111843
flang/include/flang/Evaluate/common.h
flang/include/flang/Evaluate/type.h
flang/lib/Evaluate/fold-logical.cpp
flang/lib/Semantics/check-io.h
flang/lib/Semantics/data-to-inits.cpp
flang/lib/Semantics/resolve-names.cpp
flang/lib/Semantics/runtime-type-info.cpp
flang/test/Evaluate/fold-char-cmp.f90 [new file with mode: 0644]
flang/test/Evaluate/folding01.f90
flang/test/Evaluate/folding05.f90