aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/InstCombine/InstCombineCasts.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-10 01:35:55 +0000
committerChris Lattner <sabre@nondot.org>2010-01-10 01:35:55 +0000
commit3f7dc880c4b558655cb8868ce29e1d2b27e2ea51 (patch)
tree1d20cb3f8559a22d64af1f09d51abe958be3c336 /lib/Transforms/InstCombine/InstCombineCasts.cpp
parent5c1735a4dfb3e50cbd800645382ff78e9edb813a (diff)
remove an xform subsumed by EvaluateInDifferentType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93095 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineCasts.cpp')
-rw-r--r--lib/Transforms/InstCombine/InstCombineCasts.cpp27
1 files changed, 0 insertions, 27 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCasts.cpp b/lib/Transforms/InstCombine/InstCombineCasts.cpp
index 8a2e8447ab..a6833b8825 100644
--- a/lib/Transforms/InstCombine/InstCombineCasts.cpp
+++ b/lib/Transforms/InstCombine/InstCombineCasts.cpp
@@ -953,33 +953,6 @@ Instruction *InstCombiner::visitSExt(SExtInst &CI) {
return SelectInst::Create(Src,
Constant::getAllOnesValue(CI.getType()),
Constant::getNullValue(CI.getType()));
-
- // See if the value being truncated is already sign extended. If so, just
- // eliminate the trunc/sext pair.
- if (Operator::getOpcode(Src) == Instruction::Trunc) {
- Value *Op = cast<User>(Src)->getOperand(0);
- unsigned OpBits = Op->getType()->getScalarSizeInBits();
- unsigned MidBits = SrcTy->getScalarSizeInBits();
- unsigned DestBits = DestTy->getScalarSizeInBits();
- unsigned NumSignBits = ComputeNumSignBits(Op);
-
- if (OpBits == DestBits) {
- // Op is i32, Mid is i8, and Dest is i32. If Op has more than 24 sign
- // bits, it is already ready.
- if (NumSignBits > DestBits-MidBits)
- return ReplaceInstUsesWith(CI, Op);
- } else if (OpBits < DestBits) {
- // Op is i32, Mid is i8, and Dest is i64. If Op has more than 24 sign
- // bits, just sext from i32.
- if (NumSignBits > OpBits-MidBits)
- return new SExtInst(Op, CI.getType(), "tmp");
- } else {
- // Op is i64, Mid is i8, and Dest is i32. If Op has more than 56 sign
- // bits, just truncate to i32.
- if (NumSignBits > OpBits-MidBits)
- return new TruncInst(Op, CI.getType(), "tmp");
- }
- }
// Attempt to extend the entire input expression tree to the destination
// type. Only do this if the dest type is a simple type, don't convert the