[all-commits] [llvm/llvm-project] 8773c9: [InstCombine] Extend `foldICmpBinOp` to `add`-like...

Mikhail Gudim via All-commits all-commits at lists.llvm.org
Wed Dec 20 14:29:10 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8773c9be3d9868288f1f46957945d50ff58e4e91
      https://github.com/llvm/llvm-project/commit/8773c9be3d9868288f1f46957945d50ff58e4e91
  Author: Mikhail Gudim <mgudim at gmail.com>
  Date:   2023-12-20 (Wed, 20 Dec 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/icmp.ll

  Log Message:
  -----------
  [InstCombine] Extend `foldICmpBinOp` to `add`-like `or`. (#71396)

InstCombine canonicalizes `add` to `or` when possible, but this makes
some optimizations applicable to `add` to be missed because they don't
realize that the `or` is equivalent to `add`.

In this patch we generalize `foldICmpBinOp` to handle such cases.




More information about the All-commits mailing list