Lines Matching refs:left
170 if (m.right().Is(0)) return Replace(m.left().node()); // x ror 0 => x in Reduce()
173 base::bits::RotateRight32(m.left().Value(), m.right().Value())); in Reduce()
180 return ReplaceBool(m.left().Value() == m.right().Value()); in Reduce()
182 if (m.left().IsInt32Sub() && m.right().Is(0)) { // x - y == 0 => x == y in Reduce()
183 Int32BinopMatcher msub(m.left().node()); in Reduce()
184 node->ReplaceInput(0, msub.left().node()); in Reduce()
195 return ReplaceBool(m.left().Value() == m.right().Value()); in Reduce()
197 if (m.left().IsInt64Sub() && m.right().Is(0)) { // x - y == 0 => x == y in Reduce()
198 Int64BinopMatcher msub(m.left().node()); in Reduce()
199 node->ReplaceInput(0, msub.left().node()); in Reduce()
218 if (m.right().Is(1)) return Replace(m.left().node()); // x * 1 => x in Reduce()
220 return ReplaceInt32(m.left().Value() * m.right().Value()); in Reduce()
224 node->ReplaceInput(1, m.left().node()); in Reduce()
239 node->ReplaceInput(1, m.left().node()); in Reduce()
245 node->ReplaceInput(1, m.left().node()); in Reduce()
262 return ReplaceBool(m.left().Value() < m.right().Value()); in Reduce()
265 if (m.left().IsWord32Or() && m.right().Is(0)) { in Reduce()
267 Int32BinopMatcher mleftmatcher(m.left().node()); in Reduce()
268 if (mleftmatcher.left().IsNegative() || in Reduce()
278 return ReplaceBool(m.left().Value() <= m.right().Value()); in Reduce()
285 if (m.left().Is(kMaxUInt32)) return ReplaceBool(false); // M < x => false in Reduce()
288 return ReplaceBool(m.left().Value() < m.right().Value()); in Reduce()
291 if (m.left().IsWord32Sar() && m.right().HasValue()) { in Reduce()
292 Int32BinopMatcher mleft(m.left().node()); in Reduce()
299 node->ReplaceInput(0, mleft.left().node()); in Reduce()
310 if (m.left().Is(0)) return ReplaceBool(true); // 0 <= x => true in Reduce()
313 return ReplaceBool(m.left().Value() <= m.right().Value()); in Reduce()
322 return Replace(m.left().node()); // x - 0 => x in Reduce()
328 if (m.left().IsNaN()) { // NaN - x => NaN in Reduce()
330 return ReplaceFloat32(m.left().Value() - m.left().Value()); in Reduce()
333 return ReplaceFloat32(m.left().Value() - m.right().Value()); in Reduce()
335 if (allow_signalling_nan_ && m.left().IsMinusZero()) { in Reduce()
341 if (mright0.left().IsMinusZero()) { in Reduce()
357 return ReplaceFloat64(m.left().Value() + m.right().Value()); in Reduce()
365 return Replace(m.left().node()); // x - 0 => x in Reduce()
371 if (m.left().IsNaN()) { // NaN - x => NaN in Reduce()
373 return ReplaceFloat64(m.left().Value() - m.left().Value()); in Reduce()
376 return ReplaceFloat64(m.left().Value() - m.right().Value()); in Reduce()
378 if (allow_signalling_nan_ && m.left().IsMinusZero()) { in Reduce()
384 if (mright0.left().IsMinusZero()) { in Reduce()
400 return Replace(m.left().node()); // x * 1.0 => x in Reduce()
403 node->ReplaceInput(1, m.left().node()); in Reduce()
412 return ReplaceFloat64(m.left().Value() * m.right().Value()); in Reduce()
415 node->ReplaceInput(1, m.left().node()); in Reduce()
424 return Replace(m.left().node()); // x / 1.0 => x in Reduce()
430 if (m.left().IsNaN()) { // NaN / x => NaN in Reduce()
432 return ReplaceFloat64(m.left().Value() - m.left().Value()); in Reduce()
435 return ReplaceFloat64(m.left().Value() / m.right().Value()); in Reduce()
460 if (m.left().IsNaN()) { // NaN % x => NaN in Reduce()
461 return Replace(m.left().node()); in Reduce()
464 return ReplaceFloat64(Modulo(m.left().Value(), m.right().Value())); in Reduce()
503 if (m.left().IsNaN()) { in Reduce()
504 return Replace(m.left().node()); in Reduce()
508 base::ieee754::atan2(m.left().Value(), m.right().Value())); in Reduce()
560 return ReplaceFloat64(Pow(m.left().Value(), m.right().Value())); in Reduce()
565 node->ReplaceInput(1, Float64Mul(m.left().node(), m.left().node())); in Reduce()
569 node->ReplaceInput(1, m.left().node()); in Reduce()
575 node->ReplaceInput(1, Float64PowHalf(m.left().node())); in Reduce()
580 return Replace(Float64PowHalf(m.left().node())); in Reduce()
702 if (m.right().Is(0)) return Replace(m.left().node()); // x + 0 => x in ReduceInt32Add()
704 return ReplaceUint32(bit_cast<uint32_t>(m.left().Value()) + in ReduceInt32Add()
707 if (m.left().IsInt32Sub()) { in ReduceInt32Add()
708 Int32BinopMatcher mleft(m.left().node()); in ReduceInt32Add()
709 if (mleft.left().Is(0)) { // (0 - x) + y => y - x in ReduceInt32Add()
719 if (mright.left().Is(0)) { // y + (0 - x) => y - x in ReduceInt32Add()
732 if (m.right().Is(0)) return Replace(m.left().node()); // x + 0 => 0 in ReduceInt64Add()
734 return Replace(Uint64Constant(bit_cast<uint64_t>(m.left().Value()) + in ReduceInt64Add()
743 if (m.right().Is(0)) return Replace(m.left().node()); // x - 0 => x in ReduceInt32Sub()
745 return ReplaceInt32(static_cast<uint32_t>(m.left().Value()) - in ReduceInt32Sub()
761 if (m.right().Is(0)) return Replace(m.left().node()); // x - 0 => x in ReduceInt64Sub()
763 return Replace(Uint64Constant(bit_cast<uint64_t>(m.left().Value()) - in ReduceInt64Sub()
778 if (m.left().Is(0)) return Replace(m.left().node()); // 0 / x => 0 in ReduceInt32Div()
780 if (m.right().Is(1)) return Replace(m.left().node()); // x / 1 => x in ReduceInt32Div()
783 base::bits::SignedDiv32(m.left().Value(), m.right().Value())); in ReduceInt32Div()
787 return Replace(Word32Equal(Word32Equal(m.left().node(), zero), zero)); in ReduceInt32Div()
791 node->ReplaceInput(1, m.left().node()); in ReduceInt32Div()
798 Node* const dividend = m.left().node(); in ReduceInt32Div()
826 if (m.left().Is(0)) return Replace(m.left().node()); // 0 / x => 0 in ReduceUint32Div()
828 if (m.right().Is(1)) return Replace(m.left().node()); // x / 1 => x in ReduceUint32Div()
831 base::bits::UnsignedDiv32(m.left().Value(), m.right().Value())); in ReduceUint32Div()
835 return Replace(Word32Equal(Word32Equal(m.left().node(), zero), zero)); in ReduceUint32Div()
838 Node* const dividend = m.left().node(); in ReduceUint32Div()
855 if (m.left().Is(0)) return Replace(m.left().node()); // 0 % x => 0 in ReduceInt32Mod()
862 base::bits::SignedMod32(m.left().Value(), m.right().Value())); in ReduceInt32Mod()
865 Node* const dividend = m.left().node(); in ReduceInt32Mod()
892 if (m.left().Is(0)) return Replace(m.left().node()); // 0 % x => 0 in ReduceUint32Mod()
898 base::bits::UnsignedMod32(m.left().Value(), m.right().Value())); in ReduceUint32Mod()
901 Node* const dividend = m.left().node(); in ReduceUint32Mod()
942 node->ReplaceInput(value_input, m.left().node()); in ReduceStore()
949 if (m.left().IsWord32Shl() && ((rep == MachineRepresentation::kWord8 && in ReduceStore()
953 Int32BinopMatcher mleft(m.left().node()); in ReduceStore()
955 node->ReplaceInput(value_input, mleft.left().node()); in ReduceStore()
975 bool ovf = base::bits::SignedAddOverflow32(m.left().Value(), in ReduceProjection()
980 return Replace(index == 0 ? m.left().node() : m.right().node()); in ReduceProjection()
989 bool ovf = base::bits::SignedSubOverflow32(m.left().Value(), in ReduceProjection()
994 return Replace(index == 0 ? m.left().node() : m.right().node()); in ReduceProjection()
1003 bool ovf = base::bits::SignedMulOverflow32(m.left().Value(), in ReduceProjection()
1011 return index == 0 ? Replace(m.left().node()) : ReplaceInt32(0); in ReduceProjection()
1033 node->ReplaceInput(1, mright.left().node()); in ReduceWord32Shifts()
1045 if (m.right().Is(0)) return Replace(m.left().node()); // x << 0 => x in ReduceWord32Shl()
1047 return ReplaceInt32(m.left().Value() << m.right().Value()); in ReduceWord32Shl()
1052 if (m.left().IsWord32Sar() || m.left().IsWord32Shr()) { in ReduceWord32Shl()
1053 Int32BinopMatcher mleft(m.left().node()); in ReduceWord32Shl()
1055 node->ReplaceInput(0, mleft.left().node()); in ReduceWord32Shl()
1070 if (m.right().Is(0)) return Replace(m.left().node()); // x << 0 => x in ReduceWord64Shl()
1072 return ReplaceInt64(m.left().Value() << m.right().Value()); in ReduceWord64Shl()
1079 if (m.right().Is(0)) return Replace(m.left().node()); // x >>> 0 => x in ReduceWord32Shr()
1081 return ReplaceInt32(m.left().Value() >> m.right().Value()); in ReduceWord32Shr()
1083 if (m.left().IsWord32And() && m.right().HasValue()) { in ReduceWord32Shr()
1084 Uint32BinopMatcher mleft(m.left().node()); in ReduceWord32Shr()
1100 if (m.right().Is(0)) return Replace(m.left().node()); // x >>> 0 => x in ReduceWord64Shr()
1102 return ReplaceInt64(m.left().Value() >> m.right().Value()); in ReduceWord64Shr()
1109 if (m.right().Is(0)) return Replace(m.left().node()); // x >> 0 => x in ReduceWord32Sar()
1111 return ReplaceInt32(m.left().Value() >> m.right().Value()); in ReduceWord32Sar()
1113 if (m.left().IsWord32Shl()) { in ReduceWord32Sar()
1114 Int32BinopMatcher mleft(m.left().node()); in ReduceWord32Sar()
1115 if (mleft.left().IsComparison()) { in ReduceWord32Sar()
1119 node->ReplaceInput(1, mleft.left().node()); in ReduceWord32Sar()
1124 } else if (mleft.left().IsLoad()) { in ReduceWord32Sar()
1126 LoadRepresentationOf(mleft.left().node()->op()); in ReduceWord32Sar()
1130 return Replace(mleft.left().node()); in ReduceWord32Sar()
1135 return Replace(mleft.left().node()); in ReduceWord32Sar()
1144 if (m.right().Is(0)) return Replace(m.left().node()); // x >> 0 => x in ReduceWord64Sar()
1146 return ReplaceInt64(m.left().Value() >> m.right().Value()); in ReduceWord64Sar()
1155 if (m.right().Is(-1)) return Replace(m.left().node()); // x & -1 => x in ReduceWord32And()
1156 if (m.left().IsComparison() && m.right().Is(1)) { // CMP & 1 => CMP in ReduceWord32And()
1157 return Replace(m.left().node()); in ReduceWord32And()
1160 return ReplaceInt32(m.left().Value() & m.right().Value()); in ReduceWord32And()
1162 if (m.LeftEqualsRight()) return Replace(m.left().node()); // x & x => x in ReduceWord32And()
1163 if (m.left().IsWord32And() && m.right().HasValue()) { in ReduceWord32And()
1164 Int32BinopMatcher mleft(m.left().node()); in ReduceWord32And()
1166 node->ReplaceInput(0, mleft.left().node()); in ReduceWord32And()
1175 if (m.left().IsWord32Shl()) { in ReduceWord32And()
1176 Uint32BinopMatcher mleft(m.left().node()); in ReduceWord32And()
1183 } else if (m.left().IsInt32Add()) { in ReduceWord32And()
1184 Int32BinopMatcher mleft(m.left().node()); in ReduceWord32And()
1188 node->ReplaceInput(0, Word32And(mleft.left().node(), m.right().node())); in ReduceWord32And()
1194 if (mleft.left().IsInt32Mul()) { in ReduceWord32And()
1195 Int32BinopMatcher mleftleft(mleft.left().node()); in ReduceWord32And()
1211 Word32And(mleft.left().node(), m.right().node())); in ReduceWord32And()
1218 if (mleft.left().IsWord32Shl()) { in ReduceWord32And()
1219 Int32BinopMatcher mleftleft(mleft.left().node()); in ReduceWord32And()
1235 Word32And(mleft.left().node(), m.right().node())); in ReduceWord32And()
1242 } else if (m.left().IsInt32Mul()) { in ReduceWord32And()
1243 Int32BinopMatcher mleft(m.left().node()); in ReduceWord32And()
1265 if (m.left().IsWord32Shl() && m.right().IsWord32Shr()) { in TryMatchWord32Ror()
1266 shl = m.left().node(); in TryMatchWord32Ror()
1268 } else if (m.left().IsWord32Shr() && m.right().IsWord32Shl()) { in TryMatchWord32Ror()
1270 shr = m.left().node(); in TryMatchWord32Ror()
1277 if (mshl.left().node() != mshr.left().node()) return NoChange(); in TryMatchWord32Ror()
1296 if (!msub.left().Is(32) || msub.right().node() != y) return NoChange(); in TryMatchWord32Ror()
1299 node->ReplaceInput(0, mshl.left().node()); in TryMatchWord32Ror()
1308 if (m.right().Is(0)) return Replace(m.left().node()); // x | 0 => x in ReduceWord32Or()
1311 return ReplaceInt32(m.left().Value() | m.right().Value()); in ReduceWord32Or()
1313 if (m.LeftEqualsRight()) return Replace(m.left().node()); // x | x => x in ReduceWord32Or()
1321 if (m.right().Is(0)) return Replace(m.left().node()); // x ^ 0 => x in ReduceWord32Xor()
1323 return ReplaceInt32(m.left().Value() ^ m.right().Value()); in ReduceWord32Xor()
1326 if (m.left().IsWord32Xor() && m.right().Is(-1)) { in ReduceWord32Xor()
1327 Int32BinopMatcher mleft(m.left().node()); in ReduceWord32Xor()
1329 return Replace(mleft.left().node()); in ReduceWord32Xor()
1386 if ((m.left().IsChangeFloat32ToFloat64() && in ReduceFloat64Compare()
1388 (m.left().IsChangeFloat32ToFloat64() && in ReduceFloat64Compare()
1390 (IsFloat64RepresentableAsFloat32(m.left()) && in ReduceFloat64Compare()
1406 0, m.left().HasValue() in ReduceFloat64Compare()
1407 ? Float32Constant(static_cast<float>(m.left().Value())) in ReduceFloat64Compare()
1408 : m.left().InputAt(0)); in ReduceFloat64Compare()