diff options
author | Craig Topper <craig.topper@intel.com> | 2017-07-03 05:54:11 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2017-07-03 05:54:11 +0000 |
commit | c6948c25cc21658e5601c66a82990cd0006b8f62 (patch) | |
tree | 88aa181dc439814d36af71259f48e671ddc83f94 /llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp | |
parent | 80cbc776cb3001c43bc9f5473e871af1d49a4c5e (diff) | |
download | bcm5719-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.cpp | 6 |
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); |