From 7e25d45cfb3572a98aac364ee74dbc4d108ebeb7 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Mon, 13 Jul 2009 20:53:00 +0000 Subject: [PATCH] Don't bother to call commonIntCastTransforms for bitcasts; int->int bitcasts will always be eliminated anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75495 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/InstructionCombining.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 39ad04f53e0..99f315fcda1 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -8257,9 +8257,8 @@ static bool isSafeIntegerType(const Type *Ty) { } } -/// Only the TRUNC, ZEXT, SEXT, and BITCAST can both operand and result as -/// integer types. This function implements the common transforms for all those -/// cases. +/// Only the TRUNC, ZEXT, SEXT. This function implements the common transforms +/// for all those cases. /// @brief Implement the transforms common to CastInst with integer operands Instruction *InstCombiner::commonIntCastTransforms(CastInst &CI) { if (Instruction *Result = commonCastTransforms(CI)) @@ -9004,10 +9003,7 @@ Instruction *InstCombiner::visitBitCast(BitCastInst &CI) { const Type *SrcTy = Src->getType(); const Type *DestTy = CI.getType(); - if (SrcTy->isInteger() && DestTy->isInteger()) { - if (Instruction *Result = commonIntCastTransforms(CI)) - return Result; - } else if (isa(SrcTy)) { + if (isa(SrcTy)) { if (Instruction *I = commonPointerCastTransforms(CI)) return I; } else {