From: Matt Arsenault <Matthew.Arsenault@amd.com>
Date: Mon, 21 Sep 2015 16:27:22 +0000 (+0000)
Subject: AMDGPU: Move copy handling under switch like other instructions
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=73b56327efd14aeb10218a4983de29aad5d26866;p=oota-llvm.git

AMDGPU: Move copy handling under switch like other instructions

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

diff --git a/lib/Target/AMDGPU/SIFixSGPRCopies.cpp b/lib/Target/AMDGPU/SIFixSGPRCopies.cpp
index 1cf520d360e..55899b729c3 100644
--- a/lib/Target/AMDGPU/SIFixSGPRCopies.cpp
+++ b/lib/Target/AMDGPU/SIFixSGPRCopies.cpp
@@ -214,13 +214,18 @@ bool SIFixSGPRCopies::runOnMachineFunction(MachineFunction &MF) {
     for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end();
                                                       I != E; ++I) {
       MachineInstr &MI = *I;
-      if (MI.getOpcode() == AMDGPU::COPY && isVGPRToSGPRCopy(MI, TRI, MRI)) {
-        DEBUG(dbgs() << "Fixing VGPR -> SGPR copy: " << MI);
-        TII->moveToVALU(MI);
-      }
 
       switch (MI.getOpcode()) {
-      default: continue;
+      default:
+        continue;
+      case AMDGPU::COPY: {
+        if (isVGPRToSGPRCopy(MI, TRI, MRI)) {
+          DEBUG(dbgs() << "Fixing VGPR -> SGPR copy: " << MI);
+          TII->moveToVALU(MI);
+        }
+
+        break;
+      }
       case AMDGPU::PHI: {
         DEBUG(dbgs() << "Fixing PHI: " << MI);