[all-commits] [llvm/llvm-project] 9d0849: [flang] Clarify CheckReductionDIM()

Peter Klausler via All-commits all-commits at lists.llvm.org
Tue Aug 9 05:52:09 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9d084982a38526fb8ba15867ecceec3e9b82a6f8
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2022-08-09 (Tue, 09 Aug 2022)

  Changed paths:
    M flang/lib/Evaluate/fold-reduction.cpp
    M flang/lib/Evaluate/fold-reduction.h

  Log Message:
  [flang] Clarify CheckReductionDIM()

This utility routine in constant folding should return false when
a DIM= actual argument to a reduction intrinsic function has a
value that prevents folding, and true when folding can proceed.
The implementation was returning true in cases where a DIM=
argument was present but not constant.

Clarify the code and add commentary: a true result means that
there is no DIM= actual argument present, or that a DIM= argument
exists, is constant, and has a value that is in range.

Differential Revision: https://reviews.llvm.org/D131101

More information about the All-commits mailing list