summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2017-07-03 05:54:11 +0000
committerCraig Topper <craig.topper@intel.com>2017-07-03 05:54:11 +0000
commitc6948c25cc21658e5601c66a82990cd0006b8f62 (patch)
tree88aa181dc439814d36af71259f48e671ddc83f94 /llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
parent80cbc776cb3001c43bc9f5473e871af1d49a4c5e (diff)
downloadbcm5719-llvm-c6948c25cc21658e5601c66a82990cd0006b8f62.tar.gz
bcm5719-llvm-c6948c25cc21658e5601c66a82990cd0006b8f62.zip
[InstCombine] Remove an if that should have been guaranteed by the caller. Replace with an assert. NFC
llvm-svn: 306997
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp6
1 files changed, 2 insertions, 4 deletions
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<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);
OpenPOWER on IntegriCloud