[all-commits] [llvm/llvm-project] 71d225: [InstCombine] Add test cases from PR63321. NFC.

Yingwei Zheng via All-commits all-commits at lists.llvm.org
Sun Sep 24 04:11:50 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 71d225863f77567acab4de09932b9af5e43d8d6f
      https://github.com/llvm/llvm-project/commit/71d225863f77567acab4de09932b9af5e43d8d6f
  Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
  Date:   2023-09-24 (Sun, 24 Sep 2023)

  Changed paths:
    M llvm/test/Transforms/InstCombine/binop-cast.ll

  Log Message:
  -----------
  [InstCombine] Add test cases from PR63321. NFC.

This patch adds some test cases from https://github.com/llvm/llvm-project/issues/63321.

It is the first part of D153148.

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


  Commit: 4c241a9335c3046e418e1b4afc162bc576c072fd
      https://github.com/llvm/llvm-project/commit/4c241a9335c3046e418e1b4afc162bc576c072fd
  Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
  Date:   2023-09-24 (Sun, 24 Sep 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
    M llvm/test/Transforms/InstCombine/binop-cast.ll
    M llvm/test/Transforms/InstCombine/rem-mul-shl.ll

  Log Message:
  -----------
  [InstCombine] Fold `(-1 + A) & B` into `A ? 0 : B` where A is effectively a bool

Solves issue https://github.com/llvm/llvm-project/issues/63321.

This patch explicitly folds `(-1 + A) & B` into `A ? 0 : B`. Additional trunc will be created when `A` is neither i1 nor <N x i1>.

https://alive2.llvm.org/ce/z/pWv9jJ

Reviewed By: goldstein.w.n

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


Compare: https://github.com/llvm/llvm-project/compare/6fbbcb4ee724...4c241a9335c3


More information about the All-commits mailing list