[all-commits] [llvm/llvm-project] 1e2742: [flang] Fix complex libm use logic problems

Razvan Lupusoru via All-commits all-commits at lists.llvm.org
Wed Jul 19 13:31:07 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1e27425ada352b97773730999fb0f63fab99a89e
      https://github.com/llvm/llvm-project/commit/1e27425ada352b97773730999fb0f63fab99a89e
  Author: Razvan Lupusoru <rlupusoru at nvidia.com>
  Date:   2023-07-19 (Wed, 19 Jul 2023)

  Changed paths:
    M flang/lib/Optimizer/Builder/IntrinsicCall.cpp
    M flang/test/Lower/Intrinsics/abs.f90
    M flang/test/Lower/Intrinsics/exp.f90
    M flang/test/Lower/Intrinsics/log.f90
    M flang/test/Lower/power-operator.f90
    M flang/test/Lower/sqrt.f90

  Log Message:
  -----------
  [flang] Fix complex libm use logic problems

Fix the various complex libm selection logic issues from D155310:
- disableMlirComplex is set to false. This means that using mlir complex
is enabled. Yet, the current code still selects libm.
- If we enable mlir complex, we should not check if use approx is
enabled. Namely, we should use mlir complex either if we enable mlir
complex OR use approx is enabled.

To fix the issues, we flip the logic of `disableMlirComplex` to enable
instead. We set it to false by default since the intention from D155310
is to use libm by default. Then we use a logical `&&` with use approx
so that we select libm when BOTH mlir complex and use approx are
disabled.

Reviewed By: vzakhari

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




More information about the All-commits mailing list