[all-commits] [llvm/llvm-project] d4493d: [InstCombine] add nuw to any (1<<x)

Sanjay Patel via All-commits all-commits at lists.llvm.org
Thu Dec 15 09:04:00 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d4493dd1ed58ac3f1eab0c4ca6e363e2b15bfd1c
      https://github.com/llvm/llvm-project/commit/d4493dd1ed58ac3f1eab0c4ca6e363e2b15bfd1c
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-12-15 (Thu, 15 Dec 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
    M llvm/test/Transforms/InstCombine/and-or-icmps.ll
    M llvm/test/Transforms/InstCombine/and2.ll
    M llvm/test/Transforms/InstCombine/apint-shl-trunc.ll
    M llvm/test/Transforms/InstCombine/canonicalize-low-bit-mask-v2-and-icmp-eq-to-icmp-ule.ll
    M llvm/test/Transforms/InstCombine/canonicalize-low-bit-mask-v2-and-icmp-ne-to-icmp-ugt.ll
    M llvm/test/Transforms/InstCombine/canonicalize-low-bit-mask-v3-and-icmp-eq-to-icmp-ule.ll
    M llvm/test/Transforms/InstCombine/canonicalize-low-bit-mask-v3-and-icmp-ne-to-icmp-ugt.ll
    M llvm/test/Transforms/InstCombine/canonicalize-low-bit-mask-v4-and-icmp-eq-to-icmp-ule.ll
    M llvm/test/Transforms/InstCombine/canonicalize-low-bit-mask-v4-and-icmp-ne-to-icmp-ugt.ll
    M llvm/test/Transforms/InstCombine/conditional-variable-length-signext-after-high-bit-extract.ll
    M llvm/test/Transforms/InstCombine/div-shift.ll
    M llvm/test/Transforms/InstCombine/get-lowbitmask-upto-and-including-bit.ll
    M llvm/test/Transforms/InstCombine/icmp-trunc.ll
    M llvm/test/Transforms/InstCombine/icmp-uge-of-add-of-shl-one-by-bits-to-allones-and-val-to-icmp-eq-of-lshr-val-by-bits-and-0.ll
    M llvm/test/Transforms/InstCombine/icmp-uge-of-not-of-shl-allones-by-bits-and-val-to-icmp-eq-of-lshr-val-by-bits-and-0.ll
    M llvm/test/Transforms/InstCombine/icmp-ugt-of-shl-1-by-bits-and-val-to-icmp-eq-of-lshr-val-by-bits-and-0.ll
    M llvm/test/Transforms/InstCombine/icmp-ule-of-shl-1-by-bits-and-val-to-icmp-ne-of-lshr-val-by-bits-and-0.ll
    M llvm/test/Transforms/InstCombine/icmp-ult-of-add-of-shl-one-by-bits-to-allones-and-val-to-icmp-ne-of-lshr-val-by-bits-and-0.ll
    M llvm/test/Transforms/InstCombine/icmp-ult-of-not-of-shl-allones-by-bits-and-val-to-icmp-ne-of-lshr-val-by-bits-and-0.ll
    M llvm/test/Transforms/InstCombine/icmp.ll
    M llvm/test/Transforms/InstCombine/memchr.ll
    M llvm/test/Transforms/InstCombine/mul-inseltpoison.ll
    M llvm/test/Transforms/InstCombine/mul.ll
    M llvm/test/Transforms/InstCombine/onehot_merge.ll
    M llvm/test/Transforms/InstCombine/partally-redundant-left-shift-input-masking-after-truncation-variant-a.ll
    M llvm/test/Transforms/InstCombine/partally-redundant-left-shift-input-masking-variant-a.ll
    M llvm/test/Transforms/InstCombine/redundant-left-shift-input-masking-after-truncation-variant-a.ll
    M llvm/test/Transforms/InstCombine/redundant-left-shift-input-masking-variant-a.ll
    M llvm/test/Transforms/InstCombine/rem.ll
    M llvm/test/Transforms/InstCombine/select-ctlz-to-cttz.ll
    M llvm/test/Transforms/InstCombine/set-lowbits-mask-canonicalize.ll
    M llvm/test/Transforms/InstCombine/shift-add.ll
    M llvm/test/Transforms/InstCombine/shift-direction-in-bit-test.ll
    M llvm/test/Transforms/InstCombine/shift.ll
    M llvm/test/Transforms/InstCombine/shl-sub.ll
    M llvm/test/Transforms/InstCombine/strchr-1.ll
    M llvm/test/Transforms/InstCombine/sub-of-negatible-inseltpoison.ll
    M llvm/test/Transforms/InstCombine/sub-of-negatible.ll
    M llvm/test/Transforms/InstCombine/xor.ll
    M llvm/test/Transforms/InstCombine/zext.ll

  Log Message:
  -----------
  [InstCombine] add nuw to any (1<<x)

https://alive2.llvm.org/ce/z/9EjDKE

This was mentioned as a missing fold in D139598.

It can unlock follow-on folds in some cases.
This verifies one of the changed tests:
https://alive2.llvm.org/ce/z/B_btDM




More information about the All-commits mailing list