diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-01-05 07:20:54 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-01-05 07:20:54 +0000 |
| commit | 93ade9ff8b71d06436be24dbe7b3549acba60e3f (patch) | |
| tree | 780fdd2f242d04e194fd358a873e0273f4684bfc /lib/Transforms/InstCombine/InstructionCombining.cpp | |
| parent | 1ad73ffda02b5de1474b56b6eae26e413ec7d355 (diff) | |
| download | external_llvm-93ade9ff8b71d06436be24dbe7b3549acba60e3f.zip external_llvm-93ade9ff8b71d06436be24dbe7b3549acba60e3f.tar.gz external_llvm-93ade9ff8b71d06436be24dbe7b3549acba60e3f.tar.bz2 | |
this inline function moved to addsub
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92705 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstructionCombining.cpp')
| -rw-r--r-- | lib/Transforms/InstCombine/InstructionCombining.cpp | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp index 62f7421..1b08b0e 100644 --- a/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/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)); |
