]> granicus.if.org Git - llvm/commitdiff
[InstCombine] Remove an if that should have been guaranteed by the caller. Replace...
authorCraig Topper <craig.topper@intel.com>
Mon, 3 Jul 2017 05:54:11 +0000 (05:54 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 3 Jul 2017 05:54:11 +0000 (05:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306997 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/InstCombine/InstCombineAndOrXor.cpp

index 53f61d6a9c7d2cc0b04ab03fd760183d58596499..cb3f3214e99c69adfde553d503f5b8a59f2ea8b4 100644 (file)
@@ -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<IntegerType>(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<ConstantInt>(OldLHS);