summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp
index 2bb987ff681..9dba15dd8c5 100644
--- a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp
@@ -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) {
OpenPOWER on IntegriCloud