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.