[all-commits] [llvm/llvm-project] cb7cb8: [InstCombine] Add check to avoid dependent optimiz...

Allen via All-commits all-commits at lists.llvm.org
Sat Apr 20 21:12:33 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cb7cb83010bbcd8e5325d81b6d80653c7b513516
      https://github.com/llvm/llvm-project/commit/cb7cb83010bbcd8e5325d81b6d80653c7b513516
  Author: zhongyunde 00443407 <zhongyunde at huawei.com>
  Date:   2024-04-21 (Sun, 21 Apr 2024)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp

  Log Message:
  -----------
  [InstCombine] Add check to avoid dependent optimization order, NFC

Since PR86428, foldPowiReassoc is called by both FMul and FDiv,
as the optimization of FDiv is placed after the FMul, so now
it is correct we don't add the checking of FDiv for powi(X, Y) / X.
But, we may add more matching scenarios later, so add the checking opcode
explicitly is easier to understand.


  Commit: 56ca5ecf416ad0e57c5e3558159bd73e5d662476
      https://github.com/llvm/llvm-project/commit/56ca5ecf416ad0e57c5e3558159bd73e5d662476
  Author: zhongyunde 00443407 <zhongyunde at huawei.com>
  Date:   2024-04-21 (Sun, 21 Apr 2024)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
    M llvm/test/Transforms/InstCombine/powi.ll

  Log Message:
  -----------
  [InstCombine] Optimize powi(X, Y)/ (X * Z) with Ofast

foldFDivPowDivisor can address A / powi(x, y) to A * powi(x, -y),
while for small const value y, for example y=2, the instcombine will
transform powi(x, 2) to fmul x, x, so it is not optimal for A / powi(x, 2).

Fix https://github.com/llvm/llvm-project/issues/77171


Compare: https://github.com/llvm/llvm-project/compare/811ffc049ff9...56ca5ecf416a

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list