InstCombine: Hoist 3 copies of AddOne/SubOne into a header.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199605 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer
2014-01-19 16:56:10 +00:00
parent c7645e860a
commit 2b03d0051f
4 changed files with 9 additions and 30 deletions

View File

@@ -845,17 +845,6 @@ Value *FAddCombine::createAddendVal
return createFMul(OpndVal, Coeff.getValue(Instr->getType()));
}
/// AddOne - Add one to a ConstantInt.
static Constant *AddOne(Constant *C) {
return ConstantExpr::getAdd(C, ConstantInt::get(C->getType(), 1));
}
/// SubOne - Subtract one from a ConstantInt.
static Constant *SubOne(Constant *C) {
return ConstantExpr::getAdd(C, ConstantInt::getAllOnesValue(C->getType()));
}
// dyn_castFoldableMul - If this value is a multiply that can be folded into
// other computations (because it has a constant operand), return the
// non-constant operand of the multiply, and set CST to point to the multiplier.