From 5fc81ffbace7a1b1e671f36923e641f12be98a08 Mon Sep 17 00:00:00 2001 From: Nadav Rotem Date: Mon, 29 Aug 2011 19:58:36 +0000 Subject: 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. llvm-svn: 138756 --- llvm/lib/Analysis/ConstantFolding.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'llvm/lib/Analysis/ConstantFolding.cpp') diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp index 613804d6d2d..df79849c3cf 100644 --- a/llvm/lib/Analysis/ConstantFolding.cpp +++ b/llvm/lib/Analysis/ConstantFolding.cpp @@ -51,12 +51,6 @@ static Constant *FoldBitCast(Constant *C, Type *DestTy, if (C->isAllOnesValue() && !DestTy->isX86_MMXTy()) return Constant::getAllOnesValue(DestTy); - // Bitcast of Bitcast can be done using a single cast. - ConstantExpr *CE = dyn_cast(C); - if (CE && CE->getOpcode() == Instruction::BitCast) { - return ConstantExpr::getBitCast(CE->getOperand(0), DestTy); - } - // The code below only handles casts to vectors currently. VectorType *DestVTy = dyn_cast(DestTy); if (DestVTy == 0) -- cgit v1.2.3