mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
[InstCombine] Remove an if that should have been guaranteed by the caller. Replace with an assert. NFC
llvm-svn: 306997
This commit is contained in:
parent
8101679254
commit
6ccf4facf7
@ -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
|
/// \return Pointer to node that must replace the original binary operator, or
|
||||||
/// null pointer if no transformation was made.
|
/// null pointer if no transformation was made.
|
||||||
Value *InstCombiner::SimplifyBSwap(BinaryOperator &I) {
|
Value *InstCombiner::SimplifyBSwap(BinaryOperator &I) {
|
||||||
|
assert(I.isBitwiseLogicOp() && "Unexpected opcode for bswap simplifying");
|
||||||
|
|
||||||
IntegerType *ITy = dyn_cast<IntegerType>(I.getType());
|
IntegerType *ITy = dyn_cast<IntegerType>(I.getType());
|
||||||
|
|
||||||
// Can't do vectors.
|
// Can't do vectors.
|
||||||
if (I.getType()->isVectorTy())
|
if (I.getType()->isVectorTy())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
// Can only do bitwise ops.
|
|
||||||
if (!I.isBitwiseLogicOp())
|
|
||||||
return nullptr;
|
|
||||||
|
|
||||||
Value *OldLHS = I.getOperand(0);
|
Value *OldLHS = I.getOperand(0);
|
||||||
Value *OldRHS = I.getOperand(1);
|
Value *OldRHS = I.getOperand(1);
|
||||||
ConstantInt *ConstLHS = dyn_cast<ConstantInt>(OldLHS);
|
ConstantInt *ConstLHS = dyn_cast<ConstantInt>(OldLHS);
|
||||||
|
Loading…
Reference in New Issue
Block a user