[all-commits] [llvm/llvm-project] 4426a1: [InstCombine] Add log-pow simplification for FP ex...

Tanmay via All-commits all-commits at lists.llvm.org
Wed Jan 17 01:50:22 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4426a1b7593a6e15caa09006d2446c95c19b5193
      https://github.com/llvm/llvm-project/commit/4426a1b7593a6e15caa09006d2446c95c19b5193
  Author: Tanmay <tnmysachan at gmail.com>
  Date:   2024-01-17 (Wed, 17 Jan 2024)

  Changed paths:
    M llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
    M llvm/test/Transforms/InstCombine/log-pow.ll

  Log Message:
  -----------
  [InstCombine] Add log-pow simplification for FP exponent edge case. (#76641)

Fixes https://github.com/llvm/llvm-project/issues/76549

The cause of the optimization miss was -
1. `optimizePow` converting almost integer FP exponents to integer, and
turning `pow` to `powi`.
2. `optimizeLog` not accepting `Intrinsic::powi` as a target.

This patch converts constantInt back to constantFP where applicable and
adds a test.




More information about the All-commits mailing list