]> granicus.if.org Git - llvm/commitdiff
GlobalISel: tidy up def/use test. NFC.
authorTim Northover <tnorthover@apple.com>
Mon, 30 Jan 2017 20:52:37 +0000 (20:52 +0000)
committerTim Northover <tnorthover@apple.com>
Mon, 30 Jan 2017 20:52:37 +0000 (20:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293545 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/GlobalISel/InstructionSelect.cpp

index 2bb987ff681c1adb9013cfdc631eded723591389..9dba15dd8c54061c607b45e624974e52b9d25472 100644 (file)
@@ -142,9 +142,9 @@ bool InstructionSelect::runOnMachineFunction(MachineFunction &MF) {
     unsigned VReg = VRegToType.first;
     auto *RC = MRI.getRegClassOrNull(VReg);
     MachineInstr *MI = nullptr;
-    if (MRI.def_instr_begin(VReg) != MRI.def_instr_end())
+    if (!MRI.def_empty(VReg))
       MI = &*MRI.def_instr_begin(VReg);
-    else if (MRI.use_instr_begin(VReg) != MRI.use_instr_end())
+    else if (!MRI.use_empty(VReg))
       MI = &*MRI.use_instr_begin(VReg);
 
     if (MI && !RC) {