OSDN Git Service

radeonsi: initial WIP SI code
[android-x86/external-mesa.git] / src / gallium / drivers / radeon / SIMachineFunctionInfo.cpp
1 //===-- SIMachineFunctionInfo.cpp - TODO: Add brief description -------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // TODO: Add full description
11 //
12 //===----------------------------------------------------------------------===//
13
14
15 #include "SIMachineFunctionInfo.h"
16 #include "AMDGPU.h"
17 #include "llvm/CodeGen/MachineFunctionPass.h"
18
19 using namespace llvm;
20
21
22 SIMachineFunctionInfo::SIMachineFunctionInfo()
23   : AMDILMachineFunctionInfo(),
24     spi_ps_input_addr(0)
25   { }
26
27 SIMachineFunctionInfo::SIMachineFunctionInfo(MachineFunction &MF)
28   : AMDILMachineFunctionInfo(MF),
29     spi_ps_input_addr(0)
30   { }
31
32
33 namespace {
34   class SIInitMachineFunctionInfoPass : public MachineFunctionPass {
35
36   private:
37     static char ID;
38     TargetMachine &TM;
39
40   public:
41     SIInitMachineFunctionInfoPass(TargetMachine &tm) :
42       MachineFunctionPass(ID), TM(tm) { }
43     virtual bool runOnMachineFunction(MachineFunction &MF);
44   };
45 } // End anonymous namespace
46
47 char SIInitMachineFunctionInfoPass::ID = 0;
48
49 FunctionPass *llvm::createSIInitMachineFunctionInfoPass(TargetMachine &tm) {
50   return new SIInitMachineFunctionInfoPass(tm);
51 }
52
53 /* A MachineFunction's MachineFunctionInfo is initialized in the first call to
54  * getInfo().  We need to intialize it as an SIMachineFunctionInfo object
55  * before any of the AMDIL passes otherwise it will be an
56  * AMDILMachineFunctionInfo object and we won't be able to use it.
57  */
58 bool SIInitMachineFunctionInfoPass::runOnMachineFunction(MachineFunction &MF)
59 {
60   SIMachineFunctionInfo * MFI = MF.getInfo<SIMachineFunctionInfo>();
61   return false;
62 }