• Home
  • Raw
  • Download

Lines Matching refs:node

63   Node* const node = graph()->NewNode(machine()->Word32And(), lhs, rhs);  in Word32And()  local
64 Reduction const reduction = ReduceWord32And(node); in Word32And()
65 return reduction.Changed() ? reduction.replacement() : node; in Word32And()
87 Node* const node = graph()->NewNode(machine()->Int32Add(), lhs, rhs); in Int32Add() local
88 Reduction const reduction = ReduceInt32Add(node); in Int32Add()
89 return reduction.Changed() ? reduction.replacement() : node; in Int32Add()
94 Node* const node = graph()->NewNode(machine()->Int32Sub(), lhs, rhs); in Int32Sub() local
95 Reduction const reduction = ReduceInt32Sub(node); in Int32Sub()
96 return reduction.Changed() ? reduction.replacement() : node; in Int32Sub()
146 Reduction MachineOperatorReducer::Reduce(Node* node) { in Reduce() argument
147 switch (node->opcode()) { in Reduce()
149 return ReduceProjection(ProjectionIndexOf(node->op()), node->InputAt(0)); in Reduce()
151 return ReduceWord32And(node); in Reduce()
153 return ReduceWord32Or(node); in Reduce()
155 return ReduceWord32Xor(node); in Reduce()
157 return ReduceWord32Shl(node); in Reduce()
159 return ReduceWord64Shl(node); in Reduce()
161 return ReduceWord32Shr(node); in Reduce()
163 return ReduceWord64Shr(node); in Reduce()
165 return ReduceWord32Sar(node); in Reduce()
167 return ReduceWord64Sar(node); in Reduce()
169 Int32BinopMatcher m(node); in Reduce()
170 if (m.right().Is(0)) return Replace(m.left().node()); // x ror 0 => x in Reduce()
178 Int32BinopMatcher m(node); in Reduce()
183 Int32BinopMatcher msub(m.left().node()); in Reduce()
184 node->ReplaceInput(0, msub.left().node()); in Reduce()
185 node->ReplaceInput(1, msub.right().node()); in Reduce()
186 return Changed(node); in Reduce()
193 Int64BinopMatcher m(node); in Reduce()
198 Int64BinopMatcher msub(m.left().node()); in Reduce()
199 node->ReplaceInput(0, msub.left().node()); in Reduce()
200 node->ReplaceInput(1, msub.right().node()); in Reduce()
201 return Changed(node); in Reduce()
208 return ReduceInt32Add(node); in Reduce()
210 return ReduceInt64Add(node); in Reduce()
212 return ReduceInt32Sub(node); in Reduce()
214 return ReduceInt64Sub(node); in Reduce()
216 Int32BinopMatcher m(node); in Reduce()
217 if (m.right().Is(0)) return Replace(m.right().node()); // x * 0 => 0 in Reduce()
218 if (m.right().Is(1)) return Replace(m.left().node()); // x * 1 => x in Reduce()
223 node->ReplaceInput(0, Int32Constant(0)); in Reduce()
224 node->ReplaceInput(1, m.left().node()); in Reduce()
225 NodeProperties::ChangeOp(node, machine()->Int32Sub()); in Reduce()
226 return Changed(node); in Reduce()
229 node->ReplaceInput(1, Int32Constant(WhichPowerOf2(m.right().Value()))); in Reduce()
230 NodeProperties::ChangeOp(node, machine()->Word32Shl()); in Reduce()
231 Reduction reduction = ReduceWord32Shl(node); in Reduce()
232 return reduction.Changed() ? reduction : Changed(node); in Reduce()
237 Int32BinopMatcher m(node); in Reduce()
239 node->ReplaceInput(1, m.left().node()); in Reduce()
240 NodeProperties::ChangeOp(node, machine()->Int32AddWithOverflow()); in Reduce()
241 return Changed(node); in Reduce()
244 node->ReplaceInput(0, Int32Constant(0)); in Reduce()
245 node->ReplaceInput(1, m.left().node()); in Reduce()
246 NodeProperties::ChangeOp(node, machine()->Int32SubWithOverflow()); in Reduce()
247 return Changed(node); in Reduce()
252 return ReduceInt32Div(node); in Reduce()
254 return ReduceUint32Div(node); in Reduce()
256 return ReduceInt32Mod(node); in Reduce()
258 return ReduceUint32Mod(node); in Reduce()
260 Int32BinopMatcher m(node); in Reduce()
267 Int32BinopMatcher mleftmatcher(m.left().node()); in Reduce()
276 Int32BinopMatcher m(node); in Reduce()
284 Uint32BinopMatcher m(node); in Reduce()
292 Int32BinopMatcher mleft(m.left().node()); in Reduce()
299 node->ReplaceInput(0, mleft.left().node()); in Reduce()
300 node->ReplaceInput(1, Uint32Constant(c << k)); in Reduce()
301 return Changed(node); in Reduce()
309 Uint32BinopMatcher m(node); in Reduce()
319 Float32BinopMatcher m(node); in Reduce()
322 return Replace(m.left().node()); // x - 0 => x in Reduce()
343 mright0.right().node())); in Reduce()
348 node->RemoveInput(0); in Reduce()
349 NodeProperties::ChangeOp(node, machine()->Float32Neg()); in Reduce()
350 return Changed(node); in Reduce()
355 Float64BinopMatcher m(node); in Reduce()
366 Float64BinopMatcher m(node); in Reduce()
369 return Replace(m.left().node()); // x - 0 => x in Reduce()
390 mright0.right().node())); in Reduce()
395 node->RemoveInput(0); in Reduce()
396 NodeProperties::ChangeOp(node, machine()->Float64Neg()); in Reduce()
397 return Changed(node); in Reduce()
402 Float64BinopMatcher m(node); in Reduce()
404 return Replace(m.left().node()); // x * 1.0 => x in Reduce()
406 node->ReplaceInput(0, Float64Constant(-0.0)); in Reduce()
407 node->ReplaceInput(1, m.left().node()); in Reduce()
408 NodeProperties::ChangeOp(node, machine()->Float64Sub()); in Reduce()
409 return Changed(node); in Reduce()
419 node->ReplaceInput(1, m.left().node()); in Reduce()
420 NodeProperties::ChangeOp(node, machine()->Float64Add()); in Reduce()
421 return Changed(node); in Reduce()
426 Float64BinopMatcher m(node); in Reduce()
428 return Replace(m.left().node()); // x / 1.0 => x in Reduce()
442 node->RemoveInput(1); in Reduce()
443 NodeProperties::ChangeOp(node, machine()->Float64Neg()); in Reduce()
444 return Changed(node); in Reduce()
450 node->ReplaceInput(1, Float64Constant(1.0 / m.right().Value())); in Reduce()
451 NodeProperties::ChangeOp(node, machine()->Float64Mul()); in Reduce()
452 return Changed(node); in Reduce()
457 Float64BinopMatcher m(node); in Reduce()
462 return Replace(m.right().node()); in Reduce()
465 return Replace(m.left().node()); in Reduce()
473 Float64Matcher m(node->InputAt(0)); in Reduce()
478 Float64Matcher m(node->InputAt(0)); in Reduce()
483 Float64Matcher m(node->InputAt(0)); in Reduce()
488 Float64Matcher m(node->InputAt(0)); in Reduce()
493 Float64Matcher m(node->InputAt(0)); in Reduce()
498 Float64Matcher m(node->InputAt(0)); in Reduce()
503 Float64BinopMatcher m(node); in Reduce()
505 return Replace(m.right().node()); in Reduce()
508 return Replace(m.left().node()); in Reduce()
517 Float64Matcher m(node->InputAt(0)); in Reduce()
522 Float64Matcher m(node->InputAt(0)); in Reduce()
527 Float64Matcher m(node->InputAt(0)); in Reduce()
532 Float64Matcher m(node->InputAt(0)); in Reduce()
537 Float64Matcher m(node->InputAt(0)); in Reduce()
542 Float64Matcher m(node->InputAt(0)); in Reduce()
547 Float64Matcher m(node->InputAt(0)); in Reduce()
552 Float64Matcher m(node->InputAt(0)); in Reduce()
557 Float64Matcher m(node->InputAt(0)); in Reduce()
562 Float64BinopMatcher m(node); in Reduce()
568 node->ReplaceInput(0, Float64Constant(1.0)); in Reduce()
569 node->ReplaceInput(1, Float64Mul(m.left().node(), m.left().node())); in Reduce()
570 NodeProperties::ChangeOp(node, machine()->Float64Div()); in Reduce()
571 return Changed(node); in Reduce()
573 node->ReplaceInput(1, m.left().node()); in Reduce()
574 NodeProperties::ChangeOp(node, machine()->Float64Mul()); in Reduce()
575 return Changed(node); in Reduce()
578 node->ReplaceInput(0, Float64Constant(1.0)); in Reduce()
579 node->ReplaceInput(1, Float64PowHalf(m.left().node())); in Reduce()
580 NodeProperties::ChangeOp(node, machine()->Float64Div()); in Reduce()
581 return Changed(node); in Reduce()
584 return Replace(Float64PowHalf(m.left().node())); in Reduce()
589 Float64Matcher m(node->InputAt(0)); in Reduce()
594 Float64Matcher m(node->InputAt(0)); in Reduce()
599 Float64Matcher m(node->InputAt(0)); in Reduce()
604 Float64Matcher m(node->InputAt(0)); in Reduce()
609 Float32Matcher m(node->InputAt(0)); in Reduce()
620 Float64Matcher m(node->InputAt(0)); in Reduce()
622 if (m.IsChangeInt32ToFloat64()) return Replace(m.node()->InputAt(0)); in Reduce()
626 Float64Matcher m(node->InputAt(0)); in Reduce()
628 if (m.IsChangeUint32ToFloat64()) return Replace(m.node()->InputAt(0)); in Reduce()
632 Int32Matcher m(node->InputAt(0)); in Reduce()
637 Int32Matcher m(node->InputAt(0)); in Reduce()
642 Uint32Matcher m(node->InputAt(0)); in Reduce()
647 Uint32Matcher m(node->InputAt(0)); in Reduce()
652 Float64Matcher m(node->InputAt(0)); in Reduce()
654 if (m.IsChangeInt32ToFloat64()) return Replace(m.node()->InputAt(0)); in Reduce()
658 Int64Matcher m(node->InputAt(0)); in Reduce()
660 if (m.IsChangeInt32ToInt64()) return Replace(m.node()->InputAt(0)); in Reduce()
664 Float64Matcher m(node->InputAt(0)); in Reduce()
673 return Replace(m.node()->InputAt(0)); in Reduce()
677 Float64Matcher m(node->InputAt(0)); in Reduce()
679 if (m.IsChangeInt32ToFloat64()) return Replace(m.node()->InputAt(0)); in Reduce()
683 return ReduceFloat64InsertLowWord32(node); in Reduce()
685 return ReduceFloat64InsertHighWord32(node); in Reduce()
689 return ReduceStore(node); in Reduce()
693 return ReduceFloat64Compare(node); in Reduce()
695 return ReduceFloat64RoundDown(node); in Reduce()
702 Reduction MachineOperatorReducer::ReduceInt32Add(Node* node) { in ReduceInt32Add() argument
703 DCHECK_EQ(IrOpcode::kInt32Add, node->opcode()); in ReduceInt32Add()
704 Int32BinopMatcher m(node); in ReduceInt32Add()
705 if (m.right().Is(0)) return Replace(m.left().node()); // x + 0 => x in ReduceInt32Add()
711 Int32BinopMatcher mleft(m.left().node()); in ReduceInt32Add()
713 node->ReplaceInput(0, m.right().node()); in ReduceInt32Add()
714 node->ReplaceInput(1, mleft.right().node()); in ReduceInt32Add()
715 NodeProperties::ChangeOp(node, machine()->Int32Sub()); in ReduceInt32Add()
716 Reduction const reduction = ReduceInt32Sub(node); in ReduceInt32Add()
717 return reduction.Changed() ? reduction : Changed(node); in ReduceInt32Add()
721 Int32BinopMatcher mright(m.right().node()); in ReduceInt32Add()
723 node->ReplaceInput(1, mright.right().node()); in ReduceInt32Add()
724 NodeProperties::ChangeOp(node, machine()->Int32Sub()); in ReduceInt32Add()
725 Reduction const reduction = ReduceInt32Sub(node); in ReduceInt32Add()
726 return reduction.Changed() ? reduction : Changed(node); in ReduceInt32Add()
732 Reduction MachineOperatorReducer::ReduceInt64Add(Node* node) { in ReduceInt64Add() argument
733 DCHECK_EQ(IrOpcode::kInt64Add, node->opcode()); in ReduceInt64Add()
734 Int64BinopMatcher m(node); in ReduceInt64Add()
735 if (m.right().Is(0)) return Replace(m.left().node()); // x + 0 => 0 in ReduceInt64Add()
743 Reduction MachineOperatorReducer::ReduceInt32Sub(Node* node) { in ReduceInt32Sub() argument
744 DCHECK_EQ(IrOpcode::kInt32Sub, node->opcode()); in ReduceInt32Sub()
745 Int32BinopMatcher m(node); in ReduceInt32Sub()
746 if (m.right().Is(0)) return Replace(m.left().node()); // x - 0 => x in ReduceInt32Sub()
753 node->ReplaceInput(1, Int32Constant(-m.right().Value())); in ReduceInt32Sub()
754 NodeProperties::ChangeOp(node, machine()->Int32Add()); in ReduceInt32Sub()
755 Reduction const reduction = ReduceInt32Add(node); in ReduceInt32Sub()
756 return reduction.Changed() ? reduction : Changed(node); in ReduceInt32Sub()
761 Reduction MachineOperatorReducer::ReduceInt64Sub(Node* node) { in ReduceInt64Sub() argument
762 DCHECK_EQ(IrOpcode::kInt64Sub, node->opcode()); in ReduceInt64Sub()
763 Int64BinopMatcher m(node); in ReduceInt64Sub()
764 if (m.right().Is(0)) return Replace(m.left().node()); // x - 0 => x in ReduceInt64Sub()
771 node->ReplaceInput(1, Int64Constant(-m.right().Value())); in ReduceInt64Sub()
772 NodeProperties::ChangeOp(node, machine()->Int64Add()); in ReduceInt64Sub()
773 Reduction const reduction = ReduceInt64Add(node); in ReduceInt64Sub()
774 return reduction.Changed() ? reduction : Changed(node); in ReduceInt64Sub()
779 Reduction MachineOperatorReducer::ReduceInt32Div(Node* node) { in ReduceInt32Div() argument
780 Int32BinopMatcher m(node); in ReduceInt32Div()
781 if (m.left().Is(0)) return Replace(m.left().node()); // 0 / x => 0 in ReduceInt32Div()
782 if (m.right().Is(0)) return Replace(m.right().node()); // x / 0 => 0 in ReduceInt32Div()
783 if (m.right().Is(1)) return Replace(m.left().node()); // x / 1 => x in ReduceInt32Div()
790 return Replace(Word32Equal(Word32Equal(m.left().node(), zero), zero)); in ReduceInt32Div()
793 node->ReplaceInput(0, Int32Constant(0)); in ReduceInt32Div()
794 node->ReplaceInput(1, m.left().node()); in ReduceInt32Div()
795 node->TrimInputCount(2); in ReduceInt32Div()
796 NodeProperties::ChangeOp(node, machine()->Int32Sub()); in ReduceInt32Div()
797 return Changed(node); in ReduceInt32Div()
801 Node* const dividend = m.left().node(); in ReduceInt32Div()
815 node->ReplaceInput(0, Int32Constant(0)); in ReduceInt32Div()
816 node->ReplaceInput(1, quotient); in ReduceInt32Div()
817 node->TrimInputCount(2); in ReduceInt32Div()
818 NodeProperties::ChangeOp(node, machine()->Int32Sub()); in ReduceInt32Div()
819 return Changed(node); in ReduceInt32Div()
827 Reduction MachineOperatorReducer::ReduceUint32Div(Node* node) { in ReduceUint32Div() argument
828 Uint32BinopMatcher m(node); in ReduceUint32Div()
829 if (m.left().Is(0)) return Replace(m.left().node()); // 0 / x => 0 in ReduceUint32Div()
830 if (m.right().Is(0)) return Replace(m.right().node()); // x / 0 => 0 in ReduceUint32Div()
831 if (m.right().Is(1)) return Replace(m.left().node()); // x / 1 => x in ReduceUint32Div()
838 return Replace(Word32Equal(Word32Equal(m.left().node(), zero), zero)); in ReduceUint32Div()
841 Node* const dividend = m.left().node(); in ReduceUint32Div()
844 node->ReplaceInput(1, Uint32Constant(WhichPowerOf2(m.right().Value()))); in ReduceUint32Div()
845 node->TrimInputCount(2); in ReduceUint32Div()
846 NodeProperties::ChangeOp(node, machine()->Word32Shr()); in ReduceUint32Div()
847 return Changed(node); in ReduceUint32Div()
856 Reduction MachineOperatorReducer::ReduceInt32Mod(Node* node) { in ReduceInt32Mod() argument
857 Int32BinopMatcher m(node); in ReduceInt32Mod()
858 if (m.left().Is(0)) return Replace(m.left().node()); // 0 % x => 0 in ReduceInt32Mod()
859 if (m.right().Is(0)) return Replace(m.right().node()); // x % 0 => 0 in ReduceInt32Mod()
868 Node* const dividend = m.left().node(); in ReduceInt32Mod()
882 DCHECK_EQ(dividend, node->InputAt(0)); in ReduceInt32Mod()
883 node->ReplaceInput(1, Int32Mul(quotient, Int32Constant(divisor))); in ReduceInt32Mod()
884 node->TrimInputCount(2); in ReduceInt32Mod()
885 NodeProperties::ChangeOp(node, machine()->Int32Sub()); in ReduceInt32Mod()
887 return Changed(node); in ReduceInt32Mod()
893 Reduction MachineOperatorReducer::ReduceUint32Mod(Node* node) { in ReduceUint32Mod() argument
894 Uint32BinopMatcher m(node); in ReduceUint32Mod()
895 if (m.left().Is(0)) return Replace(m.left().node()); // 0 % x => 0 in ReduceUint32Mod()
896 if (m.right().Is(0)) return Replace(m.right().node()); // x % 0 => 0 in ReduceUint32Mod()
904 Node* const dividend = m.left().node(); in ReduceUint32Mod()
907 node->ReplaceInput(1, Uint32Constant(m.right().Value() - 1)); in ReduceUint32Mod()
908 node->TrimInputCount(2); in ReduceUint32Mod()
909 NodeProperties::ChangeOp(node, machine()->Word32And()); in ReduceUint32Mod()
912 DCHECK_EQ(dividend, node->InputAt(0)); in ReduceUint32Mod()
913 node->ReplaceInput(1, Int32Mul(quotient, Uint32Constant(divisor))); in ReduceUint32Mod()
914 node->TrimInputCount(2); in ReduceUint32Mod()
915 NodeProperties::ChangeOp(node, machine()->Int32Sub()); in ReduceUint32Mod()
917 return Changed(node); in ReduceUint32Mod()
923 Reduction MachineOperatorReducer::ReduceStore(Node* node) { in ReduceStore() argument
924 NodeMatcher nm(node); in ReduceStore()
928 rep = CheckedStoreRepresentationOf(node->op()); in ReduceStore()
931 rep = StoreRepresentationOf(node->op()).representation(); in ReduceStore()
935 rep = UnalignedStoreRepresentationOf(node->op()); in ReduceStore()
939 Node* const value = node->InputAt(value_input); in ReduceStore()
948 node->ReplaceInput(value_input, m.left().node()); in ReduceStore()
949 return Changed(node); in ReduceStore()
959 Int32BinopMatcher mleft(m.left().node()); in ReduceStore()
961 node->ReplaceInput(value_input, mleft.left().node()); in ReduceStore()
962 return Changed(node); in ReduceStore()
974 Reduction MachineOperatorReducer::ReduceProjection(size_t index, Node* node) { in ReduceProjection() argument
975 switch (node->opcode()) { in ReduceProjection()
978 Int32BinopMatcher m(node); in ReduceProjection()
986 return Replace(index == 0 ? m.left().node() : m.right().node()); in ReduceProjection()
992 Int32BinopMatcher m(node); in ReduceProjection()
1000 return Replace(index == 0 ? m.left().node() : m.right().node()); in ReduceProjection()
1006 Int32BinopMatcher m(node); in ReduceProjection()
1014 return Replace(m.right().node()); in ReduceProjection()
1017 return index == 0 ? Replace(m.left().node()) : ReplaceInt32(0); in ReduceProjection()
1028 Reduction MachineOperatorReducer::ReduceWord32Shifts(Node* node) { in ReduceWord32Shifts() argument
1029 DCHECK((node->opcode() == IrOpcode::kWord32Shl) || in ReduceWord32Shifts()
1030 (node->opcode() == IrOpcode::kWord32Shr) || in ReduceWord32Shifts()
1031 (node->opcode() == IrOpcode::kWord32Sar)); in ReduceWord32Shifts()
1035 Int32BinopMatcher m(node); in ReduceWord32Shifts()
1037 Int32BinopMatcher mright(m.right().node()); in ReduceWord32Shifts()
1039 node->ReplaceInput(1, mright.left().node()); in ReduceWord32Shifts()
1040 return Changed(node); in ReduceWord32Shifts()
1048 Reduction MachineOperatorReducer::ReduceWord32Shl(Node* node) { in ReduceWord32Shl() argument
1049 DCHECK_EQ(IrOpcode::kWord32Shl, node->opcode()); in ReduceWord32Shl()
1050 Int32BinopMatcher m(node); in ReduceWord32Shl()
1051 if (m.right().Is(0)) return Replace(m.left().node()); // x << 0 => x in ReduceWord32Shl()
1059 Int32BinopMatcher mleft(m.left().node()); in ReduceWord32Shl()
1061 node->ReplaceInput(0, mleft.left().node()); in ReduceWord32Shl()
1062 node->ReplaceInput(1, in ReduceWord32Shl()
1064 NodeProperties::ChangeOp(node, machine()->Word32And()); in ReduceWord32Shl()
1065 Reduction reduction = ReduceWord32And(node); in ReduceWord32Shl()
1066 return reduction.Changed() ? reduction : Changed(node); in ReduceWord32Shl()
1070 return ReduceWord32Shifts(node); in ReduceWord32Shl()
1073 Reduction MachineOperatorReducer::ReduceWord64Shl(Node* node) { in ReduceWord64Shl() argument
1074 DCHECK_EQ(IrOpcode::kWord64Shl, node->opcode()); in ReduceWord64Shl()
1075 Int64BinopMatcher m(node); in ReduceWord64Shl()
1076 if (m.right().Is(0)) return Replace(m.left().node()); // x << 0 => x in ReduceWord64Shl()
1083 Reduction MachineOperatorReducer::ReduceWord32Shr(Node* node) { in ReduceWord32Shr() argument
1084 Uint32BinopMatcher m(node); in ReduceWord32Shr()
1085 if (m.right().Is(0)) return Replace(m.left().node()); // x >>> 0 => x in ReduceWord32Shr()
1090 Uint32BinopMatcher mleft(m.left().node()); in ReduceWord32Shr()
1100 return ReduceWord32Shifts(node); in ReduceWord32Shr()
1103 Reduction MachineOperatorReducer::ReduceWord64Shr(Node* node) { in ReduceWord64Shr() argument
1104 DCHECK_EQ(IrOpcode::kWord64Shr, node->opcode()); in ReduceWord64Shr()
1105 Uint64BinopMatcher m(node); in ReduceWord64Shr()
1106 if (m.right().Is(0)) return Replace(m.left().node()); // x >>> 0 => x in ReduceWord64Shr()
1113 Reduction MachineOperatorReducer::ReduceWord32Sar(Node* node) { in ReduceWord32Sar() argument
1114 Int32BinopMatcher m(node); in ReduceWord32Sar()
1115 if (m.right().Is(0)) return Replace(m.left().node()); // x >> 0 => x in ReduceWord32Sar()
1120 Int32BinopMatcher mleft(m.left().node()); in ReduceWord32Sar()
1124 node->ReplaceInput(0, Int32Constant(0)); in ReduceWord32Sar()
1125 node->ReplaceInput(1, mleft.left().node()); in ReduceWord32Sar()
1126 NodeProperties::ChangeOp(node, machine()->Int32Sub()); in ReduceWord32Sar()
1127 Reduction const reduction = ReduceInt32Sub(node); in ReduceWord32Sar()
1128 return reduction.Changed() ? reduction : Changed(node); in ReduceWord32Sar()
1132 LoadRepresentationOf(mleft.left().node()->op()); in ReduceWord32Sar()
1136 return Replace(mleft.left().node()); in ReduceWord32Sar()
1141 return Replace(mleft.left().node()); in ReduceWord32Sar()
1145 return ReduceWord32Shifts(node); in ReduceWord32Sar()
1148 Reduction MachineOperatorReducer::ReduceWord64Sar(Node* node) { in ReduceWord64Sar() argument
1149 Int64BinopMatcher m(node); in ReduceWord64Sar()
1150 if (m.right().Is(0)) return Replace(m.left().node()); // x >> 0 => x in ReduceWord64Sar()
1157 Reduction MachineOperatorReducer::ReduceWord32And(Node* node) { in ReduceWord32And() argument
1158 DCHECK_EQ(IrOpcode::kWord32And, node->opcode()); in ReduceWord32And()
1159 Int32BinopMatcher m(node); in ReduceWord32And()
1160 if (m.right().Is(0)) return Replace(m.right().node()); // x & 0 => 0 in ReduceWord32And()
1161 if (m.right().Is(-1)) return Replace(m.left().node()); // x & -1 => x in ReduceWord32And()
1163 return Replace(m.left().node()); in ReduceWord32And()
1168 if (m.LeftEqualsRight()) return Replace(m.left().node()); // x & x => x in ReduceWord32And()
1170 Int32BinopMatcher mleft(m.left().node()); in ReduceWord32And()
1172 node->ReplaceInput(0, mleft.left().node()); in ReduceWord32And()
1173 node->ReplaceInput( in ReduceWord32And()
1175 Reduction const reduction = ReduceWord32And(node); in ReduceWord32And()
1176 return reduction.Changed() ? reduction : Changed(node); in ReduceWord32And()
1182 Uint32BinopMatcher mleft(m.left().node()); in ReduceWord32And()
1187 return Replace(mleft.node()); in ReduceWord32And()
1190 Int32BinopMatcher mleft(m.left().node()); in ReduceWord32And()
1194 node->ReplaceInput(0, Word32And(mleft.left().node(), m.right().node())); in ReduceWord32And()
1195 node->ReplaceInput(1, mleft.right().node()); in ReduceWord32And()
1196 NodeProperties::ChangeOp(node, machine()->Int32Add()); in ReduceWord32And()
1197 Reduction const reduction = ReduceInt32Add(node); in ReduceWord32And()
1198 return reduction.Changed() ? reduction : Changed(node); in ReduceWord32And()
1201 Int32BinopMatcher mleftleft(mleft.left().node()); in ReduceWord32And()
1204 node->ReplaceInput(0, in ReduceWord32And()
1205 Word32And(mleft.right().node(), m.right().node())); in ReduceWord32And()
1206 node->ReplaceInput(1, mleftleft.node()); in ReduceWord32And()
1207 NodeProperties::ChangeOp(node, machine()->Int32Add()); in ReduceWord32And()
1208 Reduction const reduction = ReduceInt32Add(node); in ReduceWord32And()
1209 return reduction.Changed() ? reduction : Changed(node); in ReduceWord32And()
1213 Int32BinopMatcher mleftright(mleft.right().node()); in ReduceWord32And()
1216 node->ReplaceInput(0, in ReduceWord32And()
1217 Word32And(mleft.left().node(), m.right().node())); in ReduceWord32And()
1218 node->ReplaceInput(1, mleftright.node()); in ReduceWord32And()
1219 NodeProperties::ChangeOp(node, machine()->Int32Add()); in ReduceWord32And()
1220 Reduction const reduction = ReduceInt32Add(node); in ReduceWord32And()
1221 return reduction.Changed() ? reduction : Changed(node); in ReduceWord32And()
1225 Int32BinopMatcher mleftleft(mleft.left().node()); in ReduceWord32And()
1228 node->ReplaceInput(0, in ReduceWord32And()
1229 Word32And(mleft.right().node(), m.right().node())); in ReduceWord32And()
1230 node->ReplaceInput(1, mleftleft.node()); in ReduceWord32And()
1231 NodeProperties::ChangeOp(node, machine()->Int32Add()); in ReduceWord32And()
1232 Reduction const reduction = ReduceInt32Add(node); in ReduceWord32And()
1233 return reduction.Changed() ? reduction : Changed(node); in ReduceWord32And()
1237 Int32BinopMatcher mleftright(mleft.right().node()); in ReduceWord32And()
1240 node->ReplaceInput(0, in ReduceWord32And()
1241 Word32And(mleft.left().node(), m.right().node())); in ReduceWord32And()
1242 node->ReplaceInput(1, mleftright.node()); in ReduceWord32And()
1243 NodeProperties::ChangeOp(node, machine()->Int32Add()); in ReduceWord32And()
1244 Reduction const reduction = ReduceInt32Add(node); in ReduceWord32And()
1245 return reduction.Changed() ? reduction : Changed(node); in ReduceWord32And()
1249 Int32BinopMatcher mleft(m.left().node()); in ReduceWord32And()
1252 return Replace(mleft.node()); in ReduceWord32And()
1259 Reduction MachineOperatorReducer::TryMatchWord32Ror(Node* node) { in TryMatchWord32Ror() argument
1260 DCHECK(IrOpcode::kWord32Or == node->opcode() || in TryMatchWord32Ror()
1261 IrOpcode::kWord32Xor == node->opcode()); in TryMatchWord32Ror()
1262 Int32BinopMatcher m(node); in TryMatchWord32Ror()
1272 shl = m.left().node(); in TryMatchWord32Ror()
1273 shr = m.right().node(); in TryMatchWord32Ror()
1275 shl = m.right().node(); in TryMatchWord32Ror()
1276 shr = m.left().node(); in TryMatchWord32Ror()
1283 if (mshl.left().node() != mshr.left().node()) return NoChange(); in TryMatchWord32Ror()
1292 sub = mshl.right().node(); in TryMatchWord32Ror()
1293 y = mshr.right().node(); in TryMatchWord32Ror()
1295 sub = mshr.right().node(); in TryMatchWord32Ror()
1296 y = mshl.right().node(); in TryMatchWord32Ror()
1302 if (!msub.left().Is(32) || msub.right().node() != y) return NoChange(); in TryMatchWord32Ror()
1305 node->ReplaceInput(0, mshl.left().node()); in TryMatchWord32Ror()
1306 node->ReplaceInput(1, mshr.right().node()); in TryMatchWord32Ror()
1307 NodeProperties::ChangeOp(node, machine()->Word32Ror()); in TryMatchWord32Ror()
1308 return Changed(node); in TryMatchWord32Ror()
1311 Reduction MachineOperatorReducer::ReduceWord32Or(Node* node) { in ReduceWord32Or() argument
1312 DCHECK_EQ(IrOpcode::kWord32Or, node->opcode()); in ReduceWord32Or()
1313 Int32BinopMatcher m(node); in ReduceWord32Or()
1314 if (m.right().Is(0)) return Replace(m.left().node()); // x | 0 => x in ReduceWord32Or()
1315 if (m.right().Is(-1)) return Replace(m.right().node()); // x | -1 => -1 in ReduceWord32Or()
1319 if (m.LeftEqualsRight()) return Replace(m.left().node()); // x | x => x in ReduceWord32Or()
1321 return TryMatchWord32Ror(node); in ReduceWord32Or()
1324 Reduction MachineOperatorReducer::ReduceWord32Xor(Node* node) { in ReduceWord32Xor() argument
1325 DCHECK_EQ(IrOpcode::kWord32Xor, node->opcode()); in ReduceWord32Xor()
1326 Int32BinopMatcher m(node); in ReduceWord32Xor()
1327 if (m.right().Is(0)) return Replace(m.left().node()); // x ^ 0 => x in ReduceWord32Xor()
1333 Int32BinopMatcher mleft(m.left().node()); in ReduceWord32Xor()
1335 return Replace(mleft.left().node()); in ReduceWord32Xor()
1339 return TryMatchWord32Ror(node); in ReduceWord32Xor()
1342 Reduction MachineOperatorReducer::ReduceFloat64InsertLowWord32(Node* node) { in ReduceFloat64InsertLowWord32() argument
1343 DCHECK_EQ(IrOpcode::kFloat64InsertLowWord32, node->opcode()); in ReduceFloat64InsertLowWord32()
1344 Float64Matcher mlhs(node->InputAt(0)); in ReduceFloat64InsertLowWord32()
1345 Uint32Matcher mrhs(node->InputAt(1)); in ReduceFloat64InsertLowWord32()
1355 Reduction MachineOperatorReducer::ReduceFloat64InsertHighWord32(Node* node) { in ReduceFloat64InsertHighWord32() argument
1356 DCHECK_EQ(IrOpcode::kFloat64InsertHighWord32, node->opcode()); in ReduceFloat64InsertHighWord32()
1357 Float64Matcher mlhs(node->InputAt(0)); in ReduceFloat64InsertHighWord32()
1358 Uint32Matcher mrhs(node->InputAt(1)); in ReduceFloat64InsertHighWord32()
1382 Reduction MachineOperatorReducer::ReduceFloat64Compare(Node* node) { in ReduceFloat64Compare() argument
1383 DCHECK((IrOpcode::kFloat64Equal == node->opcode()) || in ReduceFloat64Compare()
1384 (IrOpcode::kFloat64LessThan == node->opcode()) || in ReduceFloat64Compare()
1385 (IrOpcode::kFloat64LessThanOrEqual == node->opcode())); in ReduceFloat64Compare()
1391 Float64BinopMatcher m(node); in ReduceFloat64Compare()
1398 switch (node->opcode()) { in ReduceFloat64Compare()
1400 NodeProperties::ChangeOp(node, machine()->Float32Equal()); in ReduceFloat64Compare()
1403 NodeProperties::ChangeOp(node, machine()->Float32LessThan()); in ReduceFloat64Compare()
1406 NodeProperties::ChangeOp(node, machine()->Float32LessThanOrEqual()); in ReduceFloat64Compare()
1411 node->ReplaceInput( in ReduceFloat64Compare()
1415 node->ReplaceInput( in ReduceFloat64Compare()
1419 return Changed(node); in ReduceFloat64Compare()
1424 Reduction MachineOperatorReducer::ReduceFloat64RoundDown(Node* node) { in ReduceFloat64RoundDown() argument
1425 DCHECK_EQ(IrOpcode::kFloat64RoundDown, node->opcode()); in ReduceFloat64RoundDown()
1426 Float64Matcher m(node->InputAt(0)); in ReduceFloat64RoundDown()