[all-commits] [llvm/llvm-project] bb9ebf: [Tests] Add tests for new InstCombine OR transform...

Dávid Bolvanský via All-commits all-commits at lists.llvm.org
Tue Jan 12 10:29:48 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bb9ebf6baf7057d7f2aed90fccbac2414cf9a134
      https://github.com/llvm/llvm-project/commit/bb9ebf6baf7057d7f2aed90fccbac2414cf9a134
  Author: Dávid Bolvanský <david.bolvansky at gmail.com>
  Date:   2021-01-12 (Tue, 12 Jan 2021)

  Changed paths:
    M llvm/test/Transforms/InstCombine/or.ll

  Log Message:
  -----------
  [Tests] Add tests for new InstCombine OR transformation, NFC


  Commit: 0529946b5bafafd10d77b946ee9fa96f388860ef
      https://github.com/llvm/llvm-project/commit/0529946b5bafafd10d77b946ee9fa96f388860ef
  Author: Dávid Bolvanský <david.bolvansky at gmail.com>
  Date:   2021-01-12 (Tue, 12 Jan 2021)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
    M llvm/test/Transforms/InstCombine/or.ll

  Log Message:
  -----------
  [instCombine] Add (A ^ B) | ~(A | B) -> ~(A & B)

define i32 @src(i32 %x, i32 %y) {
%0:
  %xor = xor i32 %y, %x
  %or = or i32 %y, %x
  %neg = xor i32 %or, 4294967295
  %or1 = or i32 %xor, %neg
  ret i32 %or1
}
=>
define i32 @tgt(i32 %x, i32 %y) {
%0:
  %and = and i32 %x, %y
  %neg = xor i32 %and, 4294967295
  ret i32 %neg
}
Transformation seems to be correct!

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


Compare: https://github.com/llvm/llvm-project/compare/5aefc8dc4d14...0529946b5baf


More information about the All-commits mailing list