Lines Matching refs:left
140 if (m.right().Is(0)) return Replace(m.left().node()); // x ^ 0 => x in Reduce()
142 return ReplaceInt32(m.left().Value() ^ m.right().Value()); in Reduce()
145 if (m.left().IsWord32Xor() && m.right().Is(-1)) { in Reduce()
146 Int32BinopMatcher mleft(m.left().node()); in Reduce()
148 return Replace(mleft.left().node()); in Reduce()
157 if (m.right().Is(0)) return Replace(m.left().node()); // x >>> 0 => x in Reduce()
159 return ReplaceInt32(m.left().Value() >> m.right().Value()); in Reduce()
167 if (m.right().Is(0)) return Replace(m.left().node()); // x ror 0 => x in Reduce()
170 base::bits::RotateRight32(m.left().Value(), m.right().Value())); in Reduce()
177 return ReplaceBool(m.left().Value() == m.right().Value()); in Reduce()
179 if (m.left().IsInt32Sub() && m.right().Is(0)) { // x - y == 0 => x == y in Reduce()
180 Int32BinopMatcher msub(m.left().node()); in Reduce()
181 node->ReplaceInput(0, msub.left().node()); in Reduce()
192 return ReplaceBool(m.left().Value() == m.right().Value()); in Reduce()
194 if (m.left().IsInt64Sub() && m.right().Is(0)) { // x - y == 0 => x == y in Reduce()
195 Int64BinopMatcher msub(m.left().node()); in Reduce()
196 node->ReplaceInput(0, msub.left().node()); in Reduce()
211 if (m.right().Is(1)) return Replace(m.left().node()); // x * 1 => x in Reduce()
213 return ReplaceInt32(m.left().Value() * m.right().Value()); in Reduce()
217 node->ReplaceInput(1, m.left().node()); in Reduce()
240 return ReplaceBool(m.left().Value() < m.right().Value()); in Reduce()
242 if (m.left().IsInt32Sub() && m.right().Is(0)) { // x - y < 0 => x < y in Reduce()
243 Int32BinopMatcher msub(m.left().node()); in Reduce()
244 node->ReplaceInput(0, msub.left().node()); in Reduce()
248 if (m.left().Is(0) && m.right().IsInt32Sub()) { // 0 < x - y => y < x in Reduce()
251 node->ReplaceInput(1, msub.left().node()); in Reduce()
260 return ReplaceBool(m.left().Value() <= m.right().Value()); in Reduce()
262 if (m.left().IsInt32Sub() && m.right().Is(0)) { // x - y <= 0 => x <= y in Reduce()
263 Int32BinopMatcher msub(m.left().node()); in Reduce()
264 node->ReplaceInput(0, msub.left().node()); in Reduce()
268 if (m.left().Is(0) && m.right().IsInt32Sub()) { // 0 <= x - y => y <= x in Reduce()
271 node->ReplaceInput(1, msub.left().node()); in Reduce()
279 if (m.left().Is(kMaxUInt32)) return ReplaceBool(false); // M < x => false in Reduce()
282 return ReplaceBool(m.left().Value() < m.right().Value()); in Reduce()
285 if (m.left().IsWord32Sar() && m.right().HasValue()) { in Reduce()
286 Int32BinopMatcher mleft(m.left().node()); in Reduce()
293 node->ReplaceInput(0, mleft.left().node()); in Reduce()
304 if (m.left().Is(0)) return ReplaceBool(true); // 0 <= x => true in Reduce()
307 return ReplaceBool(m.left().Value() <= m.right().Value()); in Reduce()
318 return ReplaceFloat64(m.left().Value() + m.right().Value()); in Reduce()
325 return Replace(m.left().node()); // x - 0 => x in Reduce()
330 if (m.left().IsNaN()) { // NaN - x => NaN in Reduce()
331 return Replace(m.left().node()); in Reduce()
334 return ReplaceFloat64(m.left().Value() - m.right().Value()); in Reduce()
342 node->ReplaceInput(1, m.left().node()); in Reduce()
346 if (m.right().Is(1)) return Replace(m.left().node()); // x * 1.0 => x in Reduce()
351 return ReplaceFloat64(m.left().Value() * m.right().Value()); in Reduce()
357 if (m.right().Is(1)) return Replace(m.left().node()); // x / 1.0 => x in Reduce()
361 if (m.left().IsNaN()) { // NaN / x => NaN in Reduce()
362 return Replace(m.left().node()); in Reduce()
365 return ReplaceFloat64(m.left().Value() / m.right().Value()); in Reduce()
377 if (m.left().IsNaN()) { // NaN % x => NaN in Reduce()
378 return Replace(m.left().node()); in Reduce()
381 return ReplaceFloat64(modulo(m.left().Value(), m.right().Value())); in Reduce()
456 if (m.right().Is(0)) return Replace(m.left().node()); // x + 0 => x in ReduceInt32Add()
458 return ReplaceUint32(bit_cast<uint32_t>(m.left().Value()) + in ReduceInt32Add()
461 if (m.left().IsInt32Sub()) { in ReduceInt32Add()
462 Int32BinopMatcher mleft(m.left().node()); in ReduceInt32Add()
463 if (mleft.left().Is(0)) { // (0 - x) + y => y - x in ReduceInt32Add()
473 if (mright.left().Is(0)) { // y + (0 - x) => y - x in ReduceInt32Add()
487 if (m.right().Is(0)) return Replace(m.left().node()); // x - 0 => x in ReduceInt32Sub()
489 return ReplaceInt32(static_cast<uint32_t>(m.left().Value()) - in ReduceInt32Sub()
505 if (m.left().Is(0)) return Replace(m.left().node()); // 0 / x => 0 in ReduceInt32Div()
507 if (m.right().Is(1)) return Replace(m.left().node()); // x / 1 => x in ReduceInt32Div()
510 base::bits::SignedDiv32(m.left().Value(), m.right().Value())); in ReduceInt32Div()
514 return Replace(Word32Equal(Word32Equal(m.left().node(), zero), zero)); in ReduceInt32Div()
518 node->ReplaceInput(1, m.left().node()); in ReduceInt32Div()
525 Node* const dividend = m.left().node(); in ReduceInt32Div()
553 if (m.left().Is(0)) return Replace(m.left().node()); // 0 / x => 0 in ReduceUint32Div()
555 if (m.right().Is(1)) return Replace(m.left().node()); // x / 1 => x in ReduceUint32Div()
558 base::bits::UnsignedDiv32(m.left().Value(), m.right().Value())); in ReduceUint32Div()
562 return Replace(Word32Equal(Word32Equal(m.left().node(), zero), zero)); in ReduceUint32Div()
565 Node* const dividend = m.left().node(); in ReduceUint32Div()
582 if (m.left().Is(0)) return Replace(m.left().node()); // 0 % x => 0 in ReduceInt32Mod()
589 base::bits::SignedMod32(m.left().Value(), m.right().Value())); in ReduceInt32Mod()
592 Node* const dividend = m.left().node(); in ReduceInt32Mod()
620 if (m.left().Is(0)) return Replace(m.left().node()); // 0 % x => 0 in ReduceUint32Mod()
626 base::bits::UnsignedMod32(m.left().Value(), m.right().Value())); in ReduceUint32Mod()
629 Node* const dividend = m.left().node(); in ReduceUint32Mod()
690 node->ReplaceInput(2, m.left().node()); in ReduceStore()
697 if (m.left().IsWord32Shl() && ((rep == MachineRepresentation::kWord8 && in ReduceStore()
701 Int32BinopMatcher mleft(m.left().node()); in ReduceStore()
703 node->ReplaceInput(2, mleft.left().node()); in ReduceStore()
723 bool ovf = base::bits::SignedAddOverflow32(m.left().Value(), in ReduceProjection()
728 return (index == 0) ? Replace(m.left().node()) : ReplaceInt32(0); in ReduceProjection()
737 bool ovf = base::bits::SignedSubOverflow32(m.left().Value(), in ReduceProjection()
742 return (index == 0) ? Replace(m.left().node()) : ReplaceInt32(0); in ReduceProjection()
764 node->ReplaceInput(1, mright.left().node()); in ReduceWord32Shifts()
776 if (m.right().Is(0)) return Replace(m.left().node()); // x << 0 => x in ReduceWord32Shl()
778 return ReplaceInt32(m.left().Value() << m.right().Value()); in ReduceWord32Shl()
783 if (m.left().IsWord32Sar() || m.left().IsWord32Shr()) { in ReduceWord32Shl()
784 Int32BinopMatcher mleft(m.left().node()); in ReduceWord32Shl()
786 node->ReplaceInput(0, mleft.left().node()); in ReduceWord32Shl()
801 if (m.right().Is(0)) return Replace(m.left().node()); // x >> 0 => x in ReduceWord32Sar()
803 return ReplaceInt32(m.left().Value() >> m.right().Value()); in ReduceWord32Sar()
805 if (m.left().IsWord32Shl()) { in ReduceWord32Sar()
806 Int32BinopMatcher mleft(m.left().node()); in ReduceWord32Sar()
807 if (mleft.left().IsComparison()) { in ReduceWord32Sar()
811 node->ReplaceInput(1, mleft.left().node()); in ReduceWord32Sar()
816 } else if (mleft.left().IsLoad()) { in ReduceWord32Sar()
818 LoadRepresentationOf(mleft.left().node()->op()); in ReduceWord32Sar()
822 return Replace(mleft.left().node()); in ReduceWord32Sar()
827 return Replace(mleft.left().node()); in ReduceWord32Sar()
839 if (m.right().Is(-1)) return Replace(m.left().node()); // x & -1 => x in ReduceWord32And()
840 if (m.left().IsComparison() && m.right().Is(1)) { // CMP & 1 => CMP in ReduceWord32And()
841 return Replace(m.left().node()); in ReduceWord32And()
844 return ReplaceInt32(m.left().Value() & m.right().Value()); in ReduceWord32And()
846 if (m.LeftEqualsRight()) return Replace(m.left().node()); // x & x => x in ReduceWord32And()
847 if (m.left().IsWord32And() && m.right().HasValue()) { in ReduceWord32And()
848 Int32BinopMatcher mleft(m.left().node()); in ReduceWord32And()
850 node->ReplaceInput(0, mleft.left().node()); in ReduceWord32And()
859 if (m.left().IsWord32Shl()) { in ReduceWord32And()
860 Uint32BinopMatcher mleft(m.left().node()); in ReduceWord32And()
866 } else if (m.left().IsInt32Add()) { in ReduceWord32And()
867 Int32BinopMatcher mleft(m.left().node()); in ReduceWord32And()
871 node->ReplaceInput(0, Word32And(mleft.left().node(), m.right().node())); in ReduceWord32And()
877 if (mleft.left().IsInt32Mul()) { in ReduceWord32And()
878 Int32BinopMatcher mleftleft(mleft.left().node()); in ReduceWord32And()
894 Word32And(mleft.left().node(), m.right().node())); in ReduceWord32And()
901 if (mleft.left().IsWord32Shl()) { in ReduceWord32And()
902 Int32BinopMatcher mleftleft(mleft.left().node()); in ReduceWord32And()
918 Word32And(mleft.left().node(), m.right().node())); in ReduceWord32And()
925 } else if (m.left().IsInt32Mul()) { in ReduceWord32And()
926 Int32BinopMatcher mleft(m.left().node()); in ReduceWord32And()
940 if (m.right().Is(0)) return Replace(m.left().node()); // x | 0 => x in ReduceWord32Or()
943 return ReplaceInt32(m.left().Value() | m.right().Value()); in ReduceWord32Or()
945 if (m.LeftEqualsRight()) return Replace(m.left().node()); // x | x => x in ReduceWord32Or()
953 if (m.left().IsWord32Shl() && m.right().IsWord32Shr()) { in ReduceWord32Or()
954 shl = m.left().node(); in ReduceWord32Or()
956 } else if (m.left().IsWord32Shr() && m.right().IsWord32Shl()) { in ReduceWord32Or()
958 shr = m.left().node(); in ReduceWord32Or()
965 if (mshl.left().node() != mshr.left().node()) return NoChange(); in ReduceWord32Or()
984 if (!msub.left().Is(32) || msub.right().node() != y) return NoChange(); in ReduceWord32Or()
987 node->ReplaceInput(0, mshl.left().node()); in ReduceWord32Or()
1044 if ((m.left().IsChangeFloat32ToFloat64() && in ReduceFloat64Compare()
1046 (m.left().IsChangeFloat32ToFloat64() && in ReduceFloat64Compare()
1048 (IsFloat64RepresentableAsFloat32(m.left()) && in ReduceFloat64Compare()
1064 0, m.left().HasValue() in ReduceFloat64Compare()
1065 ? Float32Constant(static_cast<float>(m.left().Value())) in ReduceFloat64Compare()
1066 : m.left().InputAt(0)); in ReduceFloat64Compare()