Lines Matching defs:phi

123       AddError(StringPrintf("Block %d has a non-phi in its phi list.",
127 AddError(StringPrintf("The recorded last phi of block %d does not match "
128 "the actual last phi %d.",
140 AddError(StringPrintf("Block %d has a phi in its non-phi list.",
476 "with catch phi %d for vreg %d but its "
697 void GraphChecker::VisitPhi(HPhi* phi) {
698 VisitInstruction(phi);
700 // Ensure the first input of a phi is not itself.
701 if (phi->InputAt(0) == phi) {
702 AddError(StringPrintf("Loop phi %d in block %d is its own first input.",
703 phi->GetId(),
704 phi->GetBlock()->GetBlockId()));
707 // Ensure that the inputs have the same primitive kind as the phi.
708 for (size_t i = 0, e = phi->InputCount(); i < e; ++i) {
709 HInstruction* input = phi->InputAt(i);
710 if (Primitive::PrimitiveKind(input->GetType()) != Primitive::PrimitiveKind(phi->GetType())) {
712 "Input %d at index %zu of phi %d from block %d does not have the "
713 "same kind as the phi: %s versus %s",
714 input->GetId(), i, phi->GetId(), phi->GetBlock()->GetBlockId(),
716 Primitive::PrettyDescriptor(phi->GetType())));
719 if (phi->GetType() != HPhi::ToPhiType(phi->GetType())) {
720 AddError(StringPrintf("Phi %d in block %d does not have an expected phi type: %s",
721 phi->GetId(),
722 phi->GetBlock()->GetBlockId(),
723 Primitive::PrettyDescriptor(phi->GetType())));
726 if (phi->IsCatchPhi()) {
727 // The number of inputs of a catch phi should be the total number of throwing
732 size_t input_count_this = phi->InputCount();
735 phi->GetId(),
736 phi->GetBlock()->GetBlockId()));
738 HInstruction* next_phi = phi->GetNext();
743 "but phi %d has %zu inputs.",
744 phi->GetId(),
745 phi->GetBlock()->GetBlockId(),
753 // Ensure the number of inputs of a non-catch phi is the same as the number
755 const ArenaVector<HBasicBlock*>& predecessors = phi->GetBlock()->GetPredecessors();
756 if (phi->InputCount() != predecessors.size()) {
760 phi->GetId(), phi->GetBlock()->GetBlockId(), phi->InputCount(),
761 phi->GetBlock()->GetBlockId(), predecessors.size()));
763 // Ensure phi input at index I either comes from the Ith
765 for (size_t i = 0, e = phi->InputCount(); i < e; ++i) {
766 HInstruction* input = phi->InputAt(i);
771 "Input %d at index %zu of phi %d from block %d is not defined in "
773 input->GetId(), i, phi->GetId(), phi->GetBlock()->GetBlockId(),
783 if (phi->IsCatchPhi()) {
784 HInstruction* next_phi = phi->GetNext();
785 if (next_phi != nullptr && phi->GetRegNumber() > next_phi->AsPhi()->GetRegNumber()) {
788 phi->GetId(),
790 phi->GetBlock()->GetBlockId()));
794 // Test phi equivalents. There should not be two of the same type and they should only be
796 // a synthetic phi (indicated by lack of a virtual register).
797 if (phi->GetRegNumber() != kNoRegNumber) {
798 for (HInstructionIterator phi_it(phi->GetBlock()->GetPhis());
802 if (phi != other_phi && phi->GetRegNumber() == other_phi->GetRegNumber()) {
803 if (phi->GetType() == other_phi->GetType()) {
805 type_str << phi->GetType();
806 AddError(StringPrintf("Equivalent phi (%d) found for VReg %d with type: %s.",
807 phi->GetId(),
808 phi->GetRegNumber(),
810 } else if (phi->GetType() == Primitive::kPrimNot) {
814 "Equivalent non-reference phi (%d) found for VReg %d with type: %s.",
815 phi->GetId(),
816 phi->GetRegNumber(),
824 if (!IsConstantEquivalent(phi, other_phi, &visited)) {
827 phi->GetId(),
829 phi->GetRegNumber()));