[llvm] r287934 - Revert "AMDGPU: Fix adding extra implicit def of register"

Marek Olsak via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 25 08:03:22 PST 2016


Author: mareko
Date: Fri Nov 25 10:03:22 2016
New Revision: 287934

URL: http://llvm.org/viewvc/llvm-project?rev=287934&view=rev
Log:
Revert "AMDGPU: Fix adding extra implicit def of register"

This reverts commit e834ce5976567575621901fb967b8018b9916d71.

Modified:
    llvm/trunk/lib/Target/AMDGPU/SIRegisterInfo.cpp

Modified: llvm/trunk/lib/Target/AMDGPU/SIRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIRegisterInfo.cpp?rev=287934&r1=287933&r2=287934&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIRegisterInfo.cpp Fri Nov 25 10:03:22 2016
@@ -486,7 +486,7 @@ void SIRegisterInfo::buildSpillLoadStore
       = MF->getMachineMemOperand(PInfo, MMO->getFlags(),
                                  EltSize, MinAlign(Align, EltSize * i));
 
-    auto MIB = BuildMI(*MBB, MI, DL, Desc)
+    BuildMI(*MBB, MI, DL, Desc)
       .addReg(SubReg, getDefRegState(!IsStore))
       .addReg(ScratchRsrcReg)
       .addReg(SOffset, SOffsetRegState)
@@ -494,10 +494,8 @@ void SIRegisterInfo::buildSpillLoadStore
       .addImm(0) // glc
       .addImm(0) // slc
       .addImm(0) // tfe
-      .addMemOperand(NewMMO);
-
-    if (NumSubRegs > 1)
-      MIB.addReg(ValueReg, RegState::Implicit | SrcDstRegState);
+      .addMemOperand(NewMMO)
+      .addReg(ValueReg, RegState::Implicit | SrcDstRegState);
   }
 
   if (RanOutOfSGPRs) {
@@ -701,15 +699,12 @@ void SIRegisterInfo::restoreSGPR(Machine
           .addReg(MFI->getScratchWaveOffsetReg());
       }
 
-      auto MIB =
-        BuildMI(*MBB, MI, DL, TII->get(AMDGPU::S_BUFFER_LOAD_DWORD_SGPR), SubReg)
+      BuildMI(*MBB, MI, DL, TII->get(AMDGPU::S_BUFFER_LOAD_DWORD_SGPR), SubReg)
         .addReg(MFI->getScratchRSrcReg()) // sbase
         .addReg(OffsetReg)                // soff
         .addImm(0)                        // glc
-        .addMemOperand(MMO);
-
-      if (NumSubRegs > 1)
-        MIB.addReg(MI->getOperand(0).getReg(), RegState::ImplicitDefine);
+        .addMemOperand(MMO)
+        .addReg(MI->getOperand(0).getReg(), RegState::ImplicitDefine);
 
       continue;
     }
@@ -718,14 +713,12 @@ void SIRegisterInfo::restoreSGPR(Machine
       = MFI->getSpilledReg(MF, Index, i);
 
     if (Spill.hasReg()) {
-      auto MIB =
-        BuildMI(*MBB, MI, DL, TII->getMCOpcodeFromPseudo(AMDGPU::V_READLANE_B32),
-                SubReg)
+      BuildMI(*MBB, MI, DL,
+              TII->getMCOpcodeFromPseudo(AMDGPU::V_READLANE_B32),
+              SubReg)
         .addReg(Spill.VGPR)
-        .addImm(Spill.Lane);
-
-      if (NumSubRegs > 1)
-        MIB.addReg(MI->getOperand(0).getReg(), RegState::ImplicitDefine);
+        .addImm(Spill.Lane)
+        .addReg(MI->getOperand(0).getReg(), RegState::ImplicitDefine);
     } else {
       // Restore SGPR from a stack slot.
       // FIXME: We should use S_LOAD_DWORD here for VI.
@@ -745,13 +738,9 @@ void SIRegisterInfo::restoreSGPR(Machine
         .addReg(MFI->getScratchWaveOffsetReg()) // soffset
         .addImm(i * 4)                          // offset
         .addMemOperand(MMO);
-
-      auto MIB =
-        BuildMI(*MBB, MI, DL, TII->get(AMDGPU::V_READFIRSTLANE_B32), SubReg)
-        .addReg(TmpReg, RegState::Kill);
-
-      if (NumSubRegs > 1)
-        MIB.addReg(MI->getOperand(0).getReg(), RegState::ImplicitDefine);
+      BuildMI(*MBB, MI, DL, TII->get(AMDGPU::V_READFIRSTLANE_B32), SubReg)
+        .addReg(TmpReg, RegState::Kill)
+        .addReg(MI->getOperand(0).getReg(), RegState::ImplicitDefine);
     }
   }
 




More information about the llvm-commits mailing list