[PPC64LE] Teach swap optimization about the doubleword splat idiom
[oota-llvm.git] / lib / CodeGen / LiveRegMatrix.cpp
index 66709aec77af09285b0fb1a7f8fbb34245e74caa..154ce6fc122b89736b5b91d624d8e589cdb1db01 100644 (file)
@@ -18,8 +18,8 @@
 #include "llvm/CodeGen/MachineRegisterInfo.h"
 #include "llvm/CodeGen/VirtRegMap.h"
 #include "llvm/Support/Debug.h"
-#include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/Format.h"
+#include "llvm/Support/raw_ostream.h"
 #include "llvm/Target/TargetRegisterInfo.h"
 
 using namespace llvm;
@@ -79,10 +79,9 @@ bool foreachUnit(const TargetRegisterInfo *TRI, LiveInterval &VRegInterval,
     for (MCRegUnitMaskIterator Units(PhysReg, TRI); Units.isValid(); ++Units) {
       unsigned Unit = (*Units).first;
       unsigned Mask = (*Units).second;
-      for (LiveInterval::subrange_iterator S = VRegInterval.subrange_begin(),
-           SE = VRegInterval.subrange_end(); S != SE; ++S) {
-        if (S->LaneMask & Mask) {
-          if (Func(Unit, *S))
+      for (LiveInterval::SubRange &S : VRegInterval.subranges()) {
+        if (S.LaneMask & Mask) {
+          if (Func(Unit, S))
             return true;
           break;
         }