Lines Matching defs:gate
20 bool InductionVariableAnalysis::IsIntConstant(GateRef gate) const
22 if (acc_.GetOpCode(gate) != OpCode::CONSTANT) {
25 JSTaggedValue value(acc_.GetConstantValue(gate));
29 bool InductionVariableAnalysis::IsInductionVariable(GateRef gate) const
31 if (acc_.GetOpCode(gate) != OpCode::VALUE_SELECTOR) {
34 size_t numValueIn = acc_.GetNumValueIn(gate);
35 GateRef startGate = acc_.GetValueIn(gate, 0);
36 GateRef valueGate = acc_.GetValueIn(gate, 1);
54 if (acc_.GetValueIn(gate, i) != valueGate) {
60 if (acc_.GetValueIn(valueGate, 0) != gate && acc_.GetValueIn(valueGate, 1) != gate) {
64 if (acc_.GetValueIn(valueGate, 0) != gate) {
73 std::pair<int32_t, int32_t> InductionVariableAnalysis::GetStartAndStride(GateRef gate) const
75 ASSERT(acc_.GetOpCode(gate) == OpCode::VALUE_SELECTOR);
76 GateRef startGate = acc_.GetValueIn(gate, 0);
80 GateRef valueGate = acc_.GetValueIn(gate, 1);
89 if (acc_.GetValueIn(valueGate, 0) != gate) {
103 int32_t InductionVariableAnalysis::GetIntFromTaggedConstant(GateRef gate) const
105 ASSERT(acc_.GetOpCode(gate) == OpCode::CONSTANT);
106 JSTaggedValue value(acc_.GetConstantValue(gate));
110 bool InductionVariableAnalysis::IsLessOrGreaterCmp(GateRef gate) const
112 return acc_.GetTypedBinaryOp(gate) == TypedBinOp::TYPED_GREATEREQ ||
113 acc_.GetTypedBinaryOp(gate) == TypedBinOp::TYPED_GREATER ||
114 acc_.GetTypedBinaryOp(gate) == TypedBinOp::TYPED_LESSEQ ||
115 acc_.GetTypedBinaryOp(gate) == TypedBinOp::TYPED_LESS;
210 void InductionVariableAnalysis::TryReplaceOutOfLoopUses(GateRef gate,
214 ASSERT(IsInductionVariable(gate));
215 auto uses = acc_.Uses(gate);