From: Craig Topper Date: Mon, 3 Jul 2017 05:54:11 +0000 (+0000) Subject: [InstCombine] Remove an if that should have been guaranteed by the caller. Replace... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=946c2f9898b923ca4c6a85c70f41098399573b40;p=llvm [InstCombine] Remove an if that should have been guaranteed by the caller. Replace with an assert. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306997 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp index 53f61d6a9c7..cb3f3214e99 100644 --- a/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp +++ b/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);