diff options
author | Nadav Rotem <nadav.rotem@intel.com> | 2011-08-29 19:58:36 +0000 |
---|---|---|
committer | Nadav Rotem <nadav.rotem@intel.com> | 2011-08-29 19:58:36 +0000 |
commit | 89879ec76b5d81b0cc82e9f402dfe7c4cc63b0d6 (patch) | |
tree | 63b76e1c8cfe9857bd47b0b7aa99da40baace8dd /lib/Transforms/InstCombine/InstCombineCasts.cpp | |
parent | 0da10cf44d0f22111dae728bb535ade2283d976b (diff) |
Fixes following the CR by Chris and Duncan:
Optimize chained bitcasts of the form A->B->A.
Undo r138722 and change isEliminableCastPair to allow this case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138756 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/InstCombine/InstCombineCasts.cpp')
-rw-r--r-- | lib/Transforms/InstCombine/InstCombineCasts.cpp | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCasts.cpp b/lib/Transforms/InstCombine/InstCombineCasts.cpp index 6c42c0c660..ba90bf6b5c 100644 --- a/lib/Transforms/InstCombine/InstCombineCasts.cpp +++ b/lib/Transforms/InstCombine/InstCombineCasts.cpp @@ -1659,11 +1659,6 @@ Instruction *InstCombiner::visitBitCast(BitCastInst &CI) { if (DestTy == Src->getType()) return ReplaceInstUsesWith(CI, Src); - // Bitcasts are transitive. - if (BitCastInst* BSrc = dyn_cast<BitCastInst>(Src)) { - return CastInst::Create(Instruction::BitCast, BSrc->getOperand(0), DestTy); - } - if (PointerType *DstPTy = dyn_cast<PointerType>(DestTy)) { PointerType *SrcPTy = cast<PointerType>(SrcTy); Type *DstElTy = DstPTy->getElementType(); |