[all-commits] [llvm/llvm-project] e8535f: [InstCombine] allow Negator to fold multi-use sele...

RotateRight via All-commits all-commits at lists.llvm.org
Thu Oct 28 05:36:12 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e8535fa78458abe37e54e5c01d52558c5e284092
      https://github.com/llvm/llvm-project/commit/e8535fa78458abe37e54e5c01d52558c5e284092
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-10-28 (Thu, 28 Oct 2021)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineNegator.cpp
    M llvm/test/Transforms/InstCombine/sub-of-negatible.ll

  Log Message:
  -----------
  [InstCombine] allow Negator to fold multi-use select with constant arms

The motivating test is reduced from:
https://llvm.org/PR52261

Note that the more general problem of folding any binop into a multi-use
select of constants is still there. We need to ease the restriction in
InstCombinerImpl::FoldOpIntoSelect() to catch those. But these examples
never reach that code because Negator exclusively handles negation
patterns within visitSub().

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




More information about the All-commits mailing list