R600/SI: Don't assume copies will be coalesced in SIFixSGPRCopies
authorTom Stellard <thomas.stellard@amd.com>
Tue, 4 Feb 2014 17:18:42 +0000 (17:18 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Tue, 4 Feb 2014 17:18:42 +0000 (17:18 +0000)
There is no lit test for this, because it would be too big and
complicated, but it does fix a crash in the Arithm/Absdiff.* OpenCV test.

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

lib/Target/R600/SIFixSGPRCopies.cpp

index 3370c7955bc75c56dadb0f9ea14953a4d29e762b..f0065ea13c5ba363e51f21f36f731dadd97ba071 100644 (file)
@@ -187,7 +187,7 @@ bool SIFixSGPRCopies::isVGPRToSGPRCopy(const MachineInstr &Copy,
       DstRC == &AMDGPU::M0RegRegClass)
     return false;
 
-  SrcRC = inferRegClassFromDef(TRI, MRI, SrcReg, SrcSubReg);
+  SrcRC = TRI->getSubRegClass(MRI.getRegClass(SrcReg), SrcSubReg);
   return TRI->isSGPRClass(DstRC) && TRI->hasVGPRs(SrcRC);
 }