R600: Fix an infinite loop when trying to reorganize export/tex vector input
[oota-llvm.git] / lib / Target / R600 / SIFixSGPRCopies.cpp
index b49fda9689c5c7a1db3291f0576e851bde5783db..3370c7955bc75c56dadb0f9ea14953a4d29e762b 100644 (file)
@@ -188,8 +188,7 @@ bool SIFixSGPRCopies::isVGPRToSGPRCopy(const MachineInstr &Copy,
     return false;
 
   SrcRC = inferRegClassFromDef(TRI, MRI, SrcReg, SrcSubReg);
-  return TRI->isSGPRClass(DstRC) &&
-         !TRI->getCommonSubClass(DstRC, SrcRC);
+  return TRI->isSGPRClass(DstRC) && TRI->hasVGPRs(SrcRC);
 }
 
 bool SIFixSGPRCopies::runOnMachineFunction(MachineFunction &MF) {