diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp index ada921bc2dea4..4651767d0655a 100644 --- a/llvm/lib/IR/ConstantFold.cpp +++ b/llvm/lib/IR/ConstantFold.cpp @@ -83,18 +83,8 @@ static Constant *FoldBitCast(Constant *V, Type *DestTy) { return nullptr; } - // Finally, implement bitcast folding now. The code below doesn't handle - // bitcast right. - if (isa(V)) // ptr->ptr cast. - return ConstantPointerNull::get(cast(DestTy)); - // Handle integral constant input. if (ConstantInt *CI = dyn_cast(V)) { - if (DestTy->isIntegerTy()) - // Integral -> Integral. This is a no-op because the bit widths must - // be the same. Consequently, we just fold to V. - return V; - // See note below regarding the PPC_FP128 restriction. if (DestTy->isFloatingPointTy() && !DestTy->isPPC_FP128Ty()) return ConstantFP::get(DestTy->getContext(),