radeon/llvm: Remove AMDGPUUtil.cpp
authorTom Stellard <thomas.stellard@amd.com>
Thu, 26 Jul 2012 19:20:14 +0000 (19:20 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Wed, 15 Aug 2012 18:35:26 +0000 (18:35 +0000)
src/gallium/drivers/radeon/AMDGPUISelLowering.cpp
src/gallium/drivers/radeon/AMDGPUUtil.cpp [deleted file]
src/gallium/drivers/radeon/AMDGPUUtil.h [deleted file]
src/gallium/drivers/radeon/Makefile.sources
src/gallium/drivers/radeon/R600ISelLowering.cpp
src/gallium/drivers/radeon/SIAssignInterpRegs.cpp
src/gallium/drivers/radeon/SICodeEmitter.cpp
src/gallium/drivers/radeon/SIRegisterInfo.cpp

index e22df8efb0efdbe4f6fee82f38b83fa89fa98e9c..0a70164fcbf73aff5d620e31d25a4942c0f4889d 100644 (file)
 
 #include "AMDGPUISelLowering.h"
 #include "AMDILIntrinsicInfo.h"
-#include "AMDGPUUtil.h"
-#include "llvm/CodeGen/SelectionDAG.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineRegisterInfo.h"
+#include "llvm/CodeGen/SelectionDAG.h"
 #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
 
 using namespace llvm;
diff --git a/src/gallium/drivers/radeon/AMDGPUUtil.cpp b/src/gallium/drivers/radeon/AMDGPUUtil.cpp
deleted file mode 100644 (file)
index 4bbb5e0..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-//===-- AMDGPUUtil.cpp - AMDGPU Utility functions -------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Common utility functions used by hw codegen targets
-//
-//===----------------------------------------------------------------------===//
-
-#include "AMDGPUUtil.h"
-#include "AMDGPUInstrInfo.h"
-#include "AMDGPURegisterInfo.h"
-#include "AMDIL.h"
-#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetRegisterInfo.h"
-
-using namespace llvm;
-
-void AMDGPU::utilAddLiveIn(MachineFunction * MF,
-                           MachineRegisterInfo & MRI,
-                           const TargetInstrInfo * TII,
-                           unsigned physReg, unsigned virtReg)
-{
-    if (!MRI.isLiveIn(physReg)) {
-      MRI.addLiveIn(physReg, virtReg);
-      MF->front().addLiveIn(physReg);
-      BuildMI(MF->front(), MF->front().begin(), DebugLoc(),
-              TII->get(TargetOpcode::COPY), virtReg)
-                .addReg(physReg);
-    } else {
-      MRI.replaceRegWith(virtReg, MRI.getLiveInVirtReg(physReg));
-    }
-}
diff --git a/src/gallium/drivers/radeon/AMDGPUUtil.h b/src/gallium/drivers/radeon/AMDGPUUtil.h
deleted file mode 100644 (file)
index 5ae95e7..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-//===-- AMDGPUUtil.h - AMDGPU Utility function declarations -----*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Declarations for utility functions common to all hw codegen targets.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef AMDGPU_UTIL_H
-#define AMDGPU_UTIL_H
-
-namespace llvm {
-
-class MachineFunction;
-class MachineRegisterInfo;
-class TargetInstrInfo;
-
-namespace AMDGPU {
-
-void utilAddLiveIn(MachineFunction * MF, MachineRegisterInfo & MRI,
-    const TargetInstrInfo * TII, unsigned physReg, unsigned virtReg);
-
-} // End namespace AMDGPU
-
-} // End namespace llvm
-
-#endif // AMDGPU_UTIL_H
index 5e0d415cfb38fef2610e456c4d390d8c8548b6c3..3a75ce96945c003e1fa5803e83f4fd9d52ab1a63 100644 (file)
@@ -34,7 +34,6 @@ CPP_SOURCES := \
        AMDGPUConvertToISA.cpp          \
        AMDGPUInstrInfo.cpp             \
        AMDGPURegisterInfo.cpp          \
-       AMDGPUUtil.cpp                  \
        R600CodeEmitter.cpp             \
        R600ISelLowering.cpp            \
        R600InstrInfo.cpp               \
index bfc9227db7b04ff22869f50d57006dd56cfca8bf..f33d90e4fd430bc79bcbde5b0ec822d08e1d5615 100644 (file)
@@ -13,7 +13,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "R600ISelLowering.h"
-#include "AMDGPUUtil.h"
 #include "R600InstrInfo.h"
 #include "R600MachineFunctionInfo.h"
 #include "llvm/CodeGen/MachineInstrBuilder.h"
index 817a10120d2ba838c8eb6fb2d3f8881bb1ad7864..79e099badd4aa873962266cbdd54c5162ae50ad8 100644 (file)
 
 
 #include "AMDGPU.h"
-#include "AMDGPUUtil.h"
 #include "AMDIL.h"
 #include "SIMachineFunctionInfo.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
+#include "llvm/CodeGen/MachineInstrBuilder.h"
 #include "llvm/CodeGen/MachineRegisterInfo.h"
 
 using namespace llvm;
@@ -35,6 +35,9 @@ private:
   static char ID;
   TargetMachine &TM;
 
+  void AddLiveIn(MachineFunction * MF,  MachineRegisterInfo & MRI,
+                 unsigned physReg, unsigned virtReg);
+
 public:
   SIAssignInterpRegsPass(TargetMachine &tm) :
     MachineFunctionPass(ID), TM(tm) { }
@@ -109,9 +112,25 @@ bool SIAssignInterpRegsPass::runOnMachineFunction(MachineFunction &MF)
       unsigned new_reg = AMDGPU::VReg_32RegisterClass->getRegister(used_vgprs);
       unsigned virt_reg = MRI.createVirtualRegister(AMDGPU::VReg_32RegisterClass);
       MRI.replaceRegWith(InterpUse[interp_idx].regs[reg_idx], virt_reg);
-      AMDGPU::utilAddLiveIn(&MF, MRI, TM.getInstrInfo(), new_reg, virt_reg);
+      AddLiveIn(&MF, MRI, new_reg, virt_reg);
     }
   }
 
   return false;
 }
