• Home
  • Raw
  • Download

Lines Matching refs:idx

22     for (size_t idx = 0; idx < numIns; idx++) {  in CheckNullInput()  local
23 if (IsInGateNull(idx)) { in CheckNullInput()
24 CheckFailed("In list contains null", idx); in CheckNullInput()
36 void Gate::CheckInputOpcode(size_t idx, OpCode expected) const in CheckInputOpcode() argument
38 OpCode actual = GetInGateConst(idx)->GetOpCode(); in CheckInputOpcode()
41 + " actual:" + GateMetaData::Str(actual) + ")", idx); in CheckInputOpcode()
45 void Gate::CheckInputMachineType(size_t idx, MachineType expected, bool isArch64) const in CheckInputMachineType() argument
47 MachineType actual = GetInGateConst(idx)->GetMachineType(); in CheckInputMachineType()
59 + MachineTypeToStr(expected) + " actual:" + MachineTypeToStr(actual) + ")", idx); in CheckInputMachineType()
63 void Gate::CheckGeneralState(size_t idx) const in CheckGeneralState()
65 auto gatePtr = GetInGateConst(idx); in CheckGeneralState()
69 + GateMetaData::Str(actual) + ")", idx); in CheckGeneralState()
77 for (size_t idx = stateStart; idx < stateEnd; idx++) { in CheckStateInput() local
82 ASSERT(idx == stateStart); in CheckStateInput()
83 CheckInputOpcode(idx, OpCode::IF_BRANCH); in CheckStateInput()
88 ASSERT(idx == stateStart); in CheckStateInput()
89 CheckInputOpcode(idx, OpCode::SWITCH_BRANCH); in CheckStateInput()
93 if (idx == stateStart + 1) { // 1: idx 1 in CheckStateInput()
94 CheckInputOpcode(idx, OpCode::LOOP_BACK); in CheckStateInput()
102 CheckGeneralState(idx); in CheckStateInput()
111 for (size_t idx = valueStart; idx < valueEnd; idx++) { in CheckValueInput() local
114 ASSERT(idx == valueStart); in CheckValueInput()
115 CheckInputMachineType(idx, MachineType::I1, isArch64); in CheckValueInput()
134 CheckInputMachineType(idx, MachineType::FLEX, isArch64); in CheckValueInput()
137 ASSERT(idx == valueStart); in CheckValueInput()
138 CheckInputMachineType(idx, MachineType::I1, isArch64); in CheckValueInput()
141 ASSERT(idx == valueStart); in CheckValueInput()
142 CheckInputMachineType(idx, MachineType::ARCH, isArch64); in CheckValueInput()
145 if (idx == valueStart + 1) { // 1: idx 1 in CheckValueInput()
146 CheckInputMachineType(idx, MachineType::ARCH, isArch64); in CheckValueInput()
152 ASSERT(idx == valueStart); in CheckValueInput()
158 if (idx == valueStart + 1) { // 1: idx 1 in CheckValueInput()
159 CheckInputMachineType(idx, MachineType::I64, isArch64); in CheckValueInput()
172 for (size_t idx = dependStart; idx < dependEnd; idx++) { in CheckDependInput() local
173 if (GetInGateConst(idx)->GetDependCount() == 0 && in CheckDependInput()
174 GetInGateConst(idx)->GetOpCode() != OpCode::DEPEND_ENTRY) { in CheckDependInput()
175 CheckFailed("Depend input is side-effect free", idx); in CheckDependInput()
378 void Out::SetIndex(OutIdx idx) in SetIndex() argument
380 idx_ = idx; in SetIndex()
464 for (size_t idx = 0; idx < numIns; idx++) { in Gate() local
466 auto in = inList[idx]; in Gate()
468 GetIn(idx)->SetGateNull(); in Gate()
470 NewIn(idx, in); in Gate()
472 auto curOut = GetOut(idx); in Gate()
473 curOut->SetIndex(idx); in Gate()
477 void Gate::NewIn(size_t idx, Gate *in) in NewIn() argument
479 GetIn(idx)->SetGate(in); in NewIn()
480 auto curOut = GetOut(idx); in NewIn()
491 void Gate::ModifyIn(size_t idx, Gate *in) in ModifyIn() argument
493 DeleteIn(idx); in ModifyIn()
494 NewIn(idx, in); in ModifyIn()
497 void Gate::DeleteIn(size_t idx) in DeleteIn() argument
499 if (!GetOut(idx)->IsNextOutNull() && !GetOut(idx)->IsPrevOutNull()) { in DeleteIn()
500 GetOut(idx)->GetPrevOut()->SetNextOut(GetOut(idx)->GetNextOut()); in DeleteIn()
501 GetOut(idx)->GetNextOut()->SetPrevOut(GetOut(idx)->GetPrevOut()); in DeleteIn()
502 } else if (GetOut(idx)->IsNextOutNull() && !GetOut(idx)->IsPrevOutNull()) { in DeleteIn()
503 GetOut(idx)->GetPrevOut()->SetNextOutNull(); in DeleteIn()
504 } else if (!GetOut(idx)->IsNextOutNull()) { // then GetOut(idx)->IsPrevOutNull() is true in DeleteIn()
505 GetIn(idx)->GetGate()->SetFirstOut(GetOut(idx)->GetNextOut()); in DeleteIn()
506 GetOut(idx)->GetNextOut()->SetPrevOutNull(); in DeleteIn()
508 GetIn(idx)->GetGate()->SetFirstOutNull(); in DeleteIn()
510 GetIn(idx)->SetGateNull(); in DeleteIn()
516 for (size_t idx = 0; idx < numIns; idx++) { in DeleteGate() local
517 DeleteIn(idx); in DeleteGate()
521 Out *Gate::GetOut(size_t idx) in GetOut() argument
524 return &reinterpret_cast<Out *>(this)[-1 - idx]; in GetOut()
527 const Out *Gate::GetOutConst(size_t idx) const in GetOutConst()
530 return &reinterpret_cast<const Out *>(this)[-1 - idx]; in GetOutConst()
562 In *Gate::GetIn(size_t idx) in GetIn() argument
565 if (idx >= GetNumIns()) { in GetIn()
566 LOG_COMPILER(INFO) << std::dec << "Gate In access out-of-bound! (idx=" << idx << ")"; in GetIn()
572 return &reinterpret_cast<In *>(this + 1)[idx]; in GetIn()
575 const In *Gate::GetInConst(size_t idx) const in GetInConst()
578 if (idx >= GetNumIns()) { in GetInConst()
579 LOG_COMPILER(INFO) << std::dec << "Gate In access out-of-bound! (idx=" << idx << ")"; in GetInConst()
585 return &reinterpret_cast<const In *>(this + 1)[idx]; in GetInConst()
588 Gate *Gate::GetInGate(size_t idx) in GetInGate() argument
590 return GetIn(idx)->GetGate(); in GetInGate()
593 const Gate *Gate::GetInGateConst(size_t idx) const in GetInGateConst()
595 return GetInConst(idx)->GetGateConst(); in GetInGateConst()
598 bool Gate::IsInGateNull(size_t idx) const in IsInGateNull()
600 return GetInConst(idx)->IsGateNull(); in IsInGateNull()
710 size_t idx = 0; in Print() local
718 idx = PrintInGate(end, idx, start, inListPreview, highlightIdx, log); in Print()
721 idx = PrintInGate(end, idx, start, inListPreview, highlightIdx, log); in Print()
724 idx = PrintInGate(end, idx, start, inListPreview, highlightIdx, log); in Print()
727 idx = PrintInGate(end, idx, start, inListPreview, highlightIdx, log); in Print()
730 idx = PrintInGate(end, idx, start, inListPreview, highlightIdx, log, true); in Print()
764 size_t idx = 0; in ShortPrint() local
772 idx = PrintInGate(end, idx, start, inListPreview, highlightIdx, log); in ShortPrint()
775 idx = PrintInGate(end, idx, start, inListPreview, highlightIdx, log); in ShortPrint()
778 idx = PrintInGate(end, idx, start, inListPreview, highlightIdx, log); in ShortPrint()
781 idx = PrintInGate(end, idx, start, inListPreview, highlightIdx, log); in ShortPrint()
784 idx = PrintInGate(end, idx, start, inListPreview, highlightIdx, log, true); in ShortPrint()
806 size_t Gate::PrintInGate(size_t numIns, size_t idx, size_t size, bool inListPreview, size_t highlig… in PrintInGate() argument
810 for (; idx < numIns; idx++) { in PrintInGate()
811 log += ((idx == size) ? "" : ", "); in PrintInGate()
812 log += ((idx == highlightIdx) ? "\033[4;31m" : ""); in PrintInGate()
813 log += ((IsInGateNull(idx) in PrintInGate()
815 : (std::to_string(GetInGateConst(idx)->GetId()) + in PrintInGate()
816 … (inListPreview ? std::string(":" + GateMetaData::Str(GetInGateConst(idx)->GetOpCode())) in PrintInGate()
818 log += ((idx == highlightIdx) ? "\033[0m" : ""); in PrintInGate()
822 return idx; in PrintInGate()