Lines Matching refs:phi

125       AddError(StringPrintf("Block %d has a non-phi in its phi list.",
129 AddError(StringPrintf("The recorded last phi of block %d does not match "
130 "the actual last phi %d.",
142 AddError(StringPrintf("Block %d has a phi in its non-phi list.",
477 "with catch phi %d for vreg %d but its "
704 void GraphChecker::VisitPhi(HPhi* phi) {
705 VisitInstruction(phi);
707 // Ensure the first input of a phi is not itself.
708 ArrayRef<HUserRecord<HInstruction*>> input_records = phi->GetInputRecords();
709 if (input_records[0].GetInstruction() == phi) {
710 AddError(StringPrintf("Loop phi %d in block %d is its own first input.",
711 phi->GetId(),
712 phi->GetBlock()->GetBlockId()));
715 // Ensure that the inputs have the same primitive kind as the phi.
718 if (Primitive::PrimitiveKind(input->GetType()) != Primitive::PrimitiveKind(phi->GetType())) {
720 "Input %d at index %zu of phi %d from block %d does not have the "
721 "same kind as the phi: %s versus %s",
722 input->GetId(), i, phi->GetId(), phi->GetBlock()->GetBlockId(),
724 Primitive::PrettyDescriptor(phi->GetType())));
727 if (phi->GetType() != HPhi::ToPhiType(phi->GetType())) {
728 AddError(StringPrintf("Phi %d in block %d does not have an expected phi type: %s",
729 phi->GetId(),
730 phi->GetBlock()->GetBlockId(),
731 Primitive::PrettyDescriptor(phi->GetType())));
734 if (phi->IsCatchPhi()) {
735 // The number of inputs of a catch phi should be the total number of throwing
742 phi->GetId(),
743 phi->GetBlock()->GetBlockId()));
745 HInstruction* next_phi = phi->GetNext();
750 "but phi %d has %zu inputs.",
751 phi->GetId(),
752 phi->GetBlock()->GetBlockId(),
760 // Ensure the number of inputs of a non-catch phi is the same as the number
762 const ArenaVector<HBasicBlock*>& predecessors = phi->GetBlock()->GetPredecessors();
767 phi->GetId(), phi->GetBlock()->GetBlockId(), input_records.size(),
768 phi->GetBlock()->GetBlockId(), predecessors.size()));
770 // Ensure phi input at index I either comes from the Ith
778 "Input %d at index %zu of phi %d from block %d is not defined in "
780 input->GetId(), i, phi->GetId(), phi->GetBlock()->GetBlockId(),
790 if (phi->IsCatchPhi()) {
791 HInstruction* next_phi = phi->GetNext();
792 if (next_phi != nullptr && phi->GetRegNumber() > next_phi->AsPhi()->GetRegNumber()) {
795 phi->GetId(),
797 phi->GetBlock()->GetBlockId()));
801 // Test phi equivalents. There should not be two of the same type and they should only be
803 // a synthetic phi (indicated by lack of a virtual register).
804 if (phi->GetRegNumber() != kNoRegNumber) {
805 for (HInstructionIterator phi_it(phi->GetBlock()->GetPhis());
809 if (phi != other_phi && phi->GetRegNumber() == other_phi->GetRegNumber()) {
810 if (phi->GetType() == other_phi->GetType()) {
812 type_str << phi->GetType();
813 AddError(StringPrintf("Equivalent phi (%d) found for VReg %d with type: %s.",
814 phi->GetId(),
815 phi->GetRegNumber(),
817 } else if (phi->GetType() == Primitive::kPrimNot) {
821 "Equivalent non-reference phi (%d) found for VReg %d with type: %s.",
822 phi->GetId(),
823 phi->GetRegNumber(),
831 if (!IsConstantEquivalent(phi, other_phi, &visited)) {
834 phi->GetId(),
836 phi->GetRegNumber()));