From c6948c25cc21658e5601c66a82990cd0006b8f62 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Mon, 3 Jul 2017 05:54:11 +0000 Subject: [InstCombine] Remove an if that should have been guaranteed by the caller. Replace with an assert. NFC llvm-svn: 306997 --- llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp') diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp index 53f61d6a9c7..cb3f3214e99 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp @@ -80,16 +80,14 @@ static Value *getFCmpValue(unsigned Code, Value *LHS, Value *RHS, /// \return Pointer to node that must replace the original binary operator, or /// null pointer if no transformation was made. Value *InstCombiner::SimplifyBSwap(BinaryOperator &I) { + assert(I.isBitwiseLogicOp() && "Unexpected opcode for bswap simplifying"); + IntegerType *ITy = dyn_cast(I.getType()); // Can't do vectors. if (I.getType()->isVectorTy()) return nullptr; - // Can only do bitwise ops. - if (!I.isBitwiseLogicOp()) - return nullptr; - Value *OldLHS = I.getOperand(0); Value *OldRHS = I.getOperand(1); ConstantInt *ConstLHS = dyn_cast(OldLHS); -- cgit v1.2.3