From 6178878323061281473ad1827b1e666ab3faadcf Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault@amd.com>
Date: Wed, 11 Nov 2015 00:01:36 +0000
Subject: [PATCH] AMDGPU: Remove dead code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252675 91177308-0d34-0410-b5e6-96231b3b80d8
---
 lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp | 35 ++----------------------
 1 file changed, 2 insertions(+), 33 deletions(-)

diff --git a/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp b/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
index ed63f4dc6f9..04a0c1d06af 100644
--- a/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
+++ b/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
@@ -285,22 +285,7 @@ SDNode *AMDGPUDAGToDAGISel::glueCopyToM0(SDNode *N) const {
   return N;
 }
 
-static unsigned selectVectorRegClassID(unsigned NumVectorElts, bool UseVGPR) {
-  if (UseVGPR) {
-    switch (NumVectorElts) {
-    case 1:
-      return AMDGPU::VGPR_32RegClassID;
-    case 2:
-      return AMDGPU::VReg_64RegClassID;
-    case 4:
-      return AMDGPU::VReg_128RegClassID;
-    case 8:
-      return AMDGPU::VReg_256RegClassID;
-    case 16:
-      return AMDGPU::VReg_512RegClassID;
-    }
-  }
-
+static unsigned selectSGPRVectorRegClassID(unsigned NumVectorElts) {
   switch (NumVectorElts) {
   case 1:
     return AMDGPU::SReg_32RegClassID;
@@ -350,23 +335,7 @@ SDNode *AMDGPUDAGToDAGISel::Select(SDNode *N) {
     EVT EltVT = VT.getVectorElementType();
     assert(EltVT.bitsEq(MVT::i32));
     if (Subtarget->getGeneration() >= AMDGPUSubtarget::SOUTHERN_ISLANDS) {
-      bool UseVReg = false;
-
-      for (SDNode::use_iterator U = N->use_begin(), E = SDNode::use_end();
-                                                    U != E; ++U) {
-        if (!U->isMachineOpcode()) {
-          continue;
-        }
-        const TargetRegisterClass *RC = getOperandRegClass(*U, U.getOperandNo());
-        if (!RC) {
-          continue;
-        }
-        if (static_cast<const SIRegisterInfo *>(TRI)->isSGPRClass(RC)) {
-          UseVReg = false;
-        }
-      }
-
-      RegClassID = selectVectorRegClassID(NumVectorElts, UseVReg);
+      RegClassID = selectSGPRVectorRegClassID(NumVectorElts);
     } else {
       // BUILD_VECTOR was lowered into an IMPLICIT_DEF + 4 INSERT_SUBREG
       // that adds a 128 bits reg copy when going through TwoAddressInstructions
-- 
2.34.1