Delete dead code and add asserts instead; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287214 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Sanjoy Das 2016-11-17 07:29:43 +00:00
parent 74292e46d4
commit eaec8b3b2a

View File

@ -266,15 +266,11 @@ bool HazardDetector::isSafeToHoist(MachineInstr *MI,
return true; return true;
if (MO.isUse()) if (MO.isUse())
return false; 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!"); "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) for (unsigned Reg : RegUses)
if (TRI.regsOverlap(Reg, MO.getReg())) if (TRI.regsOverlap(Reg, MO.getReg()))
return false; // We found a write-after-read return false; // We found a write-after-read