AMDGPU: Remove dead code
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 1 Oct 2015 21:51:57 +0000 (21:51 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 1 Oct 2015 21:51:57 +0000 (21:51 +0000)
There's no point in checking VReg_1 because all uses
of it should already have been removed by SILowerI1Copies.

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

lib/Target/AMDGPU/SIFixSGPRCopies.cpp

index 31051ddc7025cdc0e0743a7199a9fdbcfd1a0ac6..448cf91e3c2a073d6e133dbfd3728199a84b62e5 100644 (file)
@@ -193,15 +193,12 @@ bool SIFixSGPRCopies::isVGPRToSGPRCopy(const MachineInstr &Copy,
     return false;
   }
 
-  const TargetRegisterClass *DstRC = MRI.getRegClass(DstReg);
-
-  const TargetRegisterClass *SrcRC;
-
-  if (!TargetRegisterInfo::isVirtualRegister(SrcReg) ||
-      MRI.getRegClass(SrcReg) == &AMDGPU::VReg_1RegClass)
+  if (!TargetRegisterInfo::isVirtualRegister(SrcReg))
     return false;
 
-  SrcRC = TRI->getSubRegClass(MRI.getRegClass(SrcReg), SrcSubReg);
+  const TargetRegisterClass *DstRC = MRI.getRegClass(DstReg);
+  const TargetRegisterClass *SrcRC
+    = TRI->getSubRegClass(MRI.getRegClass(SrcReg), SrcSubReg);
   return TRI->isSGPRClass(DstRC) && TRI->hasVGPRs(SrcRC);
 }