[all-commits] [llvm/llvm-project] c1937c: [NFC] Added/adjusted tests for PR48604; second pat...

Dávid Bolvanský via All-commits all-commits at lists.llvm.org
Thu Dec 31 06:05:13 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c1937c2af2a03f0b5fda3bbf99e2971ffa04ff0c
      https://github.com/llvm/llvm-project/commit/c1937c2af2a03f0b5fda3bbf99e2971ffa04ff0c
  Author: Dávid Bolvanský <david.bolvansky at gmail.com>
  Date:   2020-12-31 (Thu, 31 Dec 2020)

  Changed paths:
    M llvm/test/Transforms/InstCombine/and.ll
    M llvm/test/Transforms/InstCombine/sub.ll

  Log Message:
  -----------
  [NFC] Added/adjusted tests for PR48604; second pattern


  Commit: ae69fa9b9f65f59cc0ca8c47f23748a53c8dbdc5
      https://github.com/llvm/llvm-project/commit/ae69fa9b9f65f59cc0ca8c47f23748a53c8dbdc5
  Author: Dávid Bolvanský <david.bolvansky at gmail.com>
  Date:   2020-12-31 (Thu, 31 Dec 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
    M llvm/test/Transforms/InstCombine/sub.ll

  Log Message:
  -----------
  [InstCombine] Transform (A + B) - (A & B) to A | B (PR48604)

define i32 @src(i32 %x, i32 %y) {
%0:
  %a = add i32 %x, %y
  %o = and i32 %x, %y
  %r = sub i32 %a, %o
  ret i32 %r
}
=>
define i32 @tgt(i32 %x, i32 %y) {
%0:
  %b = or i32 %x, %y
  ret i32 %b
}
Transformation seems to be correct!

https://alive2.llvm.org/ce/z/2fhW6r


Compare: https://github.com/llvm/llvm-project/compare/742ea77ca4c0...ae69fa9b9f65


More information about the All-commits mailing list