summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-05 07:20:54 +0000
committerChris Lattner <sabre@nondot.org>2010-01-05 07:20:54 +0000
commit85e65e58ac76acbc1dac340c87699c4889f67802 (patch)
treee170380dbfd30d9d7e64604879e49008fff5d8ea /llvm/lib/Transforms
parent82aa888e8c8b52def338e8221ce5b211d2061af2 (diff)
downloadbcm5719-llvm-85e65e58ac76acbc1dac340c87699c4889f67802.tar.gz
bcm5719-llvm-85e65e58ac76acbc1dac340c87699c4889f67802.zip
this inline function moved to addsub
llvm-svn: 92705
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstructionCombining.cpp24
1 files changed, 0 insertions, 24 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
index 62f74210d5a..1b08b0e0557 100644
--- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -251,30 +251,6 @@ static inline Value *dyn_castNotVal(Value *V) {
-// 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.
-// Otherwise, return null.
-//
-static inline Value *dyn_castFoldableMul(Value *V, ConstantInt *&CST) {
- if (V->hasOneUse() && V->getType()->isInteger())
- if (Instruction *I = dyn_cast<Instruction>(V)) {
- if (I->getOpcode() == Instruction::Mul)
- if ((CST = dyn_cast<ConstantInt>(I->getOperand(1))))
- return I->getOperand(0);
- if (I->getOpcode() == Instruction::Shl)
- if ((CST = dyn_cast<ConstantInt>(I->getOperand(1)))) {
- // The multiplier is really 1 << CST.
- uint32_t BitWidth = cast<IntegerType>(V->getType())->getBitWidth();
- uint32_t CSTVal = CST->getLimitedValue(BitWidth);
- CST = ConstantInt::get(V->getType()->getContext(),
- APInt(BitWidth, 1).shl(CSTVal));
- return I->getOperand(0);
- }
- }
- return 0;
-}
-
/// AddOne - Add one to a ConstantInt.
static Constant *AddOne(Constant *C) {
return ConstantExpr::getAdd(C, ConstantInt::get(C->getType(), 1));
OpenPOWER on IntegriCloud