Lines Matching refs:left
141 if (m.right().Is(0)) return Replace(m.left().node()); // x ^ 0 => x
143 return ReplaceInt32(m.left().Value() ^ m.right().Value());
146 if (m.left().IsWord32Xor() && m.right().Is(-1)) {
147 Int32BinopMatcher mleft(m.left().node());
149 return Replace(mleft.left().node());
162 if (m.right().Is(0)) return Replace(m.left().node()); // x ror 0 => x
165 base::bits::RotateRight32(m.left().Value(), m.right().Value()));
172 return ReplaceBool(m.left().Value() == m.right().Value());
174 if (m.left().IsInt32Sub() && m.right().Is(0)) { // x - y == 0 => x == y
175 Int32BinopMatcher msub(m.left().node());
176 node->ReplaceInput(0, msub.left().node());
187 return ReplaceBool(m.left().Value() == m.right().Value());
189 if (m.left().IsInt64Sub() && m.right().Is(0)) { // x - y == 0 => x == y
190 Int64BinopMatcher msub(m.left().node());
191 node->ReplaceInput(0, msub.left().node());
206 if (m.right().Is(1)) return Replace(m.left().node()); // x * 1 => x
208 return ReplaceInt32(m.left().Value() * m.right().Value());
212 node->ReplaceInput(1, m.left().node());
235 return ReplaceBool(m.left().Value() < m.right().Value());
243 return ReplaceBool(m.left().Value() <= m.right().Value());
250 if (m.left().Is(kMaxUInt32)) return ReplaceBool(false); // M < x => false
253 return ReplaceBool(m.left().Value() < m.right().Value());
256 if (m.left().IsWord32Sar() && m.right().HasValue()) {
257 Int32BinopMatcher mleft(m.left().node());
264 node->ReplaceInput(0, mleft.left().node());
275 if (m.left().Is(0)) return ReplaceBool(true); // 0 <= x => true
278 return ReplaceBool(m.left().Value() <= m.right().Value());
289 return ReplaceFloat64(m.left().Value() + m.right().Value());
296 return Replace(m.left().node()); // x - 0 => x
301 if (m.left().IsNaN()) { // NaN - x => NaN
302 return Replace(m.left().node());
305 return ReplaceFloat64(m.left().Value() - m.right().Value());
313 node->ReplaceInput(1, m.left().node());
317 if (m.right().Is(1)) return Replace(m.left().node()); // x * 1.0 => x
322 return ReplaceFloat64(m.left().Value() * m.right().Value());
328 if (m.right().Is(1)) return Replace(m.left().node()); // x / 1.0 => x
332 if (m.left().IsNaN()) { // NaN / x => NaN
333 return Replace(m.left().node());
336 return ReplaceFloat64(m.left().Value() / m.right().Value());
348 if (m.left().IsNaN()) { // NaN % x => NaN
349 return Replace(m.left().node());
352 return ReplaceFloat64(modulo(m.left().Value(), m.right().Value()));
366 if (m.left().IsNaN()) {
367 return Replace(m.left().node());
371 base::ieee754::atan2(m.left().Value(), m.right().Value()));
512 if (m.right().Is(0)) return Replace(m.left().node()); // x + 0 => x
514 return ReplaceUint32(bit_cast<uint32_t>(m.left().Value()) +
517 if (m.left().IsInt32Sub()) {
518 Int32BinopMatcher mleft(m.left().node());
519 if (mleft.left().Is(0)) { // (0 - x) + y => y - x
529 if (mright.left().Is(0)) { // y + (0 - x) => y - x
543 if (m.right().Is(0)) return Replace(m.left().node()); // x - 0 => x
545 return ReplaceInt32(static_cast<uint32_t>(m.left().Value()) -
561 if (m.left().Is(0)) return Replace(m.left().node()); // 0 / x => 0
563 if (m.right().Is(1)) return Replace(m.left().node()); // x / 1 => x
566 base::bits::SignedDiv32(m.left().Value(), m.right().Value()));
570 return Replace(Word32Equal(Word32Equal(m.left().node(), zero), zero));
574 node->ReplaceInput(1, m.left().node());
581 Node* const dividend = m.left().node();
609 if (m.left().Is(0)) return Replace(m.left().node()); // 0 / x => 0
611 if (m.right().Is(1)) return Replace(m.left().node()); // x / 1 => x
614 base::bits::UnsignedDiv32(m.left().Value(), m.right().Value()));
618 return Replace(Word32Equal(Word32Equal(m.left().node(), zero), zero));
621 Node* const dividend = m.left().node();
638 if (m.left().Is(0)) return Replace(m.left().node()); // 0 % x => 0
645 base::bits::SignedMod32(m.left().Value(), m.right().Value()));
648 Node* const dividend = m.left().node();
676 if (m.left().Is(0)) return Replace(m.left().node()); // 0 % x => 0
682 base::bits::UnsignedMod32(m.left().Value(), m.right().Value()));
685 Node* const dividend = m.left().node();
725 node->ReplaceInput(value_input, m.left().node());
732 if (m.left().IsWord32Shl() && ((rep == MachineRepresentation::kWord8 &&
736 Int32BinopMatcher mleft(m.left().node());
738 node->ReplaceInput(value_input, mleft.left().node());
758 bool ovf = base::bits::SignedAddOverflow32(m.left().Value(),
763 return (index == 0) ? Replace(m.left().node()) : ReplaceInt32(0);
772 bool ovf = base::bits::SignedSubOverflow32(m.left().Value(),
777 return (index == 0) ? Replace(m.left().node()) : ReplaceInt32(0);
799 node->ReplaceInput(1, mright.left().node());
811 if (m.right().Is(0)) return Replace(m.left().node()); // x << 0 => x
813 return ReplaceInt32(m.left().Value() << m.right().Value());
818 if (m.left().IsWord32Sar() || m.left().IsWord32Shr()) {
819 Int32BinopMatcher mleft(m.left().node());
821 node->ReplaceInput(0, mleft.left().node());
835 if (m.right().Is(0)) return Replace(m.left().node()); // x >>> 0 => x
837 return ReplaceInt32(m.left().Value() >> m.right().Value());
839 if (m.left().IsWord32And() && m.right().HasValue()) {
840 Uint32BinopMatcher mleft(m.left().node());
855 if (m.right().Is(0)) return Replace(m.left().node()); // x >> 0 => x
857 return ReplaceInt32(m.left().Value() >> m.right().Value());
859 if (m.left().IsWord32Shl()) {
860 Int32BinopMatcher mleft(m.left().node());
861 if (mleft.left().IsComparison()) {
865 node->ReplaceInput(1, mleft.left().node());
870 } else if (mleft.left().IsLoad()) {
872 LoadRepresentationOf(mleft.left().node()->op());
876 return Replace(mleft.left().node());
881 left().node());
893 if (m.right().Is(-1)) return Replace(m.left().node()); // x & -1 => x
894 if (m.left().IsComparison() && m.right().Is(1)) { // CMP & 1 => CMP
895 return Replace(m.left().node());
898 return ReplaceInt32(m.left().Value() & m.right().Value());
900 if (m.LeftEqualsRight()) return Replace(m.left().node()); // x & x => x
901 if (m.left().IsWord32And() && m.right().HasValue()) {
902 Int32BinopMatcher mleft(m.left().node());
904 node->ReplaceInput(0, mleft.left().node());
913 if (m.left().IsWord32Shl()) {
914 Uint32BinopMatcher mleft(m.left().node());
920 } else if (m.left().IsInt32Add()) {
921 Int32BinopMatcher mleft(m.left().node());
925 node->ReplaceInput(0, Word32And(mleft.left().node(), m.right().node()));
931 if (mleft.left().IsInt32Mul()) {
932 Int32BinopMatcher mleftleft(mleft.left().node());
948 Word32And(mleft.left().node(), m.right().node()));
955 if (mleft.left().IsWord32Shl()) {
956 Int32BinopMatcher mleftleft(mleft.left().node());
972 Word32And(mleft.left().node(), m.right().node()));
979 } else if (m.left().IsInt32Mul()) {
980 Int32BinopMatcher mleft(m.left().node());
994 if (m.right().Is(0)) return Replace(m.left().node()); // x | 0 => x
997 return ReplaceInt32(m.left().Value() | m.right().Value());
999 if (m.LeftEqualsRight()) return Replace(m.left().node()); // x | x => x
1007 if (m.left().IsWord32Shl() && m.right().IsWord32Shr()) {
1008 shl = m.left().node();
1010 } else if (m.left().IsWord32Shr() && m.right().IsWord32Shl()) {
1012 shr = m.left().node();
1019 if (mshl.left().node() != mshr.left().node()) return NoChange();
1038 if (!msub.left().Is(32) || msub.right().node() != y) return NoChange();
1041 node->ReplaceInput(0, mshl.left().node());
1098 if ((m.left().IsChangeFloat32ToFloat64() &&
1100 (m.left().IsChangeFloat32ToFloat64() &&
1102 (IsFloat64RepresentableAsFloat32(m.left()) &&
1118 0, m.left().HasValue()
1119 ? Float32Constant(static_cast<float>(m.left().Value()))
1120 : m.left().InputAt(0));