From 3c8b8c98b00437a9f93f09db200892d33f91973b Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Fri, 16 Dec 2016 11:10:26 +0000 Subject: [codegen] Add generic functions to skip debug values. Summary: This commits moves skipDebugInstructionsForward and skipDebugInstructionsBackward from lib/CodeGen/IfConversion.cpp to include/llvm/CodeGen/MachineBasicBlock.h and updates some codgen files to use them. This refactoring was suggested in https://reviews.llvm.org/D27688 and I thought it's best to do the refactoring in a separate review, but I could also put both changes in a single review if that's preferred. Also, the names for the functions aren't the snappiest and I would be happy to rename them if anybody has suggestions. Reviewers: eli.friedman, iteratee, aprantl, MatzeB Subscribers: MatzeB, llvm-commits Differential Revision: https://reviews.llvm.org/D27782 llvm-svn: 289933 --- llvm/lib/CodeGen/MachineCSE.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/MachineCSE.cpp') diff --git a/llvm/lib/CodeGen/MachineCSE.cpp b/llvm/lib/CodeGen/MachineCSE.cpp index 3299a575114..0766f465456 100644 --- a/llvm/lib/CodeGen/MachineCSE.cpp +++ b/llvm/lib/CodeGen/MachineCSE.cpp @@ -177,8 +177,7 @@ MachineCSE::isPhysDefTriviallyDead(unsigned Reg, unsigned LookAheadLeft = LookAheadLimit; while (LookAheadLeft) { // Skip over dbg_value's. - while (I != E && I->isDebugValue()) - ++I; + I = skipDebugInstructionsForward(I, E); if (I == E) // Reached end of block, register is obviously dead. -- cgit v1.2.3