+
+void SIAssignInterpRegsPass::AddLiveIn(MachineFunction * MF,
+                           MachineRegisterInfo & MRI,
+                           unsigned physReg, unsigned virtReg)
+{
+    const TargetInstrInfo * TII = TM.getInstrInfo();
+    if (!MRI.isLiveIn(physReg)) {
+      MRI.addLiveIn(physReg, virtReg);
+      MF->front().addLiveIn(physReg);
+      BuildMI(MF->front(), MF->front().begin(), DebugLoc(),
+              TII->get(TargetOpcode::COPY), virtReg)
+                .addReg(physReg);
+    } else {
+      MRI.replaceRegWith(virtReg, MRI.getLiveInVirtReg(physReg));
+    }
+}
index fae56f4c968612b8cdcf01a4dc036efcdfa5450c..692a02a4fcd538e41a5af9dd29e926048a2f9f12 100644 (file)
@@ -15,7 +15,6 @@
 
 #include "AMDGPU.h"
 #include "AMDGPUCodeEmitter.h"
-#include "AMDGPUUtil.h"
 #include "SIInstrInfo.h"
 #include "SIMachineFunctionInfo.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
index 0d0e612080e44e178dbd7fb130e00f3ab2f563d4..65e98089c9013a729921351ebb6fafe14d401e07 100644 (file)
@@ -14,7 +14,6 @@
 
 #include "SIRegisterInfo.h"
 #include "AMDGPUTargetMachine.h"
-#include "AMDGPUUtil.h"
 
 using namespace llvm;