1 //===-- MipsDelaySlotFiller.cpp - Mips Delay Slot Filler ------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Simple pass to fill delay slots with useful instructions.
12 //===----------------------------------------------------------------------===//
14 #include "MCTargetDesc/MipsMCNaCl.h"
16 #include "MipsInstrInfo.h"
17 #include "MipsTargetMachine.h"
18 #include "llvm/ADT/BitVector.h"
19 #include "llvm/ADT/SmallPtrSet.h"
20 #include "llvm/ADT/Statistic.h"
21 #include "llvm/Analysis/AliasAnalysis.h"
22 #include "llvm/Analysis/ValueTracking.h"
23 #include "llvm/CodeGen/MachineBranchProbabilityInfo.h"
24 #include "llvm/CodeGen/MachineFunctionPass.h"
25 #include "llvm/CodeGen/MachineInstrBuilder.h"
26 #include "llvm/CodeGen/MachineRegisterInfo.h"
27 #include "llvm/CodeGen/PseudoSourceValue.h"
28 #include "llvm/Support/CommandLine.h"
29 #include "llvm/Target/TargetInstrInfo.h"
30 #include "llvm/Target/TargetMachine.h"
31 #include "llvm/Target/TargetRegisterInfo.h"
35 #define DEBUG_TYPE "delay-slot-filler"
37 STATISTIC(FilledSlots, "Number of delay slots filled");
38 STATISTIC(UsefulSlots, "Number of delay slots filled with instructions that"
41 static cl::opt<bool> DisableDelaySlotFiller(
42 "disable-mips-delay-filler",
44 cl::desc("Fill all delay slots with NOPs."),
47 static cl::opt<bool> DisableForwardSearch(
48 "disable-mips-df-forward-search",
50 cl::desc("Disallow MIPS delay filler to search forward."),
53 static cl::opt<bool> DisableSuccBBSearch(
54 "disable-mips-df-succbb-search",
56 cl::desc("Disallow MIPS delay filler to search successor basic blocks."),
59 static cl::opt<bool> DisableBackwardSearch(
60 "disable-mips-df-backward-search",
62 cl::desc("Disallow MIPS delay filler to search backward."),
66 typedef MachineBasicBlock::iterator Iter;
67 typedef MachineBasicBlock::reverse_iterator ReverseIter;
68 typedef SmallDenseMap<MachineBasicBlock*, MachineInstr*, 2> BB2BrMap;
72 RegDefsUses(TargetMachine &TM);
73 void init(const MachineInstr &MI);
75 /// This function sets all caller-saved registers in Defs.
76 void setCallerSaved(const MachineInstr &MI);
78 /// This function sets all unallocatable registers in Defs.
79 void setUnallocatableRegs(const MachineFunction &MF);
81 /// Set bits in Uses corresponding to MBB's live-out registers except for
82 /// the registers that are live-in to SuccBB.
83 void addLiveOut(const MachineBasicBlock &MBB,
84 const MachineBasicBlock &SuccBB);
86 bool update(const MachineInstr &MI, unsigned Begin, unsigned End);
89 bool checkRegDefsUses(BitVector &NewDefs, BitVector &NewUses, unsigned Reg,
92 /// Returns true if Reg or its alias is in RegSet.
93 bool isRegInSet(const BitVector &RegSet, unsigned Reg) const;
95 const TargetRegisterInfo &TRI;
99 /// Base class for inspecting loads and stores.
100 class InspectMemInstr {
102 InspectMemInstr(bool ForbidMemInstr_)
103 : OrigSeenLoad(false), OrigSeenStore(false), SeenLoad(false),
104 SeenStore(false), ForbidMemInstr(ForbidMemInstr_) {}
106 /// Return true if MI cannot be moved to delay slot.
107 bool hasHazard(const MachineInstr &MI);
109 virtual ~InspectMemInstr() {}
112 /// Flags indicating whether loads or stores have been seen.
113 bool OrigSeenLoad, OrigSeenStore, SeenLoad, SeenStore;
115 /// Memory instructions are not allowed to move to delay slot if this flag
120 virtual bool hasHazard_(const MachineInstr &MI) = 0;
123 /// This subclass rejects any memory instructions.
124 class NoMemInstr : public InspectMemInstr {
126 NoMemInstr() : InspectMemInstr(true) {}
128 bool hasHazard_(const MachineInstr &MI) override { return true; }
131 /// This subclass accepts loads from stacks and constant loads.
132 class LoadFromStackOrConst : public InspectMemInstr {
134 LoadFromStackOrConst() : InspectMemInstr(false) {}
136 bool hasHazard_(const MachineInstr &MI) override;
139 /// This subclass uses memory dependence information to determine whether a
140 /// memory instruction can be moved to a delay slot.
141 class MemDefsUses : public InspectMemInstr {
143 MemDefsUses(const MachineFrameInfo *MFI);
146 typedef PointerUnion<const Value *, const PseudoSourceValue *> ValueType;
148 bool hasHazard_(const MachineInstr &MI) override;
150 /// Update Defs and Uses. Return true if there exist dependences that
151 /// disqualify the delay slot candidate between V and values in Uses and
153 bool updateDefsUses(ValueType V, bool MayStore);
155 /// Get the list of underlying objects of MI's memory operand.
156 bool getUnderlyingObjects(const MachineInstr &MI,
157 SmallVectorImpl<ValueType> &Objects) const;
159 const MachineFrameInfo *MFI;
160 SmallPtrSet<ValueType, 4> Uses, Defs;
162 /// Flags indicating whether loads or stores with no underlying objects have
164 bool SeenNoObjLoad, SeenNoObjStore;
167 class Filler : public MachineFunctionPass {
169 Filler(TargetMachine &tm)
170 : MachineFunctionPass(ID), TM(tm) { }
172 const char *getPassName() const override {
173 return "Mips Delay Slot Filler";
176 bool runOnMachineFunction(MachineFunction &F) override {
177 bool Changed = false;
178 for (MachineFunction::iterator FI = F.begin(), FE = F.end();
180 Changed |= runOnMachineBasicBlock(*FI);
182 // This pass invalidates liveness information when it reorders
183 // instructions to fill delay slot. Without this, -verify-machineinstrs
186 F.getRegInfo().invalidateLiveness();
191 void getAnalysisUsage(AnalysisUsage &AU) const override {
192 AU.addRequired<MachineBranchProbabilityInfo>();
193 MachineFunctionPass::getAnalysisUsage(AU);
197 bool runOnMachineBasicBlock(MachineBasicBlock &MBB);
199 /// This function checks if it is valid to move Candidate to the delay slot
200 /// and returns true if it isn't. It also updates memory and register
201 /// dependence information.
202 bool delayHasHazard(const MachineInstr &Candidate, RegDefsUses &RegDU,
203 InspectMemInstr &IM) const;
205 /// This function searches range [Begin, End) for an instruction that can be
206 /// moved to the delay slot. Returns true on success.
207 template<typename IterTy>
208 bool searchRange(MachineBasicBlock &MBB, IterTy Begin, IterTy End,
209 RegDefsUses &RegDU, InspectMemInstr &IM,
210 IterTy &Filler) const;
212 /// This function searches in the backward direction for an instruction that
213 /// can be moved to the delay slot. Returns true on success.
214 bool searchBackward(MachineBasicBlock &MBB, Iter Slot) const;
216 /// This function searches MBB in the forward direction for an instruction
217 /// that can be moved to the delay slot. Returns true on success.
218 bool searchForward(MachineBasicBlock &MBB, Iter Slot) const;
220 /// This function searches one of MBB's successor blocks for an instruction
221 /// that can be moved to the delay slot and inserts clones of the
222 /// instruction into the successor's predecessor blocks.
223 bool searchSuccBBs(MachineBasicBlock &MBB, Iter Slot) const;
225 /// Pick a successor block of MBB. Return NULL if MBB doesn't have a
226 /// successor block that is not a landing pad.
227 MachineBasicBlock *selectSuccBB(MachineBasicBlock &B) const;
229 /// This function analyzes MBB and returns an instruction with an unoccupied
230 /// slot that branches to Dst.
231 std::pair<MipsInstrInfo::BranchType, MachineInstr *>
232 getBranch(MachineBasicBlock &MBB, const MachineBasicBlock &Dst) const;
234 /// Examine Pred and see if it is possible to insert an instruction into
235 /// one of its branches delay slot or its end.
236 bool examinePred(MachineBasicBlock &Pred, const MachineBasicBlock &Succ,
237 RegDefsUses &RegDU, bool &HasMultipleSuccs,
238 BB2BrMap &BrMap) const;
240 bool terminateSearch(const MachineInstr &Candidate) const;
247 } // end of anonymous namespace
249 static bool hasUnoccupiedSlot(const MachineInstr *MI) {
250 return MI->hasDelaySlot() && !MI->isBundledWithSucc();
253 /// This function inserts clones of Filler into predecessor blocks.
254 static void insertDelayFiller(Iter Filler, const BB2BrMap &BrMap) {
255 MachineFunction *MF = Filler->getParent()->getParent();
257 for (BB2BrMap::const_iterator I = BrMap.begin(); I != BrMap.end(); ++I) {
259 MIBundleBuilder(I->second).append(MF->CloneMachineInstr(&*Filler));
262 I->first->insert(I->first->end(), MF->CloneMachineInstr(&*Filler));
267 /// This function adds registers Filler defines to MBB's live-in register list.
268 static void addLiveInRegs(Iter Filler, MachineBasicBlock &MBB) {
269 for (unsigned I = 0, E = Filler->getNumOperands(); I != E; ++I) {
270 const MachineOperand &MO = Filler->getOperand(I);
273 if (!MO.isReg() || !MO.isDef() || !(R = MO.getReg()))
277 const MachineFunction &MF = *MBB.getParent();
278 assert(MF.getTarget().getRegisterInfo()->getAllocatableSet(MF).test(R) &&
279 "Shouldn't move an instruction with unallocatable registers across "
280 "basic block boundaries.");
283 if (!MBB.isLiveIn(R))
288 RegDefsUses::RegDefsUses(TargetMachine &TM)
289 : TRI(*TM.getRegisterInfo()), Defs(TRI.getNumRegs(), false),
290 Uses(TRI.getNumRegs(), false) {}
292 void RegDefsUses::init(const MachineInstr &MI) {
293 // Add all register operands which are explicit and non-variadic.
294 update(MI, 0, MI.getDesc().getNumOperands());
296 // If MI is a call, add RA to Defs to prevent users of RA from going into
301 // Add all implicit register operands of branch instructions except
304 update(MI, MI.getDesc().getNumOperands(), MI.getNumOperands());
305 Defs.reset(Mips::AT);
309 void RegDefsUses::setCallerSaved(const MachineInstr &MI) {
312 // If MI is a call, add all caller-saved registers to Defs.
313 BitVector CallerSavedRegs(TRI.getNumRegs(), true);
315 CallerSavedRegs.reset(Mips::ZERO);
316 CallerSavedRegs.reset(Mips::ZERO_64);
318 for (const MCPhysReg *R = TRI.getCalleeSavedRegs(); *R; ++R)
319 for (MCRegAliasIterator AI(*R, &TRI, true); AI.isValid(); ++AI)
320 CallerSavedRegs.reset(*AI);
322 Defs |= CallerSavedRegs;
325 void RegDefsUses::setUnallocatableRegs(const MachineFunction &MF) {
326 BitVector AllocSet = TRI.getAllocatableSet(MF);
328 for (int R = AllocSet.find_first(); R != -1; R = AllocSet.find_next(R))
329 for (MCRegAliasIterator AI(R, &TRI, false); AI.isValid(); ++AI)
332 AllocSet.set(Mips::ZERO);
333 AllocSet.set(Mips::ZERO_64);
335 Defs |= AllocSet.flip();
338 void RegDefsUses::addLiveOut(const MachineBasicBlock &MBB,
339 const MachineBasicBlock &SuccBB) {
340 for (MachineBasicBlock::const_succ_iterator SI = MBB.succ_begin(),
341 SE = MBB.succ_end(); SI != SE; ++SI)
343 for (MachineBasicBlock::livein_iterator LI = (*SI)->livein_begin(),
344 LE = (*SI)->livein_end(); LI != LE; ++LI)
348 bool RegDefsUses::update(const MachineInstr &MI, unsigned Begin, unsigned End) {
349 BitVector NewDefs(TRI.getNumRegs()), NewUses(TRI.getNumRegs());
350 bool HasHazard = false;
352 for (unsigned I = Begin; I != End; ++I) {
353 const MachineOperand &MO = MI.getOperand(I);
355 if (MO.isReg() && MO.getReg())
356 HasHazard |= checkRegDefsUses(NewDefs, NewUses, MO.getReg(), MO.isDef());
365 bool RegDefsUses::checkRegDefsUses(BitVector &NewDefs, BitVector &NewUses,
366 unsigned Reg, bool IsDef) const {
369 // check whether Reg has already been defined or used.
370 return (isRegInSet(Defs, Reg) || isRegInSet(Uses, Reg));
374 // check whether Reg has already been defined.
375 return isRegInSet(Defs, Reg);
378 bool RegDefsUses::isRegInSet(const BitVector &RegSet, unsigned Reg) const {
379 // Check Reg and all aliased Registers.
380 for (MCRegAliasIterator AI(Reg, &TRI, true); AI.isValid(); ++AI)
381 if (RegSet.test(*AI))
386 bool InspectMemInstr::hasHazard(const MachineInstr &MI) {
387 if (!MI.mayStore() && !MI.mayLoad())
393 OrigSeenLoad = SeenLoad;
394 OrigSeenStore = SeenStore;
395 SeenLoad |= MI.mayLoad();
396 SeenStore |= MI.mayStore();
398 // If MI is an ordered or volatile memory reference, disallow moving
399 // subsequent loads and stores to delay slot.
400 if (MI.hasOrderedMemoryRef() && (OrigSeenLoad || OrigSeenStore)) {
401 ForbidMemInstr = true;
405 return hasHazard_(MI);
408 bool LoadFromStackOrConst::hasHazard_(const MachineInstr &MI) {
412 if (!MI.hasOneMemOperand() || !(*MI.memoperands_begin())->getPseudoValue())
415 if (const PseudoSourceValue *PSV =
416 (*MI.memoperands_begin())->getPseudoValue()) {
417 if (isa<FixedStackPseudoSourceValue>(PSV))
419 return !PSV->isConstant(nullptr) && PSV != PseudoSourceValue::getStack();
425 MemDefsUses::MemDefsUses(const MachineFrameInfo *MFI_)
426 : InspectMemInstr(false), MFI(MFI_), SeenNoObjLoad(false),
427 SeenNoObjStore(false) {}
429 bool MemDefsUses::hasHazard_(const MachineInstr &MI) {
430 bool HasHazard = false;
431 SmallVector<ValueType, 4> Objs;
433 // Check underlying object list.
434 if (getUnderlyingObjects(MI, Objs)) {
435 for (SmallVectorImpl<ValueType>::const_iterator I = Objs.begin();
436 I != Objs.end(); ++I)
437 HasHazard |= updateDefsUses(*I, MI.mayStore());
442 // No underlying objects found.
443 HasHazard = MI.mayStore() && (OrigSeenLoad || OrigSeenStore);
444 HasHazard |= MI.mayLoad() || OrigSeenStore;
446 SeenNoObjLoad |= MI.mayLoad();
447 SeenNoObjStore |= MI.mayStore();
452 bool MemDefsUses::updateDefsUses(ValueType V, bool MayStore) {
454 return !Defs.insert(V) || Uses.count(V) || SeenNoObjStore || SeenNoObjLoad;
457 return Defs.count(V) || SeenNoObjStore;
461 getUnderlyingObjects(const MachineInstr &MI,
462 SmallVectorImpl<ValueType> &Objects) const {
463 if (!MI.hasOneMemOperand() ||
464 (!(*MI.memoperands_begin())->getValue() &&
465 !(*MI.memoperands_begin())->getPseudoValue()))
468 if (const PseudoSourceValue *PSV =
469 (*MI.memoperands_begin())->getPseudoValue()) {
470 if (!PSV->isAliased(MFI))
472 Objects.push_back(PSV);
476 const Value *V = (*MI.memoperands_begin())->getValue();
478 SmallVector<Value *, 4> Objs;
479 GetUnderlyingObjects(const_cast<Value *>(V), Objs);
481 for (SmallVectorImpl<Value *>::iterator I = Objs.begin(), E = Objs.end();
483 if (!isIdentifiedObject(V))
486 Objects.push_back(*I);
492 /// runOnMachineBasicBlock - Fill in delay slots for the given basic block.
493 /// We assume there is only one delay slot per delayed instruction.
494 bool Filler::runOnMachineBasicBlock(MachineBasicBlock &MBB) {
495 bool Changed = false;
497 for (Iter I = MBB.begin(); I != MBB.end(); ++I) {
498 if (!hasUnoccupiedSlot(&*I))
504 // Delay slot filling is disabled at -O0.
505 if (!DisableDelaySlotFiller && (TM.getOptLevel() != CodeGenOpt::None)) {
506 if (searchBackward(MBB, I))
509 if (I->isTerminator()) {
510 if (searchSuccBBs(MBB, I))
512 } else if (searchForward(MBB, I)) {
517 // Bundle the NOP to the instruction with the delay slot.
518 const MipsInstrInfo *TII =
519 static_cast<const MipsInstrInfo*>(TM.getInstrInfo());
520 BuildMI(MBB, std::next(I), I->getDebugLoc(), TII->get(Mips::NOP));
521 MIBundleBuilder(MBB, I, std::next(I, 2));
527 /// createMipsDelaySlotFillerPass - Returns a pass that fills in delay
528 /// slots in Mips MachineFunctions
529 FunctionPass *llvm::createMipsDelaySlotFillerPass(MipsTargetMachine &tm) {
530 return new Filler(tm);
533 template<typename IterTy>
534 bool Filler::searchRange(MachineBasicBlock &MBB, IterTy Begin, IterTy End,
535 RegDefsUses &RegDU, InspectMemInstr& IM,
536 IterTy &Filler) const {
537 for (IterTy I = Begin; I != End; ++I) {
539 if (I->isDebugValue())
542 if (terminateSearch(*I))
545 assert((!I->isCall() && !I->isReturn() && !I->isBranch()) &&
546 "Cannot put calls, returns or branches in delay slot.");
548 if (delayHasHazard(*I, RegDU, IM))
551 if (TM.getSubtarget<MipsSubtarget>().isTargetNaCl()) {
552 // In NaCl, instructions that must be masked are forbidden in delay slots.
553 // We only check for loads, stores and SP changes. Calls, returns and
554 // branches are not checked because non-NaCl targets never put them in
557 if ((isBasePlusOffsetMemoryAccess(I->getOpcode(), &AddrIdx)
558 && baseRegNeedsLoadStoreMask(I->getOperand(AddrIdx).getReg()))
559 || I->modifiesRegister(Mips::SP, TM.getRegisterInfo()))
570 bool Filler::searchBackward(MachineBasicBlock &MBB, Iter Slot) const {
571 if (DisableBackwardSearch)
574 RegDefsUses RegDU(TM);
575 MemDefsUses MemDU(MBB.getParent()->getFrameInfo());
580 if (!searchRange(MBB, ReverseIter(Slot), MBB.rend(), RegDU, MemDU, Filler))
583 MBB.splice(std::next(Slot), &MBB, std::next(Filler).base());
584 MIBundleBuilder(MBB, Slot, std::next(Slot, 2));
589 bool Filler::searchForward(MachineBasicBlock &MBB, Iter Slot) const {
590 // Can handle only calls.
591 if (DisableForwardSearch || !Slot->isCall())
594 RegDefsUses RegDU(TM);
598 RegDU.setCallerSaved(*Slot);
600 if (!searchRange(MBB, std::next(Slot), MBB.end(), RegDU, NM, Filler))
603 MBB.splice(std::next(Slot), &MBB, Filler);
604 MIBundleBuilder(MBB, Slot, std::next(Slot, 2));
609 bool Filler::searchSuccBBs(MachineBasicBlock &MBB, Iter Slot) const {
610 if (DisableSuccBBSearch)
613 MachineBasicBlock *SuccBB = selectSuccBB(MBB);
618 RegDefsUses RegDU(TM);
619 bool HasMultipleSuccs = false;
621 std::unique_ptr<InspectMemInstr> IM;
624 // Iterate over SuccBB's predecessor list.
625 for (MachineBasicBlock::pred_iterator PI = SuccBB->pred_begin(),
626 PE = SuccBB->pred_end(); PI != PE; ++PI)
627 if (!examinePred(**PI, *SuccBB, RegDU, HasMultipleSuccs, BrMap))
630 // Do not allow moving instructions which have unallocatable register operands
631 // across basic block boundaries.
632 RegDU.setUnallocatableRegs(*MBB.getParent());
634 // Only allow moving loads from stack or constants if any of the SuccBB's
635 // predecessors have multiple successors.
636 if (HasMultipleSuccs) {
637 IM.reset(new LoadFromStackOrConst());
639 const MachineFrameInfo *MFI = MBB.getParent()->getFrameInfo();
640 IM.reset(new MemDefsUses(MFI));
643 if (!searchRange(MBB, SuccBB->begin(), SuccBB->end(), RegDU, *IM, Filler))
646 insertDelayFiller(Filler, BrMap);
647 addLiveInRegs(Filler, *SuccBB);
648 Filler->eraseFromParent();
653 MachineBasicBlock *Filler::selectSuccBB(MachineBasicBlock &B) const {
657 // Select the successor with the larget edge weight.
658 auto &Prob = getAnalysis<MachineBranchProbabilityInfo>();
659 MachineBasicBlock *S = *std::max_element(B.succ_begin(), B.succ_end(),
660 [&](const MachineBasicBlock *Dst0,
661 const MachineBasicBlock *Dst1) {
662 return Prob.getEdgeWeight(&B, Dst0) < Prob.getEdgeWeight(&B, Dst1);
664 return S->isLandingPad() ? nullptr : S;
667 std::pair<MipsInstrInfo::BranchType, MachineInstr *>
668 Filler::getBranch(MachineBasicBlock &MBB, const MachineBasicBlock &Dst) const {
669 const MipsInstrInfo *TII =
670 static_cast<const MipsInstrInfo*>(TM.getInstrInfo());
671 MachineBasicBlock *TrueBB = nullptr, *FalseBB = nullptr;
672 SmallVector<MachineInstr*, 2> BranchInstrs;
673 SmallVector<MachineOperand, 2> Cond;
675 MipsInstrInfo::BranchType R =
676 TII->AnalyzeBranch(MBB, TrueBB, FalseBB, Cond, false, BranchInstrs);
678 if ((R == MipsInstrInfo::BT_None) || (R == MipsInstrInfo::BT_NoBranch))
679 return std::make_pair(R, nullptr);
681 if (R != MipsInstrInfo::BT_CondUncond) {
682 if (!hasUnoccupiedSlot(BranchInstrs[0]))
683 return std::make_pair(MipsInstrInfo::BT_None, nullptr);
685 assert(((R != MipsInstrInfo::BT_Uncond) || (TrueBB == &Dst)));
687 return std::make_pair(R, BranchInstrs[0]);
690 assert((TrueBB == &Dst) || (FalseBB == &Dst));
692 // Examine the conditional branch. See if its slot is occupied.
693 if (hasUnoccupiedSlot(BranchInstrs[0]))
694 return std::make_pair(MipsInstrInfo::BT_Cond, BranchInstrs[0]);
696 // If that fails, try the unconditional branch.
697 if (hasUnoccupiedSlot(BranchInstrs[1]) && (FalseBB == &Dst))
698 return std::make_pair(MipsInstrInfo::BT_Uncond, BranchInstrs[1]);
700 return std::make_pair(MipsInstrInfo::BT_None, nullptr);
703 bool Filler::examinePred(MachineBasicBlock &Pred, const MachineBasicBlock &Succ,
704 RegDefsUses &RegDU, bool &HasMultipleSuccs,
705 BB2BrMap &BrMap) const {
706 std::pair<MipsInstrInfo::BranchType, MachineInstr *> P =
707 getBranch(Pred, Succ);
709 // Return if either getBranch wasn't able to analyze the branches or there
710 // were no branches with unoccupied slots.
711 if (P.first == MipsInstrInfo::BT_None)
714 if ((P.first != MipsInstrInfo::BT_Uncond) &&
715 (P.first != MipsInstrInfo::BT_NoBranch)) {
716 HasMultipleSuccs = true;
717 RegDU.addLiveOut(Pred, Succ);
720 BrMap[&Pred] = P.second;
724 bool Filler::delayHasHazard(const MachineInstr &Candidate, RegDefsUses &RegDU,
725 InspectMemInstr &IM) const {
726 bool HasHazard = (Candidate.isImplicitDef() || Candidate.isKill());
728 HasHazard |= IM.hasHazard(Candidate);
729 HasHazard |= RegDU.update(Candidate, 0, Candidate.getNumOperands());
734 bool Filler::terminateSearch(const MachineInstr &Candidate) const {
735 return (Candidate.isTerminator() || Candidate.isCall() ||
736 Candidate.isPosition() || Candidate.isInlineAsm() ||
737 Candidate.hasUnmodeledSideEffects());