[all-commits] [llvm/llvm-project] f5759a: [flang] Try to lower math intrinsics to math opera...

Slava Zakharin via All-commits all-commits at lists.llvm.org
Fri Jul 22 09:05:33 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f5759add702eb0b1243198d7f49b7a010b977f5d
      https://github.com/llvm/llvm-project/commit/f5759add702eb0b1243198d7f49b7a010b977f5d
  Author: Slava Zakharin <szakharin at nvidia.com>
  Date:   2022-07-22 (Fri, 22 Jul 2022)

  Changed paths:
    M flang/lib/Lower/IntrinsicCall.cpp
    R flang/test/Intrinsics/late-math-codegen.fir
    A flang/test/Intrinsics/math-codegen.fir
    M flang/test/Lower/Intrinsics/abs.f90
    M flang/test/Lower/Intrinsics/anint.f90
    M flang/test/Lower/Intrinsics/ceiling.f90
    M flang/test/Lower/Intrinsics/exp.f90
    M flang/test/Lower/Intrinsics/floor.f90
    M flang/test/Lower/Intrinsics/log.f90
    M flang/test/Lower/Intrinsics/math-runtime-options.f90
    M flang/test/Lower/Intrinsics/sign.f90
    M flang/test/Lower/array-elemental-calls-2.f90
    M flang/test/Lower/array-expression.f90
    M flang/test/Lower/dummy-procedure.f90
    R flang/test/Lower/late-math-lowering.f90
    R flang/test/Lower/llvm-math.f90
    A flang/test/Lower/math-lowering.f90
    M flang/test/Lower/power-operator.f90
    M flang/test/Lower/sqrt.f90
    M flang/test/Lower/trigonometric-intrinsics.f90

  Log Message:
  -----------
  [flang] Try to lower math intrinsics to math operations first.

This commit changes how math intrinsics are lowered: we, first,
try to lower them into MLIR operations or libm calls via
mathOperations table and only then fallback to pgmath runtime calls.

The pgmath fallback is needed, because mathOperations does not
support all intrinsics that pgmath supports. The main purpose
of this change is to get rid of llvmIntrinsics table so that
we do not have to update both llvmIntrinsics and mathOperations
when adding new intrinsic support.

mathOperations lowering should phase out pgmath lowering, when
more operations are available (e.g. power operations being
added in D129809 and D129811; complex type operations from
Complex dialect).

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




More information about the All-commits mailing list