[all-commits] [llvm/llvm-project] b22593: [flang] Avoid needless overflow when folding NORM2...

Peter Klausler via All-commits all-commits at lists.llvm.org
Mon Oct 16 15:55:48 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b225934a4b0d2944958a53269665b00e7eae4875
      https://github.com/llvm/llvm-project/commit/b225934a4b0d2944958a53269665b00e7eae4875
  Author: Peter Klausler <35819229+klausler at users.noreply.github.com>
  Date:   2023-10-16 (Mon, 16 Oct 2023)

  Changed paths:
    M flang/lib/Evaluate/fold-real.cpp
    M flang/lib/Evaluate/fold-reduction.h
    M flang/test/Evaluate/fold-norm2.f90

  Log Message:
  -----------
  [flang] Avoid needless overflow when folding NORM2 (#67499)

The code that folds the relatively new NORM2 intrinsic function can
produce overflow in cases where it's not warranted. Rearrange to NORM2 =
M * SQRT((A(:)/M)**2) where M is MAXVAL(ABS(A)).




More information about the All-commits mailing list