1 //===---- ReachingDefAnalysis.cpp - Reaching Def Analysis ---*- C++ -*-----===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #include "llvm/ADT/SmallSet.h" 10 #include "llvm/CodeGen/LivePhysRegs.h" 11 #include "llvm/CodeGen/ReachingDefAnalysis.h" 12 #include "llvm/CodeGen/TargetRegisterInfo.h" 13 #include "llvm/CodeGen/TargetSubtargetInfo.h" 14 #include "llvm/Support/Debug.h" 15 16 using namespace llvm; 17 18 #define DEBUG_TYPE "reaching-deps-analysis" 19 20 char ReachingDefAnalysis::ID = 0; 21 INITIALIZE_PASS(ReachingDefAnalysis, DEBUG_TYPE, "ReachingDefAnalysis", false, 22 true) 23 24 static bool isValidReg(const MachineOperand &MO) { 25 return MO.isReg() && MO.getReg(); 26 } 27 28 static bool isValidRegUse(const MachineOperand &MO) { 29 return isValidReg(MO) && MO.isUse(); 30 } 31 32 static bool isValidRegUseOf(const MachineOperand &MO, int PhysReg) { 33 return isValidRegUse(MO) && MO.getReg() == PhysReg; 34 } 35 36 static bool isValidRegDef(const MachineOperand &MO) { 37 return isValidReg(MO) && MO.isDef(); 38 } 39 40 static bool isValidRegDefOf(const MachineOperand &MO, int PhysReg) { 41 return isValidRegDef(MO) && MO.getReg() == PhysReg; 42 } 43 44 void ReachingDefAnalysis::enterBasicBlock( 45 const LoopTraversal::TraversedMBBInfo &TraversedMBB) { 46 47 MachineBasicBlock *MBB = TraversedMBB.MBB; 48 unsigned MBBNumber = MBB->getNumber(); 49 assert(MBBNumber < MBBReachingDefs.size() && 50 "Unexpected basic block number."); 51 MBBReachingDefs[MBBNumber].resize(NumRegUnits); 52 53 // Reset instruction counter in each basic block. 54 CurInstr = 0; 55 56 // Set up LiveRegs to represent registers entering MBB. 57 // Default values are 'nothing happened a long time ago'. 58 if (LiveRegs.empty()) 59 LiveRegs.assign(NumRegUnits, ReachingDefDefaultVal); 60 61 // This is the entry block. 62 if (MBB->pred_empty()) { 63 for (const auto &LI : MBB->liveins()) { 64 for (MCRegUnitIterator Unit(LI.PhysReg, TRI); Unit.isValid(); ++Unit) { 65 // Treat function live-ins as if they were defined just before the first 66 // instruction. Usually, function arguments are set up immediately 67 // before the call. 68 LiveRegs[*Unit] = -1; 69 MBBReachingDefs[MBBNumber][*Unit].push_back(LiveRegs[*Unit]); 70 } 71 } 72 LLVM_DEBUG(dbgs() << printMBBReference(*MBB) << ": entry\n"); 73 return; 74 } 75 76 // Try to coalesce live-out registers from predecessors. 77 for (MachineBasicBlock *pred : MBB->predecessors()) { 78 assert(unsigned(pred->getNumber()) < MBBOutRegsInfos.size() && 79 "Should have pre-allocated MBBInfos for all MBBs"); 80 const LiveRegsDefInfo &Incoming = MBBOutRegsInfos[pred->getNumber()]; 81 // Incoming is null if this is a backedge from a BB 82 // we haven't processed yet 83 if (Incoming.empty()) 84 continue; 85 86 for (unsigned Unit = 0; Unit != NumRegUnits; ++Unit) { 87 // Use the most recent predecessor def for each register. 88 LiveRegs[Unit] = std::max(LiveRegs[Unit], Incoming[Unit]); 89 if ((LiveRegs[Unit] != ReachingDefDefaultVal)) 90 MBBReachingDefs[MBBNumber][Unit].push_back(LiveRegs[Unit]); 91 } 92 } 93 94 LLVM_DEBUG(dbgs() << printMBBReference(*MBB) 95 << (!TraversedMBB.IsDone ? ": incomplete\n" 96 : ": all preds known\n")); 97 } 98 99 void ReachingDefAnalysis::leaveBasicBlock( 100 const LoopTraversal::TraversedMBBInfo &TraversedMBB) { 101 assert(!LiveRegs.empty() && "Must enter basic block first."); 102 unsigned MBBNumber = TraversedMBB.MBB->getNumber(); 103 assert(MBBNumber < MBBOutRegsInfos.size() && 104 "Unexpected basic block number."); 105 // Save register clearances at end of MBB - used by enterBasicBlock(). 106 MBBOutRegsInfos[MBBNumber] = LiveRegs; 107 108 // While processing the basic block, we kept `Def` relative to the start 109 // of the basic block for convenience. However, future use of this information 110 // only cares about the clearance from the end of the block, so adjust 111 // everything to be relative to the end of the basic block. 112 for (int &OutLiveReg : MBBOutRegsInfos[MBBNumber]) 113 if (OutLiveReg != ReachingDefDefaultVal) 114 OutLiveReg -= CurInstr; 115 LiveRegs.clear(); 116 } 117 118 void ReachingDefAnalysis::processDefs(MachineInstr *MI) { 119 assert(!MI->isDebugInstr() && "Won't process debug instructions"); 120 121 unsigned MBBNumber = MI->getParent()->getNumber(); 122 assert(MBBNumber < MBBReachingDefs.size() && 123 "Unexpected basic block number."); 124 125 for (auto &MO : MI->operands()) { 126 if (!isValidRegDef(MO)) 127 continue; 128 for (MCRegUnitIterator Unit(MO.getReg(), TRI); Unit.isValid(); ++Unit) { 129 // This instruction explicitly defines the current reg unit. 130 LLVM_DEBUG(dbgs() << printReg(MO.getReg(), TRI) << ":\t" << CurInstr 131 << '\t' << *MI); 132 133 // How many instructions since this reg unit was last written? 134 LiveRegs[*Unit] = CurInstr; 135 MBBReachingDefs[MBBNumber][*Unit].push_back(CurInstr); 136 } 137 } 138 InstIds[MI] = CurInstr; 139 ++CurInstr; 140 } 141 142 void ReachingDefAnalysis::processBasicBlock( 143 const LoopTraversal::TraversedMBBInfo &TraversedMBB) { 144 enterBasicBlock(TraversedMBB); 145 for (MachineInstr &MI : *TraversedMBB.MBB) { 146 if (!MI.isDebugInstr()) 147 processDefs(&MI); 148 } 149 leaveBasicBlock(TraversedMBB); 150 } 151 152 bool ReachingDefAnalysis::runOnMachineFunction(MachineFunction &mf) { 153 MF = &mf; 154 TRI = MF->getSubtarget().getRegisterInfo(); 155 LLVM_DEBUG(dbgs() << "********** REACHING DEFINITION ANALYSIS **********\n"); 156 init(); 157 traverse(); 158 return false; 159 } 160 161 void ReachingDefAnalysis::releaseMemory() { 162 // Clear the internal vectors. 163 MBBOutRegsInfos.clear(); 164 MBBReachingDefs.clear(); 165 InstIds.clear(); 166 LiveRegs.clear(); 167 } 168 169 void ReachingDefAnalysis::reset() { 170 releaseMemory(); 171 init(); 172 traverse(); 173 } 174 175 void ReachingDefAnalysis::init() { 176 NumRegUnits = TRI->getNumRegUnits(); 177 MBBReachingDefs.resize(MF->getNumBlockIDs()); 178 // Initialize the MBBOutRegsInfos 179 MBBOutRegsInfos.resize(MF->getNumBlockIDs()); 180 LoopTraversal Traversal; 181 TraversedMBBOrder = Traversal.traverse(*MF); 182 } 183 184 void ReachingDefAnalysis::traverse() { 185 // Traverse the basic blocks. 186 for (LoopTraversal::TraversedMBBInfo TraversedMBB : TraversedMBBOrder) 187 processBasicBlock(TraversedMBB); 188 // Sorting all reaching defs found for a ceartin reg unit in a given BB. 189 for (MBBDefsInfo &MBBDefs : MBBReachingDefs) { 190 for (MBBRegUnitDefs &RegUnitDefs : MBBDefs) 191 llvm::sort(RegUnitDefs); 192 } 193 } 194 195 int ReachingDefAnalysis::getReachingDef(MachineInstr *MI, int PhysReg) const { 196 assert(InstIds.count(MI) && "Unexpected machine instuction."); 197 int InstId = InstIds.lookup(MI); 198 int DefRes = ReachingDefDefaultVal; 199 unsigned MBBNumber = MI->getParent()->getNumber(); 200 assert(MBBNumber < MBBReachingDefs.size() && 201 "Unexpected basic block number."); 202 int LatestDef = ReachingDefDefaultVal; 203 for (MCRegUnitIterator Unit(PhysReg, TRI); Unit.isValid(); ++Unit) { 204 for (int Def : MBBReachingDefs[MBBNumber][*Unit]) { 205 if (Def >= InstId) 206 break; 207 DefRes = Def; 208 } 209 LatestDef = std::max(LatestDef, DefRes); 210 } 211 return LatestDef; 212 } 213 214 MachineInstr* ReachingDefAnalysis::getReachingLocalMIDef(MachineInstr *MI, 215 int PhysReg) const { 216 return getInstFromId(MI->getParent(), getReachingDef(MI, PhysReg)); 217 } 218 219 bool ReachingDefAnalysis::hasSameReachingDef(MachineInstr *A, MachineInstr *B, 220 int PhysReg) const { 221 MachineBasicBlock *ParentA = A->getParent(); 222 MachineBasicBlock *ParentB = B->getParent(); 223 if (ParentA != ParentB) 224 return false; 225 226 return getReachingDef(A, PhysReg) == getReachingDef(B, PhysReg); 227 } 228 229 MachineInstr *ReachingDefAnalysis::getInstFromId(MachineBasicBlock *MBB, 230 int InstId) const { 231 assert(static_cast<size_t>(MBB->getNumber()) < MBBReachingDefs.size() && 232 "Unexpected basic block number."); 233 assert(InstId < static_cast<int>(MBB->size()) && 234 "Unexpected instruction id."); 235 236 if (InstId < 0) 237 return nullptr; 238 239 for (auto &MI : *MBB) { 240 auto F = InstIds.find(&MI); 241 if (F != InstIds.end() && F->second == InstId) 242 return &MI; 243 } 244 245 return nullptr; 246 } 247 248 int 249 ReachingDefAnalysis::getClearance(MachineInstr *MI, MCPhysReg PhysReg) const { 250 assert(InstIds.count(MI) && "Unexpected machine instuction."); 251 return InstIds.lookup(MI) - getReachingDef(MI, PhysReg); 252 } 253 254 bool 255 ReachingDefAnalysis::hasLocalDefBefore(MachineInstr *MI, int PhysReg) const { 256 return getReachingDef(MI, PhysReg) >= 0; 257 } 258 259 void ReachingDefAnalysis::getReachingLocalUses(MachineInstr *Def, int PhysReg, 260 InstSet &Uses) const { 261 MachineBasicBlock *MBB = Def->getParent(); 262 MachineBasicBlock::iterator MI = MachineBasicBlock::iterator(Def); 263 while (++MI != MBB->end()) { 264 if (MI->isDebugInstr()) 265 continue; 266 267 // If/when we find a new reaching def, we know that there's no more uses 268 // of 'Def'. 269 if (getReachingLocalMIDef(&*MI, PhysReg) != Def) 270 return; 271 272 for (auto &MO : MI->operands()) { 273 if (!isValidRegUseOf(MO, PhysReg)) 274 continue; 275 276 Uses.insert(&*MI); 277 if (MO.isKill()) 278 return; 279 } 280 } 281 } 282 283 bool 284 ReachingDefAnalysis::getLiveInUses(MachineBasicBlock *MBB, int PhysReg, 285 InstSet &Uses) const { 286 for (auto &MI : *MBB) { 287 if (MI.isDebugInstr()) 288 continue; 289 for (auto &MO : MI.operands()) { 290 if (!isValidRegUseOf(MO, PhysReg)) 291 continue; 292 if (getReachingDef(&MI, PhysReg) >= 0) 293 return false; 294 Uses.insert(&MI); 295 } 296 } 297 return isReachingDefLiveOut(&MBB->back(), PhysReg); 298 } 299 300 void 301 ReachingDefAnalysis::getGlobalUses(MachineInstr *MI, int PhysReg, 302 InstSet &Uses) const { 303 MachineBasicBlock *MBB = MI->getParent(); 304 305 // Collect the uses that each def touches within the block. 306 getReachingLocalUses(MI, PhysReg, Uses); 307 308 // Handle live-out values. 309 if (auto *LiveOut = getLocalLiveOutMIDef(MI->getParent(), PhysReg)) { 310 if (LiveOut != MI) 311 return; 312 313 SmallVector<MachineBasicBlock*, 4> ToVisit; 314 ToVisit.insert(ToVisit.begin(), MBB->successors().begin(), 315 MBB->successors().end()); 316 SmallPtrSet<MachineBasicBlock*, 4>Visited; 317 while (!ToVisit.empty()) { 318 MachineBasicBlock *MBB = ToVisit.back(); 319 ToVisit.pop_back(); 320 if (Visited.count(MBB) || !MBB->isLiveIn(PhysReg)) 321 continue; 322 if (getLiveInUses(MBB, PhysReg, Uses)) 323 ToVisit.insert(ToVisit.end(), MBB->successors().begin(), 324 MBB->successors().end()); 325 Visited.insert(MBB); 326 } 327 } 328 } 329 330 void 331 ReachingDefAnalysis::getLiveOuts(MachineBasicBlock *MBB, int PhysReg, 332 InstSet &Defs, BlockSet &VisitedBBs) const { 333 if (VisitedBBs.count(MBB)) 334 return; 335 336 VisitedBBs.insert(MBB); 337 LivePhysRegs LiveRegs(*TRI); 338 LiveRegs.addLiveOuts(*MBB); 339 if (!LiveRegs.contains(PhysReg)) 340 return; 341 342 if (auto *Def = getLocalLiveOutMIDef(MBB, PhysReg)) 343 Defs.insert(Def); 344 else 345 for (auto *Pred : MBB->predecessors()) 346 getLiveOuts(Pred, PhysReg, Defs, VisitedBBs); 347 } 348 349 MachineInstr *ReachingDefAnalysis::getUniqueReachingMIDef(MachineInstr *MI, 350 int PhysReg) const { 351 // If there's a local def before MI, return it. 352 MachineInstr *LocalDef = getReachingLocalMIDef(MI, PhysReg); 353 if (LocalDef && InstIds.lookup(LocalDef) < InstIds.lookup(MI)) 354 return LocalDef; 355 356 SmallPtrSet<MachineBasicBlock*, 4> VisitedBBs; 357 SmallPtrSet<MachineInstr*, 2> Incoming; 358 for (auto *Pred : MI->getParent()->predecessors()) 359 getLiveOuts(Pred, PhysReg, Incoming, VisitedBBs); 360 361 // If we have a local def and an incoming instruction, then there's not a 362 // unique instruction def. 363 if (!Incoming.empty() && LocalDef) 364 return nullptr; 365 else if (Incoming.size() == 1) 366 return *Incoming.begin(); 367 else 368 return LocalDef; 369 } 370 371 MachineInstr *ReachingDefAnalysis::getMIOperand(MachineInstr *MI, 372 unsigned Idx) const { 373 assert(MI->getOperand(Idx).isReg() && "Expected register operand"); 374 return getUniqueReachingMIDef(MI, MI->getOperand(Idx).getReg()); 375 } 376 377 MachineInstr *ReachingDefAnalysis::getMIOperand(MachineInstr *MI, 378 MachineOperand &MO) const { 379 assert(MO.isReg() && "Expected register operand"); 380 return getUniqueReachingMIDef(MI, MO.getReg()); 381 } 382 383 bool ReachingDefAnalysis::isRegUsedAfter(MachineInstr *MI, int PhysReg) const { 384 MachineBasicBlock *MBB = MI->getParent(); 385 LivePhysRegs LiveRegs(*TRI); 386 LiveRegs.addLiveOuts(*MBB); 387 388 // Yes if the register is live out of the basic block. 389 if (LiveRegs.contains(PhysReg)) 390 return true; 391 392 // Walk backwards through the block to see if the register is live at some 393 // point. 394 for (auto Last = MBB->rbegin(), End = MBB->rend(); Last != End; ++Last) { 395 LiveRegs.stepBackward(*Last); 396 if (LiveRegs.contains(PhysReg)) 397 return InstIds.lookup(&*Last) > InstIds.lookup(MI); 398 } 399 return false; 400 } 401 402 bool ReachingDefAnalysis::isRegDefinedAfter(MachineInstr *MI, 403 int PhysReg) const { 404 MachineBasicBlock *MBB = MI->getParent(); 405 if (getReachingDef(MI, PhysReg) != getReachingDef(&MBB->back(), PhysReg)) 406 return true; 407 408 if (auto *Def = getLocalLiveOutMIDef(MBB, PhysReg)) 409 return Def == getReachingLocalMIDef(MI, PhysReg); 410 411 return false; 412 } 413 414 bool 415 ReachingDefAnalysis::isReachingDefLiveOut(MachineInstr *MI, int PhysReg) const { 416 MachineBasicBlock *MBB = MI->getParent(); 417 LivePhysRegs LiveRegs(*TRI); 418 LiveRegs.addLiveOuts(*MBB); 419 if (!LiveRegs.contains(PhysReg)) 420 return false; 421 422 MachineInstr *Last = &MBB->back(); 423 int Def = getReachingDef(MI, PhysReg); 424 if (getReachingDef(Last, PhysReg) != Def) 425 return false; 426 427 // Finally check that the last instruction doesn't redefine the register. 428 for (auto &MO : Last->operands()) 429 if (isValidRegDefOf(MO, PhysReg)) 430 return false; 431 432 return true; 433 } 434 435 MachineInstr* ReachingDefAnalysis::getLocalLiveOutMIDef(MachineBasicBlock *MBB, 436 int PhysReg) const { 437 LivePhysRegs LiveRegs(*TRI); 438 LiveRegs.addLiveOuts(*MBB); 439 if (!LiveRegs.contains(PhysReg)) 440 return nullptr; 441 442 MachineInstr *Last = &MBB->back(); 443 int Def = getReachingDef(Last, PhysReg); 444 for (auto &MO : Last->operands()) 445 if (isValidRegDefOf(MO, PhysReg)) 446 return Last; 447 448 return Def < 0 ? nullptr : getInstFromId(MBB, Def); 449 } 450 451 static bool mayHaveSideEffects(MachineInstr &MI) { 452 return MI.mayLoadOrStore() || MI.mayRaiseFPException() || 453 MI.hasUnmodeledSideEffects() || MI.isTerminator() || 454 MI.isCall() || MI.isBarrier() || MI.isBranch() || MI.isReturn(); 455 } 456 457 // Can we safely move 'From' to just before 'To'? To satisfy this, 'From' must 458 // not define a register that is used by any instructions, after and including, 459 // 'To'. These instructions also must not redefine any of Froms operands. 460 template<typename Iterator> 461 bool ReachingDefAnalysis::isSafeToMove(MachineInstr *From, 462 MachineInstr *To) const { 463 if (From->getParent() != To->getParent()) 464 return false; 465 466 SmallSet<int, 2> Defs; 467 // First check that From would compute the same value if moved. 468 for (auto &MO : From->operands()) { 469 if (!isValidReg(MO)) 470 continue; 471 if (MO.isDef()) 472 Defs.insert(MO.getReg()); 473 else if (!hasSameReachingDef(From, To, MO.getReg())) 474 return false; 475 } 476 477 // Now walk checking that the rest of the instructions will compute the same 478 // value and that we're not overwriting anything. Don't move the instruction 479 // past any memory, control-flow or other ambigious instructions. 480 for (auto I = ++Iterator(From), E = Iterator(To); I != E; ++I) { 481 if (mayHaveSideEffects(*I)) 482 return false; 483 for (auto &MO : I->operands()) 484 if (MO.isReg() && MO.getReg() && Defs.count(MO.getReg())) 485 return false; 486 } 487 return true; 488 } 489 490 bool ReachingDefAnalysis::isSafeToMoveForwards(MachineInstr *From, 491 MachineInstr *To) const { 492 return isSafeToMove<MachineBasicBlock::reverse_iterator>(From, To); 493 } 494 495 bool ReachingDefAnalysis::isSafeToMoveBackwards(MachineInstr *From, 496 MachineInstr *To) const { 497 return isSafeToMove<MachineBasicBlock::iterator>(From, To); 498 } 499 500 bool ReachingDefAnalysis::isSafeToRemove(MachineInstr *MI, 501 InstSet &ToRemove) const { 502 SmallPtrSet<MachineInstr*, 1> Ignore; 503 SmallPtrSet<MachineInstr*, 2> Visited; 504 return isSafeToRemove(MI, Visited, ToRemove, Ignore); 505 } 506 507 bool 508 ReachingDefAnalysis::isSafeToRemove(MachineInstr *MI, InstSet &ToRemove, 509 InstSet &Ignore) const { 510 SmallPtrSet<MachineInstr*, 2> Visited; 511 return isSafeToRemove(MI, Visited, ToRemove, Ignore); 512 } 513 514 bool 515 ReachingDefAnalysis::isSafeToRemove(MachineInstr *MI, InstSet &Visited, 516 InstSet &ToRemove, InstSet &Ignore) const { 517 if (Visited.count(MI) || Ignore.count(MI)) 518 return true; 519 else if (mayHaveSideEffects(*MI)) { 520 // Unless told to ignore the instruction, don't remove anything which has 521 // side effects. 522 return false; 523 } 524 525 Visited.insert(MI); 526 for (auto &MO : MI->operands()) { 527 if (!isValidRegDef(MO)) 528 continue; 529 530 SmallPtrSet<MachineInstr*, 4> Uses; 531 getGlobalUses(MI, MO.getReg(), Uses); 532 533 for (auto I : Uses) { 534 if (Ignore.count(I) || ToRemove.count(I)) 535 continue; 536 if (!isSafeToRemove(I, Visited, ToRemove, Ignore)) 537 return false; 538 } 539 } 540 ToRemove.insert(MI); 541 return true; 542 } 543 544 void ReachingDefAnalysis::collectKilledOperands(MachineInstr *MI, 545 InstSet &Dead) const { 546 Dead.insert(MI); 547 auto IsDead = [this, &Dead](MachineInstr *Def, int PhysReg) { 548 unsigned LiveDefs = 0; 549 for (auto &MO : Def->operands()) { 550 if (!isValidRegDef(MO)) 551 continue; 552 if (!MO.isDead()) 553 ++LiveDefs; 554 } 555 556 if (LiveDefs > 1) 557 return false; 558 559 SmallPtrSet<MachineInstr*, 4> Uses; 560 getGlobalUses(Def, PhysReg, Uses); 561 for (auto *Use : Uses) 562 if (!Dead.count(Use)) 563 return false; 564 return true; 565 }; 566 567 for (auto &MO : MI->operands()) { 568 if (!isValidRegUse(MO)) 569 continue; 570 if (MachineInstr *Def = getMIOperand(MI, MO)) 571 if (IsDead(Def, MO.getReg())) 572 collectKilledOperands(Def, Dead); 573 } 574 } 575 576 bool ReachingDefAnalysis::isSafeToDefRegAt(MachineInstr *MI, 577 int PhysReg) const { 578 SmallPtrSet<MachineInstr*, 1> Ignore; 579 return isSafeToDefRegAt(MI, PhysReg, Ignore); 580 } 581 582 bool ReachingDefAnalysis::isSafeToDefRegAt(MachineInstr *MI, int PhysReg, 583 InstSet &Ignore) const { 584 // Check for any uses of the register after MI. 585 if (isRegUsedAfter(MI, PhysReg)) { 586 if (auto *Def = getReachingLocalMIDef(MI, PhysReg)) { 587 SmallPtrSet<MachineInstr*, 2> Uses; 588 getReachingLocalUses(Def, PhysReg, Uses); 589 for (auto *Use : Uses) 590 if (!Ignore.count(Use)) 591 return false; 592 } else 593 return false; 594 } 595 596 MachineBasicBlock *MBB = MI->getParent(); 597 // Check for any defs after MI. 598 if (isRegDefinedAfter(MI, PhysReg)) { 599 auto I = MachineBasicBlock::iterator(MI); 600 for (auto E = MBB->end(); I != E; ++I) { 601 if (Ignore.count(&*I)) 602 continue; 603 for (auto &MO : I->operands()) 604 if (isValidRegDefOf(MO, PhysReg)) 605 return false; 606 } 607 } 608 return true; 609 } 610