From 73b56327efd14aeb10218a4983de29aad5d26866 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Mon, 21 Sep 2015 16:27:22 +0000 Subject: [PATCH] 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 --- lib/Target/AMDGPU/SIFixSGPRCopies.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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); -- 2.34.1