llvm.org GIT mirror llvm / 4e31728
Cleanup PPCInstrInfo::DefinesPredicate Implement suggestions made by Bill Schmidt in post-commit review. Thanks! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179162 91177308-0d34-0410-b5e6-96231b3b80d8 Hal Finkel 7 years ago
1 changed file(s) with 10 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
10021002 bool Found = false;
10031003 for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
10041004 const MachineOperand &MO = MI->getOperand(i);
1005 for (int c = 0; c < 2 && !Found; ++c) {
1005 for (unsigned c = 0; c < array_lengthof(RCs) && !Found; ++c) {
10061006 const TargetRegisterClass *RC = RCs[c];
1007 for (TargetRegisterClass::iterator I = RC->begin(),
1008 IE = RC->end(); I != IE; ++I) {
1009 if ((MO.isRegMask() && MO.clobbersPhysReg(*I)) ||
1010 (MO.isReg() && MO.isDef() && MO.getReg() == *I)) {
1007 if (MO.isReg()) {
1008 if (MO.isDef() && RC->contains(MO.getReg())) {
10111009 Pred.push_back(MO);
10121010 Found = true;
10131011 }
1012 } else if (MO.isRegMask()) {
1013 for (TargetRegisterClass::iterator I = RC->begin(),
1014 IE = RC->end(); I != IE; ++I)
1015 if (MO.clobbersPhysReg(*I)) {
1016 Pred.push_back(MO);
1017 Found = true;
1018 }
10141019 }
10151020 }
10161021 }