[all-commits] [llvm/llvm-project] f5d895: [InstCombine] Transform X == 0 ? 0 : X * Y --> X *...

fzhinkin via All-commits all-commits at lists.llvm.org
Wed Sep 15 06:05:33 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f5d89523567b08420ff3fa48a6fc50dbf530afa8
      https://github.com/llvm/llvm-project/commit/f5d89523567b08420ff3fa48a6fc50dbf530afa8
  Author: Filipp Zhinkin <filipp.zhinkin at gmail.com>
  Date:   2021-09-15 (Wed, 15 Sep 2021)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
    M llvm/test/Transforms/InstCombine/select.ll

  Log Message:
  -----------
  [InstCombine] Transform X == 0 ? 0 : X * Y --> X * freeze(Y)

Enabled mul folding optimization that was previously disabled
by being incorrect.
To preserve correctness, mul's operand that is not compared
with zero in select's condition is now frozen.

Related bug: https://bugs.llvm.org/show_bug.cgi?id=51286

Correctness:
https://alive2.llvm.org/ce/z/bHef7J
https://alive2.llvm.org/ce/z/QcR7sf
https://alive2.llvm.org/ce/z/vvBLzt
https://alive2.llvm.org/ce/z/jGDXgq
https://alive2.llvm.org/ce/z/3Pe8Z4
https://alive2.llvm.org/ce/z/LGga8M
https://alive2.llvm.org/ce/z/CTG5fs

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




More information about the All-commits mailing list