mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 19:29:31 +00:00
Fix De Morgan's name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15343 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
acd1f0fcb3
commit
cb6267bc60
@ -1124,7 +1124,7 @@ Instruction *InstCombiner::visitAnd(BinaryOperator &I) {
|
|||||||
if (Op0NotVal == Op1 || Op1NotVal == Op0) // A & ~A == ~A & A == 0
|
if (Op0NotVal == Op1 || Op1NotVal == Op0) // A & ~A == ~A & A == 0
|
||||||
return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType()));
|
return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType()));
|
||||||
|
|
||||||
// (~A & ~B) == (~(A | B)) - Demorgan's Law
|
// (~A & ~B) == (~(A | B)) - De Morgan's Law
|
||||||
if (Op0NotVal && Op1NotVal && isOnlyUse(Op0) && isOnlyUse(Op1)) {
|
if (Op0NotVal && Op1NotVal && isOnlyUse(Op0) && isOnlyUse(Op1)) {
|
||||||
Instruction *Or = BinaryOperator::createOr(Op0NotVal, Op1NotVal,
|
Instruction *Or = BinaryOperator::createOr(Op0NotVal, Op1NotVal,
|
||||||
I.getName()+".demorgan");
|
I.getName()+".demorgan");
|
||||||
@ -1198,7 +1198,7 @@ Instruction *InstCombiner::visitOr(BinaryOperator &I) {
|
|||||||
return ReplaceInstUsesWith(I,
|
return ReplaceInstUsesWith(I,
|
||||||
ConstantIntegral::getAllOnesValue(I.getType()));
|
ConstantIntegral::getAllOnesValue(I.getType()));
|
||||||
|
|
||||||
// (~A | ~B) == (~(A & B)) - Demorgan's Law
|
// (~A | ~B) == (~(A & B)) - De Morgan's Law
|
||||||
if (A && isOnlyUse(Op0) && isOnlyUse(Op1)) {
|
if (A && isOnlyUse(Op0) && isOnlyUse(Op1)) {
|
||||||
Value *And = InsertNewInstBefore(BinaryOperator::createAnd(A, B,
|
Value *And = InsertNewInstBefore(BinaryOperator::createAnd(A, B,
|
||||||
I.getName()+".demorgan"), I);
|
I.getName()+".demorgan"), I);
|
||||||
|
Loading…
Reference in New Issue
Block a user