[all-commits] [llvm/llvm-project] 467cbb: [InstCombine] fold more constant divisor to select...

ZCBing via All-commits all-commits at lists.llvm.org
Thu Apr 7 19:24:42 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 467cbb6249df671bccb5837c4e8f36a0646e29ae
      https://github.com/llvm/llvm-project/commit/467cbb6249df671bccb5837c4e8f36a0646e29ae
  Author: Chenbing Zheng <Chenbing.Zheng at streamcomputing.com>
  Date:   2022-04-08 (Fri, 08 Apr 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineInternal.h
    M llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/test/Transforms/InstCombine/div.ll

  Log Message:
  -----------
  [InstCombine] fold more constant divisor to select-of-constants divisor

By adding a parameter to function FoldOpIntoSelect, we can fold more Ops to Select.
For this example, we tend to fold the division instruction,
so we no longer care whether SelectInst is one use.

This patch slove TODO left in InstCombine/div.ll.

Reviewed By: RKSimon

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




More information about the All-commits mailing list