mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-03 19:15:30 +00:00
InstSimplify: Don't bother if getScalarSizeInBits returns zero
getScalarSizeInBits returns zero when the comparison operands are not integral. No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224675 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f666c0549e
commit
821c6f765a
@ -3152,14 +3152,15 @@ static Value *SimplifySelectInst(Value *CondVal, Value *TrueVal,
|
||||
if (isa<UndefValue>(FalseVal)) // select C, X, undef -> X
|
||||
return TrueVal;
|
||||
|
||||
if (const auto *ICI = dyn_cast<ICmpInst>(CondVal)) {
|
||||
const auto *ICI = dyn_cast<ICmpInst>(CondVal);
|
||||
unsigned BitWidth = TrueVal->getType()->getScalarSizeInBits();
|
||||
if (ICI && BitWidth) {
|
||||
ICmpInst::Predicate Pred = ICI->getPredicate();
|
||||
APInt MinSignedValue =
|
||||
APInt::getSignBit(TrueVal->getType()->getScalarSizeInBits());
|
||||
APInt MinSignedValue = APInt::getSignBit(BitWidth);
|
||||
Value *X;
|
||||
const APInt *Y;
|
||||
bool IsBitTest = false;
|
||||
bool TrueWhenUnset;
|
||||
bool IsBitTest = false;
|
||||
if (ICmpInst::isEquality(Pred) &&
|
||||
match(ICI->getOperand(0), m_And(m_Value(X), m_APInt(Y))) &&
|
||||
match(ICI->getOperand(1), m_Zero())) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user