mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-23 12:24:34 +00:00
reduce nesting.
llvm-svn: 99358
This commit is contained in:
parent
01e2cd0da3
commit
f468453934
@ -473,15 +473,14 @@ def trunc_su : PatFrag<(ops node:$src), (trunc node:$src), [{
|
||||
def or_is_add : PatFrag<(ops node:$lhs, node:$rhs), (or node:$lhs, node:$rhs),[{
|
||||
if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(N->getOperand(1)))
|
||||
return CurDAG->MaskedValueIsZero(N->getOperand(0), CN->getAPIntValue());
|
||||
else {
|
||||
unsigned BitWidth = N->getValueType(0).getScalarType().getSizeInBits();
|
||||
APInt Mask = APInt::getAllOnesValue(BitWidth);
|
||||
APInt KnownZero0, KnownOne0;
|
||||
CurDAG->ComputeMaskedBits(N->getOperand(0), Mask, KnownZero0, KnownOne0, 0);
|
||||
APInt KnownZero1, KnownOne1;
|
||||
CurDAG->ComputeMaskedBits(N->getOperand(1), Mask, KnownZero1, KnownOne1, 0);
|
||||
return (~KnownZero0 & ~KnownZero1) == 0;
|
||||
}
|
||||
|
||||
unsigned BitWidth = N->getValueType(0).getScalarType().getSizeInBits();
|
||||
APInt Mask = APInt::getAllOnesValue(BitWidth);
|
||||
APInt KnownZero0, KnownOne0;
|
||||
CurDAG->ComputeMaskedBits(N->getOperand(0), Mask, KnownZero0, KnownOne0, 0);
|
||||
APInt KnownZero1, KnownOne1;
|
||||
CurDAG->ComputeMaskedBits(N->getOperand(1), Mask, KnownZero1, KnownOne1, 0);
|
||||
return (~KnownZero0 & ~KnownZero1) == 0;
|
||||
}]>;
|
||||
|
||||
// 'shld' and 'shrd' instruction patterns. Note that even though these have
|
||||
|
Loading…
x
Reference in New Issue
Block a user