[all-commits] [llvm/llvm-project] 7903ae: [InstCombine] factorize left shifts of add/sub

RotateRight via All-commits all-commits at lists.llvm.org
Sun Sep 20 10:00:42 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7903ae4720a8c4f3c694954d56293c7507e07945
      https://github.com/llvm/llvm-project/commit/7903ae4720a8c4f3c694954d56293c7507e07945
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2020-09-20 (Sun, 20 Sep 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
    M llvm/test/Transforms/InstCombine/shl-factor.ll

  Log Message:
  -----------
  [InstCombine] factorize left shifts of add/sub

We do similar factorization folds in SimplifyUsingDistributiveLaws,
but that drops no-wrap properties. Propagating those optimally may
help solve:
https://llvm.org/PR47430

The propagation is all-or-nothing for these patterns: when all
3 incoming ops have nsw or nuw, the 2 new ops should have the
same no-wrap property:
https://alive2.llvm.org/ce/z/Dv8wsU

This also solves:
https://llvm.org/PR47584




More information about the All-commits mailing list