mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Format spacing and remove extra lines to comply with standards. NFC.
Differential Revision: http://reviews.llvm.org/D5649 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219286 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c720405b2a
commit
13ffdf88dc
@ -1522,7 +1522,6 @@ Value *InstCombiner::OptimizePointerDifference(Value *LHS, Value *RHS,
|
|||||||
return Builder->CreateIntCast(Result, Ty, true);
|
return Builder->CreateIntCast(Result, Ty, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Instruction *InstCombiner::visitSub(BinaryOperator &I) {
|
Instruction *InstCombiner::visitSub(BinaryOperator &I) {
|
||||||
Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
|
Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
|
||||||
|
|
||||||
@ -1595,21 +1594,23 @@ Instruction *InstCombiner::visitSub(BinaryOperator &I) {
|
|||||||
// -(X >>u 31) -> (X >>s 31)
|
// -(X >>u 31) -> (X >>s 31)
|
||||||
// -(X >>s 31) -> (X >>u 31)
|
// -(X >>s 31) -> (X >>u 31)
|
||||||
if (C->isZero()) {
|
if (C->isZero()) {
|
||||||
Value *X; ConstantInt *CI;
|
Value *X;
|
||||||
|
ConstantInt *CI;
|
||||||
if (match(Op1, m_LShr(m_Value(X), m_ConstantInt(CI))) &&
|
if (match(Op1, m_LShr(m_Value(X), m_ConstantInt(CI))) &&
|
||||||
// Verify we are shifting out everything but the sign bit.
|
// Verify we are shifting out everything but the sign bit.
|
||||||
CI->getValue() == I.getType()->getPrimitiveSizeInBits()-1)
|
CI->getValue() == I.getType()->getPrimitiveSizeInBits() - 1)
|
||||||
return BinaryOperator::CreateAShr(X, CI);
|
return BinaryOperator::CreateAShr(X, CI);
|
||||||
|
|
||||||
if (match(Op1, m_AShr(m_Value(X), m_ConstantInt(CI))) &&
|
if (match(Op1, m_AShr(m_Value(X), m_ConstantInt(CI))) &&
|
||||||
// Verify we are shifting out everything but the sign bit.
|
// Verify we are shifting out everything but the sign bit.
|
||||||
CI->getValue() == I.getType()->getPrimitiveSizeInBits()-1)
|
CI->getValue() == I.getType()->getPrimitiveSizeInBits() - 1)
|
||||||
return BinaryOperator::CreateLShr(X, CI);
|
return BinaryOperator::CreateLShr(X, CI);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
{ Value *Y;
|
{
|
||||||
|
Value *Y;
|
||||||
// X-(X+Y) == -Y X-(Y+X) == -Y
|
// X-(X+Y) == -Y X-(Y+X) == -Y
|
||||||
if (match(Op1, m_Add(m_Specific(Op0), m_Value(Y))) ||
|
if (match(Op1, m_Add(m_Specific(Op0), m_Value(Y))) ||
|
||||||
match(Op1, m_Add(m_Value(Y), m_Specific(Op0))))
|
match(Op1, m_Add(m_Value(Y), m_Specific(Op0))))
|
||||||
|
Loading…
Reference in New Issue
Block a user