[PATCH] D113216: [InstCombine] (~(a | b) & c) | ~(a | b | c) -> ~(a | b)
Stanislav Mekhanoshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 10 12:42:38 PST 2021
rampitec planned changes to this revision.
rampitec added a comment.
In the light of D113526 <https://reviews.llvm.org/D113526> this needs to be rebased and handle inverted pattern:
(~(a & b) | c) & ~(a & b & c) -> ~(a & b)
----------------------------------------
define i4 @src(i4 %a, i4 %b, i4 %c) {
%0:
%and1 = and i4 %c, %a
%and2 = and i4 %and1, %b
%not1 = xor i4 %and2, 15
%and3 = and i4 %a, %b
%not2 = xor i4 %and3, 15
%or2 = or i4 %not2, %c
%and4 = and i4 %or2, %not1
ret i4 %and4
}
=>
define i4 @tgt(i4 %a, i4 %b, i4 %c) {
%0:
%and = and i4 %a, %b
%not = xor i4 %and, 15
ret i4 %not
}
Transformation seems to be correct!
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113216/new/
https://reviews.llvm.org/D113216
More information about the llvm-commits
mailing list