diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-01-05 21:16:30 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-01-05 21:16:30 +0000 |
| commit | 44a63815b9903623d4f635195b5fbb5daf231da4 (patch) | |
| tree | 5b43b9d093bc85266ee65970343c8a407f602088 /llvm/lib | |
| parent | c2044a1193f2ffb8587fda869a3d9f846944dd42 (diff) | |
| download | bcm5719-llvm-44a63815b9903623d4f635195b5fbb5daf231da4.tar.gz bcm5719-llvm-44a63815b9903623d4f635195b5fbb5daf231da4.zip | |
just remove this xform which is subsumed by others.
llvm-svn: 92775
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp index 8a66660e92d..4d44cc97704 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp @@ -680,32 +680,7 @@ Instruction *InstCombiner::visitTrunc(TruncInst &CI) { Value *V2 = ConstantExpr::getTrunc(ShAmtV, DestTy); return BinaryOperator::CreateShl(V1, V2); } - - // If we are discarding information from a simple binop, rewrite. - if (Src->hasOneUse() && isa<Instruction>(Src)) { - Instruction *SrcI = cast<Instruction>(Src); - switch (SrcI->getOpcode()) { - default: break; - case Instruction::Add: - // TODO: SUB? - case Instruction::Mul: - case Instruction::And: - case Instruction::Or: - case Instruction::Xor: - Value *Op0 = SrcI->getOperand(0); - Value *Op1 = SrcI->getOperand(1); - - // Don't insert two casts unless at least one can be eliminated. - if (!ValueRequiresCast(Instruction::Trunc, Op1, DestTy) || - !ValueRequiresCast(Instruction::Trunc, Op0, DestTy)) { - Op0 = Builder->CreateTrunc(Op0, DestTy, Op0->getName()); - Op1 = Builder->CreateTrunc(Op1, DestTy, Op1->getName()); - return BinaryOperator::Create(cast<BinaryOperator>(SrcI)->getOpcode(), - Op0, Op1); - } - } - } - + return 0; } |

