[all-commits] [llvm/llvm-project] 1444e5: [flang] Complete implementation of OUT_OF_RANGE() ...

Peter Klausler via All-commits all-commits at lists.llvm.org
Mon Apr 22 15:46:21 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1444e5acfb75630c23b118c39454a05cf3792d35
      https://github.com/llvm/llvm-project/commit/1444e5acfb75630c23b118c39454a05cf3792d35
  Author: Peter Klausler <35819229+klausler at users.noreply.github.com>
  Date:   2024-04-22 (Mon, 22 Apr 2024)

  Changed paths:
    M flang/include/flang/Common/real.h
    M flang/include/flang/Decimal/binary-floating-point.h
    M flang/include/flang/Evaluate/complex.h
    M flang/include/flang/Evaluate/integer.h
    M flang/include/flang/Evaluate/real.h
    M flang/include/flang/Evaluate/type.h
    M flang/lib/Decimal/big-radix-floating-point.h
    M flang/lib/Evaluate/complex.cpp
    M flang/lib/Evaluate/fold-logical.cpp
    M flang/lib/Evaluate/integer.cpp
    M flang/lib/Evaluate/real.cpp
    M flang/test/Evaluate/fold-out_of_range.f90
    A flang/test/Evaluate/rewrite-out_of_range.F90

  Log Message:
  -----------
  [flang] Complete implementation of OUT_OF_RANGE() (#89334)

The intrinsic function OUT_OF_RANGE() lacks support in lowering and the
runtime. This patch obviates a need for any such support by implementing
OUT_OF_RANGE() via rewriting in semantics. This rewriting of
OUT_OF_RANGE() calls replaces the existing code that folds
OUT_OF_RANGE() calls with constant arguments.

Some changes and fixes were necessary outside of OUT_OF_RANGE()'s
folding code (now rewriting code), whose testing exposed some other
issues worth fixing.

- The common::RealDetails<> template class was recoded in terms of a new
base class with a constexpr constructor, so that the the characteristics
of the various REAL kinds could be queried dynamically as well. This
affected some client usage.
- There were bugs in the code that folds TRANSFER() when the type of X
or MOLD was REAL(10) -- this is a type that occupies 16 bytes per
element in execution memory but only 10 bytes (was 12) in the data of
std::vector<Scalar<>> in a Constant<>.
- Folds of REAL->REAL conversions weren't preserving infinities.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list