Lines Matching refs:left
339 if (m.right().Is(0)) return Replace(m.left().node()); // x ror 0 => x
342 m.left().ResolvedValue(), m.right().ResolvedValue() & 31));
352 return ReplaceBool(m.left().ResolvedValue() ==
355 if (m.left().IsInt64Sub() && m.right().Is(0)) { // x - y == 0 => x == y
356 Int64BinopMatcher msub(m.left().node());
357 node->ReplaceInput(0, msub.left().node());
365 if (!ObjectsMayAlias(m.left().node(), m.right().node())) {
381 if (m.right().Is(1)) return Replace(m.left().node()); // x * 1 => x
383 return ReplaceInt32(base::MulWithWraparound(m.left().ResolvedValue(),
388 node->ReplaceInput(1, m.left().node());
399 if (m.right().HasResolvedValue() && m.left().IsInt32Mul()) {
400 Int32BinopMatcher n(m.left().node());
401 if (n.right().HasResolvedValue() && m.OwnsInput(m.left().node())) {
405 node->ReplaceInput(0, n.left().node());
414 node->ReplaceInput(1, m.left().node());
420 node->ReplaceInput(1, m.left().node());
439 return ReplaceBool(m.left().ResolvedValue() <
443 if (m.left().IsWord32Or() && m.right().Is(0)) {
445 Int32BinopMatcher mleftmatcher(m.left().node());
446 if (mleftmatcher.left().IsNegative() ||
456 return ReplaceBool(m.left().ResolvedValue() <=
464 if (m.left().Is(kMaxUInt32)) return ReplaceBool(false); // M < x => false
467 return ReplaceBool(m.left().ResolvedValue() <
471 if (m.left().IsWord32Sar() && m.right().HasResolvedValue()) {
472 Int32BinopMatcher mleft(m.left().node());
479 node->ReplaceInput(0, mleft.left().node());
490 if (m.left().Is(0)) return ReplaceBool(true); // 0 <= x => true
493 return ReplaceBool(m.left().ResolvedValue() <=
503 return Replace(m.left().node()); // x - 0 => x
508 if (m.left().IsNaN()) { // NaN - x => NaN
509 return ReplaceFloat32(SilenceNaN(m.left().ResolvedValue()));
512 return ReplaceFloat32(m.left().ResolvedValue() -
515 if (allow_signalling_nan_ && m.left().IsMinusZero()) {
521 if (mright0.left().IsMinusZero()) {
539 if (m.left().IsNaN()) { // NaN + x => NaN
540 return ReplaceFloat64(SilenceNaN(m.left().ResolvedValue()));
543 return ReplaceFloat64(m.left().ResolvedValue() +
552 return Replace(m.left().node()); // x - 0 => x
557 if (m.left().IsNaN()) { // NaN - x => NaN
558 return ReplaceFloat64(SilenceNaN(m.left().ResolvedValue()));
561 return ReplaceFloat64(m.left().ResolvedValue() -
564 if (allow_signalling_nan_ && m.left().IsMinusZero()) {
570 if (mright0.left().IsMinusZero()) {
586 return Replace(m.left().node()); // x * 1.0 => x
589 node->ReplaceInput(1, m.left().node());
597 return ReplaceFloat64(m.left().ResolvedValue() *
601 node->ReplaceInput(1, m.left().node());
610 return Replace(m.left().node()); // x / 1.0 => x
615 if (m.left().IsNaN()) { // NaN / x => NaN
616 return ReplaceFloat64(SilenceNaN(m.left().ResolvedValue()));
620 base::Divide(m.left().ResolvedValue(), m.right().ResolvedValue()));
645 if (m.left().IsNaN()) { // NaN % x => NaN
646 return ReplaceFloat64(SilenceNaN(m.left().ResolvedValue()));
650 Modulo(m.left().ResolvedValue(), m.right().ResolvedValue()));
695 if (m.left().IsNaN()) {
696 return ReplaceFloat64(SilenceNaN(m.left().ResolvedValue()));
699 return ReplaceFloat64(base::ieee754::atan2(m.left().ResolvedValue(),
761 return ReplaceFloat64(base::ieee754::pow(m.left().ResolvedValue(),
766 node->ReplaceInput(1, m.left().node());
771 return Replace(Float64PowHalf(m.left().node()));
925 return ReplaceBool(m.left().ResolvedValue() <
933 return ReplaceBool(m.left().ResolvedValue() <=
941 return ReplaceBool(m.left().ResolvedValue() <
949 return ReplaceBool(m.left().ResolvedValue() <=
985 if (m.right().Is(0)) return Replace(m.left().node()); // x + 0 => x
987 return ReplaceInt32(base::AddWithWraparound(m.left().ResolvedValue(),
990 if (m.left().IsInt32Sub()) {
991 Int32BinopMatcher mleft(m.left().node());
992 if (mleft.left().Is(0)) { // (0 - x) + y => y - x
1001 if (mright.left().Is(0)) { // y + (0 - x) => y - x
1008 if (m.right().HasResolvedValue() && m.left().IsInt32Add()) {
1009 Int32BinopMatcher n(m.left().node());
1010 if (n.right().HasResolvedValue() && m.OwnsInput(m.left().node())) {
1014 node->ReplaceInput(0, n.left().node());
1025 if (m.right().Is(0)) return Replace(m.left().node()); // x + 0 => 0
1027 return ReplaceInt64(base::AddWithWraparound(m.left().ResolvedValue(),
1031 if (m.right().HasResolvedValue() && m.left().IsInt64Add()) {
1032 Int64BinopMatcher n(m.left().node());
1033 if (n.right().HasResolvedValue() && m.OwnsInput(m.left().node())) {
1037 node->ReplaceInput(0, n.left().node());
1047 if (m.right().Is(0)) return Replace(m.left().node()); // x - 0 => x
1049 return ReplaceInt32(base::SubWithWraparound(m.left().ResolvedValue(),
1066 if (m.right().Is(0)) return Replace(m.left().node()); // x - 0 => x
1068 return ReplaceInt64(base::SubWithWraparound(m.left().ResolvedValue(),
1086 if (m.right().Is(1)) return Replace(m.left().node()); // x * 1 => x
1088 return ReplaceInt64(base::MulWithWraparound(m.left().ResolvedValue(),
1093 node->ReplaceInput(1, m.left().node());
1105 if (m.right().HasResolvedValue() && m.left().IsInt64Mul()) {
1106 Int64BinopMatcher n(m.left().node());
1107 if (n.right().HasResolvedValue() && m.OwnsInput(m.left().node())) {
1111 node->ReplaceInput(0, n.left().node());
1120 if (m.left().Is(0)) return Replace(m.left().node()); // 0 / x => 0
1122 if (m.right().Is(1)) return Replace(m.left().node()); // x / 1 => x
1124 return ReplaceInt32(base::bits::SignedDiv32(m.left().ResolvedValue(),
1129 return Replace(Word32Equal(Word32Equal(m.left().node(), zero), zero));
1133 node->ReplaceInput(1, m.left().node());
1140 Node* const dividend = m.left().node();
1167 if (m.left().Is(0)) return Replace(m.left().node()); // 0 / x => 0
1169 if (m.right().Is(1)) return Replace(m.left().node()); // x / 1 => x
1171 return ReplaceUint32(base::bits::UnsignedDiv32(m.left().ResolvedValue(),
1176 return Replace(Word32Equal(Word32Equal(m.left().node(), zero), zero));
1179 Node* const dividend = m.left().node();
1196 if (m.left().Is(0)) return Replace(m.left().node()); // 0 % x => 0
1202 return ReplaceInt32(base::bits::SignedMod32(m.left().ResolvedValue(),
1206 Node* const dividend = m.left().node();
1232 if (m.left().Is(0)) return Replace(m.left().node()); // 0 % x => 0
1237 return ReplaceUint32(base::bits::UnsignedMod32(m.left().ResolvedValue(),
1241 Node* const dividend = m.left().node();
1277 node->ReplaceInput(value_input, m.left().node());
1284 if (m.left().IsWord32Shl() && ((rep == MachineRepresentation::kWord8 &&
1288 Int32BinopMatcher mleft(m.left().node());
1290 node->ReplaceInput(value_input, mleft.left().node());
1310 m.left().ResolvedValue(), m.right().ResolvedValue(), &val);
1314 return Replace(index == 0 ? m.left().node() : m.right().node());
1324 m.left().ResolvedValue(), m.right().ResolvedValue(), &val);
1328 return Replace(index == 0 ? m.left().node() : m.right().node());
1338 m.left().ResolvedValue(), m.right().ResolvedValue(), &val);
1345 return index == 0 ? Replace(m.left().node()) : ReplaceInt32(0);
1358 // as "left shifting |value| by |shift| doesn't shift away significant bits".
1359 // Or, equivalently, "left shifting |value| by |shift| doesn't have signed
1382 if (m.left().op() == machine()->Word32SarShiftOutZeros() &&
1384 Int32BinopMatcher mleft(m.left().node());
1388 node->ReplaceInput(0, mleft.left().node());
1389 node->ReplaceInput(1, mright.left().node());
1396 m.left().op() == machine()->Word32SarShiftOutZeros() &&
1397 m.left().node()->UseCount() == 1) {
1399 Int32BinopMatcher mleft(m.left().node());
1403 node->ReplaceInput(0, mleft.left().node());
1411 if (m.left().HasResolvedValue() &&
1414 uint32_t left = m.left().ResolvedValue();
1418 if (CanRevertLeftShiftWithRightShift(left, shift)) {
1419 node->ReplaceInput(0, Int32Constant(left << shift));
1420 node->ReplaceInput(1, mright.left().node());
1454 m.left().IsChangeInt32ToInt64() && m.right().IsChangeInt32ToInt64();
1455 if (sign_extended || (m.left().IsChangeUint32ToUint64() &&
1457 node->ReplaceInput(0, NodeProperties::GetValueInput(m.left().node(), 0));
1466 if (m.left().op() == machine()->Word64SarShiftOutZeros() &&
1468 Int64BinopMatcher mleft(m.left().node());
1472 node->ReplaceInput(0, mleft.left().node());
1473 node->ReplaceInput(1, mright.left().node());
1492 node->ReplaceInput(1, mright.left().node());
1503 if (m.right().Is(0)) return Replace(m.left().node()); // x << 0 => x
1505 return ReplaceInt32(base::ShlWithWraparound(m.left().ResolvedValue(),
1509 if (m.left().IsWord32Sar() || m.left().IsWord32Shr()) {
1510 Int32BinopMatcher mleft(m.left().node());
1520 Node* x = mleft.left().node();
1541 node->ReplaceInput(0, mleft.left().node());
1556 if (m.right().Is(0)) return Replace(m.left().node()); // x << 0 => x
1558 return ReplaceInt64(base::ShlWithWraparound(m.left().ResolvedValue(),
1562 (m.left().IsWord64Sar() || m.left().IsWord64Shr())) {
1563 Int64BinopMatcher mleft(m.left().node());
1573 Node* x = mleft.left().node();
1594 node->ReplaceInput(0, mleft.left().node());
1606 if (m.right().Is(0)) return Replace(m.left().node()); // x >>> 0 => x
1608 return ReplaceInt32(m.left().ResolvedValue() >>
1611 if (m.left().IsWord32And() && m.right().HasResolvedValue()) {
1612 Uint32BinopMatcher mleft(m.left().node());
1628 if (m.right().Is(0)) return Replace(m.left().node()); // x >>> 0 => x
1630 return ReplaceInt64(m.left().ResolvedValue() >>
1638 if (m.right().Is(0)) return Replace(m.left().node()); // x >> 0 => x
1640 return ReplaceInt32(m.left().ResolvedValue() >>
1643 if (m.left().IsWord32Shl()) {
1644 Int32BinopMatcher mleft(m.left().node());
1645 if (mleft.left().IsComparison()) {
1649 node->ReplaceInput(1, mleft.left().node());
1653 } else if (mleft.left().IsLoad()) {
1655 LoadRepresentationOf(mleft.left().node()->op());
1659 return Replace(mleft.left().node());
1664 return Replace(mleft.left().node());
1673 if (m.right().Is(0)) return Replace(m.left().node()); // x >> 0 => x
1675 return ReplaceInt64(m.left().ResolvedValue() >>
1688 if (m.right().Is(-1)) return Replace(m.left().node()); // x & -1 => x
1689 if (m.left().IsComparison() && m.right().Is(1)) { // CMP & 1 => CMP
1690 return Replace(m.left().node());
1693 return a.ReplaceIntN(m.left().ResolvedValue() & m.right().ResolvedValue());
1695 if (m.LeftEqualsRight()) return Replace(m.left().node()); // x & x => x
1696 if (A::IsWordNAnd(m.left()) && m.right().HasResolvedValue()) {
1697 typename A::IntNBinopMatcher mleft(m.left().node());
1699 node->ReplaceInput(0, mleft.left().node());
1708 if (A::IsWordNShl(m.left())) {
1709 typename A::UintNBinopMatcher mleft(m.left().node());
1716 } else if (A::IsIntNAdd(m.left())) {
1717 typename A::IntNBinopMatcher mleft(m.left().node());
1723 a.WordNAnd(mleft.left().node(), m.right().node()));
1728 if (A::IsIntNMul(mleft.left())) {
1729 typename A::IntNBinopMatcher mleftleft(mleft.left().node());
1744 a.WordNAnd(mleft.left().node(), m.right().node()));
1750 if (A::IsWordNShl(mleft.left())) {
1751 typename A::IntNBinopMatcher mleftleft(mleft.left().node());
1766 a.WordNAnd(mleft.left().node(), m.right().node()));
1772 } else if (A::IsIntNMul(m.left())) {
1773 typename A::IntNBinopMatcher mleft(m.left().node());
1812 if (eq.left().IsWord32And()) {
1813 Uint32BinopMatcher mand(eq.left().node());
1818 if (mand.left().IsTruncateInt64ToInt32()) {
1820 NodeProperties::GetValueInput(mand.left().node(), 0), mask,
1823 return BitfieldCheck(mand.left().node(), mask, masked_value, false);
1862 if (WordNAdapter::IsWordNShr(mand.left()) ||
1863 WordNAdapter::IsWordNSar(mand.left())) {
1864 typename WordNAdapter::UintNBinopMatcher shift(mand.left().node());
1868 return BitfieldCheck{shift.left().node(), mask, mask,
1872 return BitfieldCheck{mand.left().node(), 1, 1,
1893 if (auto left_bitfield = BitfieldCheck::Detect(m.left().node())) {
1930 if (m.left().IsWord32Shl() && m.right().IsWord32Shr()) {
1931 shl = m.left().node();
1933 } else if (m.left().IsWord32Shr() && m.right().IsWord32Shl()) {
1935 shr = m.left().node();
1942 if (mshl.left().node() != mshr.left().node()) return NoChange();
1967 if (!msub.left().Is(32) || msub.right().node() != y) return NoChange();
1973 node->ReplaceInput(0, mshl.left().node());
1985 if (m.right().Is(0)) return Replace(m.left().node()); // x | 0 => x
1988 return a.ReplaceIntN(m.left().ResolvedValue() | m.right().ResolvedValue());
1990 if (m.LeftEqualsRight()) return Replace(m.left().node()); // x | x => x
1995 if (A::IsWordNAnd(m.left())) {
1996 typename A::IntNBinopMatcher mand(m.left().node());
1999 node->ReplaceInput(0, mand.left().node());
2025 if (m.right().Is(0)) return Replace(m.left().node()); // x ^ 0 => x
2027 return a.ReplaceIntN(m.left().ResolvedValue() ^ m.right().ResolvedValue());
2030 if (A::IsWordNXor(m.left()) && m.right().Is(-1)) {
2031 typename A::IntNBinopMatcher mleft(m.left().node());
2033 return Replace(mleft.left().node());
2043 if (m.right().IsWord32Equal() && m.left().Is(1)) {
2057 return ReplaceBool(m.left().ResolvedValue() == m.right().ResolvedValue());
2059 if (m.left().IsInt32Sub() && m.right().Is(0)) { // x - y == 0 => x == y
2060 Int32BinopMatcher msub(m.left().node());
2061 node->ReplaceInput(0, msub.left().node());
2069 if (m.left().IsTruncateInt64ToInt32()) {
2071 NodeProperties::GetValueInput(m.left().node(), 0),
2075 m.left().node(), static_cast<uint32_t>(m.right().ResolvedValue()));
2085 if (!ObjectsMayAlias(m.left().node(), m.right().node())) {
2137 return ReplaceBool(m.left().ResolvedValue() ==
2140 return ReplaceBool(m.left().ResolvedValue() <
2143 return ReplaceBool(m.left().ResolvedValue() <=
2148 } else if ((m.left().IsChangeFloat32ToFloat64() &&
2150 (m.left().IsChangeFloat32ToFloat64() &&
2152 (IsFloat64RepresentableAsFloat32(m.left()) &&
2173 0, m.left().HasResolvedValue()
2174 ? Float32Constant(static_cast<float>(m.left().ResolvedValue()))
2175 : m.left().InputAt(0));
2219 return m.left().node();
2354 if ((WordNAdapter::IsWordNShr(mand.left()) ||
2355 WordNAdapter::IsWordNSar(mand.left())) &&
2357 typename WordNAdapter::UintNBinopMatcher mshift(mand.left().node());
2367 Node* new_input = mshift.left().node();
2387 return std::make_pair(mshift.left().node(), rhs << shift);