Fix a subtle issue introduced my my recent changes to MachineRegisterInfo iterators.
authorOwen Anderson <resistor@mac.com>
Thu, 13 Mar 2014 21:25:10 +0000 (21:25 +0000)
committerOwen Anderson <resistor@mac.com>
Thu, 13 Mar 2014 21:25:10 +0000 (21:25 +0000)
When initializing an iterator, we may have to step forward to find the first
operand that passes the current filter set.  When doing that stepping, we should
always step one operand at a time, even if this is by-instr or by-bundle iterator,
as we're stepping between invalid values, so the stride doesn't make sense there.

Fixes a miscompilation of YASM on Win32 reported by Hans Wennborg.  I have not
yet figured out how to reduce it to something testcase-able, because it's sensitive
to the details of how the registers get spilled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203852 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineRegisterInfo.h

index 01fa00fe24106e9f3dc953e15bd8c19ca21d9e80..7167595ec7ddf2cebe5a747ed697086c1379a84f 100644 (file)
@@ -677,7 +677,7 @@ public:
         if ((!ReturnUses && op->isUse()) ||
             (!ReturnDefs && op->isDef()) ||
             (SkipDebug && op->isDebug()))
-          ++*this;
+          advance();
       }
     }
     friend class MachineRegisterInfo;