mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-12 22:28:22 +00:00
inline a simple function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86625 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9dbb42944c
commit
b0bdac06b2
@ -383,10 +383,6 @@ namespace {
|
|||||||
/// commutative operators.
|
/// commutative operators.
|
||||||
bool SimplifyCommutative(BinaryOperator &I);
|
bool SimplifyCommutative(BinaryOperator &I);
|
||||||
|
|
||||||
/// SimplifyCompare - This reorders the operands of a CmpInst to get them in
|
|
||||||
/// most-complex to least-complex order.
|
|
||||||
bool SimplifyCompare(CmpInst &I);
|
|
||||||
|
|
||||||
/// SimplifyDemandedUseBits - Attempts to replace V with a simpler value
|
/// SimplifyDemandedUseBits - Attempts to replace V with a simpler value
|
||||||
/// based on the demanded bits.
|
/// based on the demanded bits.
|
||||||
Value *SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
|
Value *SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
|
||||||
@ -587,17 +583,6 @@ bool InstCombiner::SimplifyCommutative(BinaryOperator &I) {
|
|||||||
return Changed;
|
return Changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// SimplifyCompare - For a CmpInst this function just orders the operands
|
|
||||||
/// so that theyare listed from right (least complex) to left (most complex).
|
|
||||||
/// This puts constants before unary operators before binary operators.
|
|
||||||
bool InstCombiner::SimplifyCompare(CmpInst &I) {
|
|
||||||
if (getComplexity(I.getOperand(0)) >= getComplexity(I.getOperand(1)))
|
|
||||||
return false;
|
|
||||||
I.swapOperands();
|
|
||||||
// Compare instructions are not associative so there's nothing else we can do.
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// dyn_castNegVal - Given a 'sub' instruction, return the RHS of the instruction
|
// dyn_castNegVal - Given a 'sub' instruction, return the RHS of the instruction
|
||||||
// if the LHS is a constant zero (which is the 'negate' form).
|
// if the LHS is a constant zero (which is the 'negate' form).
|
||||||
//
|
//
|
||||||
@ -5945,7 +5930,16 @@ Instruction *InstCombiner::FoldFCmp_IntToFP_Cst(FCmpInst &I,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Instruction *InstCombiner::visitFCmpInst(FCmpInst &I) {
|
Instruction *InstCombiner::visitFCmpInst(FCmpInst &I) {
|
||||||
bool Changed = SimplifyCompare(I);
|
bool Changed = false;
|
||||||
|
|
||||||
|
/// Orders the operands of the compare so that they are listed from most
|
||||||
|
/// complex to least complex. This puts constants before unary operators,
|
||||||
|
/// before binary operators.
|
||||||
|
if (getComplexity(I.getOperand(0)) < getComplexity(I.getOperand(1))) {
|
||||||
|
I.swapOperands();
|
||||||
|
Changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
|
Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
|
||||||
|
|
||||||
// Fold trivial predicates.
|
// Fold trivial predicates.
|
||||||
@ -6050,7 +6044,16 @@ Instruction *InstCombiner::visitFCmpInst(FCmpInst &I) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Instruction *InstCombiner::visitICmpInst(ICmpInst &I) {
|
Instruction *InstCombiner::visitICmpInst(ICmpInst &I) {
|
||||||
bool Changed = SimplifyCompare(I);
|
bool Changed = false;
|
||||||
|
|
||||||
|
/// Orders the operands of the compare so that they are listed from most
|
||||||
|
/// complex to least complex. This puts constants before unary operators,
|
||||||
|
/// before binary operators.
|
||||||
|
if (getComplexity(I.getOperand(0)) < getComplexity(I.getOperand(1))) {
|
||||||
|
I.swapOperands();
|
||||||
|
Changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
|
Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);
|
||||||
const Type *Ty = Op0->getType();
|
const Type *Ty = Op0->getType();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user