[all-commits] [llvm/llvm-project] 6c04ef: [InstCombine] Z / (1.0 / Y) => (Y * Z)

Raghesh via All-commits all-commits at lists.llvm.org
Thu Jan 9 07:58:20 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 6c04ef472a8739a60a7935f77edfbacd2f50eb73
      https://github.com/llvm/llvm-project/commit/6c04ef472a8739a60a7935f77edfbacd2f50eb73
  Author: @raghesh (Raghesh Aloor) <raghesh.a at gmail.com>
  Date:   2020-01-09 (Thu, 09 Jan 2020)

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

  Log Message:
  -----------
  [InstCombine] Z / (1.0 / Y) => (Y * Z)

This is a special case of Z / (X / Y) => (Y * Z) / X, with X = 1.0.
The m_OneUse check is avoided because even in the case of the
multiple uses for 1.0/Y, the number of instructions remain the same
and a division is replaced by a multiplication.

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




More information about the All-commits mailing list