forked from OSchip/llvm-project
Delete dead code and add asserts instead; NFC
llvm-svn: 287214
This commit is contained in:
parent
4a8fe09040
commit
43ccb38bb5
|
@ -266,15 +266,11 @@ bool HazardDetector::isSafeToHoist(MachineInstr *MI,
|
|||
return true;
|
||||
if (MO.isUse())
|
||||
return false;
|
||||
assert((!MO.isDef() || RegDefs.count(MO.getReg())) &&
|
||||
assert(MO.isDef() &&
|
||||
"Register MachineOperands must either be uses or be defs.");
|
||||
assert(RegDefs.count(MO.getReg()) &&
|
||||
"All defs must be tracked in RegDefs by now!");
|
||||
|
||||
if (!MO.isDef()) {
|
||||
// FIXME: This is unnecessary, we should be able to
|
||||
// assert(MO.isDef()) here.
|
||||
return true;
|
||||
}
|
||||
|
||||
for (unsigned Reg : RegUses)
|
||||
if (TRI.regsOverlap(Reg, MO.getReg()))
|
||||
return false; // We found a write-after-read
|
||||
|
|
Loading…
Reference in New Issue