harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pamela Yuan" <pamela.y...@gmail.com>
Subject [drlvm][jitrino]questiones about check instructions
Date Tue, 25 Mar 2008 08:23:44 GMT
Hi,all.
    We know that each operand must be defined at the usage point.
    In LIR Ia32IRManager.cpp, the following method can inspect whether
a operand is defined before it is used.

    bool IRManager::verifyLiveness() {
        Node* prolog=fg->getEntryNode();
        bool failed=false;
        BitSet * ls=getLiveAtEntry(prolog);
        assert(ls!=NULL);
       Constraint
calleeSaveRegs=getCallingConvention()->getCalleeSavedRegs(OpndKind_GPReg);
       BitSet::IterB lives(*ls);
       for (int i = lives.getNext(); i != -1; i = lives.getNext()){
           Opnd * opnd=getOpnd(i);
           assert(opnd!=NULL);
           if ( opnd->isSubjectForLivenessAnalysis() &&

(opnd->isPlacedIn(RegName_EFLAGS)||!isPreallocatedRegOpnd(opnd))) {
            VERIFY_OUT("Operand live at entry: " << opnd << ::std::endl);
            VERIFY_OUT("This means there is a use of the operand when
it is not yet defined" << ::std::endl);
            failed=true;
        };
    }
    if (failed)
        VERIFY_OUT(::std::endl << "Liveness verification failure" <<
::std::endl);
    return !failed;
}

Are there some check instructions to do the same work in HIR ?
Thanks.

Mime
View raw message