blob: b21951d7f7b22bee1b75686b80a19c5885487d6b [file] [log] [blame]
Chris Lattner035dfbe2002-08-09 20:08:06 +00001//===-- SparcInternals.h ----------------------------------------*- C++ -*-===//
Vikram S. Adve7f37fe52001-11-08 04:55:13 +00002//
Chris Lattner035dfbe2002-08-09 20:08:06 +00003// This file defines stuff that is to be private to the Sparc backend, but is
4// shared among different portions of the backend.
5//
6//===----------------------------------------------------------------------===//
Chris Lattnerc6495ee2001-09-14 03:56:45 +00007
8#ifndef SPARC_INTERNALS_H
9#define SPARC_INTERNALS_H
10
Ruchira Sasanka89fb46b2001-09-18 22:52:44 +000011#include "llvm/Target/TargetMachine.h"
Vikram S. Adve339084b2001-09-18 13:04:24 +000012#include "llvm/Target/MachineSchedInfo.h"
Vikram S. Adve5afff3b2001-11-09 02:15:52 +000013#include "llvm/Target/MachineFrameInfo.h"
14#include "llvm/Target/MachineCacheInfo.h"
Chris Lattner699683c2002-02-04 05:59:25 +000015#include "llvm/Target/MachineRegInfo.h"
Vikram S. Adved55697c2002-09-20 00:52:09 +000016#include "llvm/Target/MachineOptInfo.h"
Chris Lattnerc6495ee2001-09-14 03:56:45 +000017#include "llvm/Type.h"
Chris Lattner46cbff62001-09-14 16:56:32 +000018#include <sys/types.h>
Chris Lattnerc6495ee2001-09-14 03:56:45 +000019
Chris Lattner4387e312002-02-03 23:42:19 +000020class LiveRange;
Chris Lattnerf6e0e282001-09-14 04:32:55 +000021class UltraSparc;
Chris Lattner4387e312002-02-03 23:42:19 +000022class PhyRegAlloc;
Chris Lattner9aa697b2002-04-09 05:16:36 +000023class Pass;
Chris Lattner4387e312002-02-03 23:42:19 +000024
Chris Lattnerc6495ee2001-09-14 03:56:45 +000025// OpCodeMask definitions for the Sparc V9
26//
27const OpCodeMask Immed = 0x00002000; // immed or reg operand?
28const OpCodeMask Annul = 0x20000000; // annul delay instr?
29const OpCodeMask PredictTaken = 0x00080000; // predict branch taken?
30
31
32enum SparcInstrSchedClass {
33 SPARC_NONE, /* Instructions with no scheduling restrictions */
34 SPARC_IEUN, /* Integer class that can use IEU0 or IEU1 */
35 SPARC_IEU0, /* Integer class IEU0 */
36 SPARC_IEU1, /* Integer class IEU1 */
37 SPARC_FPM, /* FP Multiply or Divide instructions */
38 SPARC_FPA, /* All other FP instructions */
39 SPARC_CTI, /* Control-transfer instructions */
40 SPARC_LD, /* Load instructions */
41 SPARC_ST, /* Store instructions */
42 SPARC_SINGLE, /* Instructions that must issue by themselves */
43
44 SPARC_INV, /* This should stay at the end for the next value */
45 SPARC_NUM_SCHED_CLASSES = SPARC_INV
46};
47
Chris Lattnerc6495ee2001-09-14 03:56:45 +000048
49//---------------------------------------------------------------------------
50// enum SparcMachineOpCode.
51// const MachineInstrDescriptor SparcMachineInstrDesc[]
52//
53// Purpose:
54// Description of UltraSparc machine instructions.
55//
56//---------------------------------------------------------------------------
57
Chris Lattnerc6495ee2001-09-14 03:56:45 +000058enum SparcMachineOpCode {
Chris Lattner9a3d63b2001-09-19 15:56:23 +000059#define I(ENUM, OPCODESTRING, NUMOPERANDS, RESULTPOS, MAXIMM, IMMSE, \
60 NUMDELAYSLOTS, LATENCY, SCHEDCLASS, INSTFLAGS) \
61 ENUM,
62#include "SparcInstr.def"
Chris Lattnerc6495ee2001-09-14 03:56:45 +000063
Chris Lattnerc6495ee2001-09-14 03:56:45 +000064 // End-of-array marker
65 INVALID_OPCODE,
Vikram S. Advec1521632001-10-22 13:31:53 +000066 NUM_REAL_OPCODES = PHI, // number of valid opcodes
Chris Lattnerc6495ee2001-09-14 03:56:45 +000067 NUM_TOTAL_OPCODES = INVALID_OPCODE
68};
69
Chris Lattnerc6495ee2001-09-14 03:56:45 +000070
Chris Lattner9a3d63b2001-09-19 15:56:23 +000071// Array of machine instruction descriptions...
72extern const MachineInstrDescriptor SparcMachineInstrDesc[];
Chris Lattnerc6495ee2001-09-14 03:56:45 +000073
74
75//---------------------------------------------------------------------------
76// class UltraSparcInstrInfo
77//
78// Purpose:
79// Information about individual instructions.
80// Most information is stored in the SparcMachineInstrDesc array above.
81// Other information is computed on demand, and most such functions
82// default to member functions in base class MachineInstrInfo.
83//---------------------------------------------------------------------------
84
Chris Lattner035dfbe2002-08-09 20:08:06 +000085struct UltraSparcInstrInfo : public MachineInstrInfo {
86 UltraSparcInstrInfo(const TargetMachine& tgt);
Vikram S. Adve4c5fe2d2001-11-14 18:48:36 +000087
88 //
Vikram S. Advedd558992002-03-18 03:02:42 +000089 // All immediate constants are in position 1 except the
Vikram S. Advee1f72802002-09-16 15:39:26 +000090 // store instructions and SETxx.
Vikram S. Adve4c5fe2d2001-11-14 18:48:36 +000091 //
Vikram S. Advedd558992002-03-18 03:02:42 +000092 virtual int getImmedConstantPos(MachineOpCode opCode) const {
Vikram S. Adve4c5fe2d2001-11-14 18:48:36 +000093 bool ignore;
94 if (this->maxImmedConstant(opCode, ignore) != 0)
95 {
Vikram S. Advefe09fb22002-07-08 23:34:10 +000096 assert(! this->isStore((MachineOpCode) STB - 1)); // 1st store opcode
97 assert(! this->isStore((MachineOpCode) STXFSR+1));// last store opcode
Vikram S. Advee1f72802002-09-16 15:39:26 +000098 if (opCode==SETSW || opCode==SETUW || opCode==SETX || opCode==SETHI)
99 return 0;
100 if (opCode >= STB && opCode <= STXFSR)
101 return 2;
102 return 1;
Vikram S. Adve4c5fe2d2001-11-14 18:48:36 +0000103 }
104 else
105 return -1;
106 }
Chris Lattnerc6495ee2001-09-14 03:56:45 +0000107
Vikram S. Adve5684c4e2001-10-18 00:02:06 +0000108 virtual bool hasResultInterlock (MachineOpCode opCode) const
Chris Lattnerc6495ee2001-09-14 03:56:45 +0000109 {
110 // All UltraSPARC instructions have interlocks (note that delay slots
111 // are not considered here).
112 // However, instructions that use the result of an FCMP produce a
113 // 9-cycle stall if they are issued less than 3 cycles after the FCMP.
114 // Force the compiler to insert a software interlock (i.e., gap of
115 // 2 other groups, including NOPs if necessary).
116 return (opCode == FCMPS || opCode == FCMPD || opCode == FCMPQ);
117 }
118
Vikram S. Adve5684c4e2001-10-18 00:02:06 +0000119 //-------------------------------------------------------------------------
Vikram S. Advee1f72802002-09-16 15:39:26 +0000120 // Queries about representation of LLVM quantities (e.g., constants)
121 //-------------------------------------------------------------------------
122
123 virtual bool ConstantMayNotFitInImmedField(const Constant* CV,
124 const Instruction* I) const;
125
126 //-------------------------------------------------------------------------
Vikram S. Adve5684c4e2001-10-18 00:02:06 +0000127 // Code generation support for creating individual machine instructions
128 //-------------------------------------------------------------------------
Vikram S. Adved55697c2002-09-20 00:52:09 +0000129
130 // Get certain common op codes for the current target. This and all the
131 // Create* methods below should be moved to a machine code generation class
132 //
133 virtual MachineOpCode getNOPOpCode() const { return NOP; }
134
Vikram S. Adve5684c4e2001-10-18 00:02:06 +0000135 // Create an instruction sequence to put the constant `val' into
Vikram S. Adve242a8082002-05-19 15:25:51 +0000136 // the virtual register `dest'. `val' may be a Constant or a
137 // GlobalValue, viz., the constant address of a global variable or function.
138 // The generated instructions are returned in `mvec'.
139 // Any temp. registers (TmpInstruction) created are recorded in mcfi.
140 // Any stack space required is allocated via mcff.
Vikram S. Adve5684c4e2001-10-18 00:02:06 +0000141 //
Vikram S. Adve242a8082002-05-19 15:25:51 +0000142 virtual void CreateCodeToLoadConst(const TargetMachine& target,
143 Function* F,
Vikram S. Advedd558992002-03-18 03:02:42 +0000144 Value* val,
Vikram S. Adve5684c4e2001-10-18 00:02:06 +0000145 Instruction* dest,
Vikram S. Adve242a8082002-05-19 15:25:51 +0000146 std::vector<MachineInstr*>& mvec,
147 MachineCodeForInstruction& mcfi) const;
Vikram S. Adve7f37fe52001-11-08 04:55:13 +0000148
Vikram S. Adve5afff3b2001-11-09 02:15:52 +0000149 // Create an instruction sequence to copy an integer value `val'
150 // to a floating point value `dest' by copying to memory and back.
151 // val must be an integral type. dest must be a Float or Double.
Vikram S. Adve242a8082002-05-19 15:25:51 +0000152 // The generated instructions are returned in `mvec'.
153 // Any temp. registers (TmpInstruction) created are recorded in mcfi.
154 // Any stack space required is allocated via mcff.
Vikram S. Adve7f37fe52001-11-08 04:55:13 +0000155 //
Vikram S. Adve242a8082002-05-19 15:25:51 +0000156 virtual void CreateCodeToCopyIntToFloat(const TargetMachine& target,
157 Function* F,
158 Value* val,
159 Instruction* dest,
160 std::vector<MachineInstr*>& mvec,
161 MachineCodeForInstruction& mcfi) const;
Vikram S. Adve5afff3b2001-11-09 02:15:52 +0000162
163 // Similarly, create an instruction sequence to copy an FP value
164 // `val' to an integer value `dest' by copying to memory and back.
Vikram S. Adve242a8082002-05-19 15:25:51 +0000165 // The generated instructions are returned in `mvec'.
166 // Any temp. registers (TmpInstruction) created are recorded in mcfi.
167 // Any stack space required is allocated via mcff.
Vikram S. Adve5afff3b2001-11-09 02:15:52 +0000168 //
Vikram S. Adve242a8082002-05-19 15:25:51 +0000169 virtual void CreateCodeToCopyFloatToInt(const TargetMachine& target,
170 Function* F,
171 Value* val,
172 Instruction* dest,
173 std::vector<MachineInstr*>& mvec,
174 MachineCodeForInstruction& mcfi) const;
175
176 // Create instruction(s) to copy src to dest, for arbitrary types
177 // The generated instructions are returned in `mvec'.
178 // Any temp. registers (TmpInstruction) created are recorded in mcfi.
179 // Any stack space required is allocated via mcff.
180 //
Vikram S. Advedd558992002-03-18 03:02:42 +0000181 virtual void CreateCopyInstructionsByType(const TargetMachine& target,
Vikram S. Adve242a8082002-05-19 15:25:51 +0000182 Function* F,
183 Value* src,
184 Instruction* dest,
185 std::vector<MachineInstr*>& mvec,
186 MachineCodeForInstruction& mcfi) const;
187
188 // Create instruction sequence to produce a sign-extended register value
189 // from an arbitrary sized value (sized in bits, not bytes).
Vikram S. Advef36f06b2002-09-05 18:34:31 +0000190 // The generated instructions are appended to `mvec'.
191 // Any temp. registers (TmpInstruction) created are recorded in mcfi.
Vikram S. Adve242a8082002-05-19 15:25:51 +0000192 // Any stack space required is allocated via mcff.
193 //
194 virtual void CreateSignExtensionInstructions(const TargetMachine& target,
195 Function* F,
Vikram S. Advef36f06b2002-09-05 18:34:31 +0000196 Value* srcVal,
Vikram S. Adve5cedede2002-09-27 14:29:45 +0000197 Value* destVal,
198 unsigned int numLowBits,
Vikram S. Advef36f06b2002-09-05 18:34:31 +0000199 std::vector<MachineInstr*>& mvec,
200 MachineCodeForInstruction& mcfi) const;
201
202 // Create instruction sequence to produce a zero-extended register value
203 // from an arbitrary sized value (sized in bits, not bytes).
204 // The generated instructions are appended to `mvec'.
205 // Any temp. registers (TmpInstruction) created are recorded in mcfi.
206 // Any stack space required is allocated via mcff.
207 //
208 virtual void CreateZeroExtensionInstructions(const TargetMachine& target,
209 Function* F,
210 Value* srcVal,
Vikram S. Adve5cedede2002-09-27 14:29:45 +0000211 Value* destVal,
212 unsigned int numLowBits,
Vikram S. Adve242a8082002-05-19 15:25:51 +0000213 std::vector<MachineInstr*>& mvec,
214 MachineCodeForInstruction& mcfi) const;
Chris Lattnerc6495ee2001-09-14 03:56:45 +0000215};
216
Ruchira Sasankae38bd5332001-09-15 00:30:44 +0000217
Ruchira Sasanka20c82b12001-10-28 18:15:12 +0000218//----------------------------------------------------------------------------
219// class UltraSparcRegInfo
220//
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000221// This class implements the virtual class MachineRegInfo for Sparc.
222//
Ruchira Sasanka20c82b12001-10-28 18:15:12 +0000223//----------------------------------------------------------------------------
224
Chris Lattner699683c2002-02-04 05:59:25 +0000225class UltraSparcRegInfo : public MachineRegInfo {
Ruchira Sasankaab304c42001-09-30 23:19:57 +0000226 // The actual register classes in the Sparc
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000227 //
Ruchira Sasankae38bd5332001-09-15 00:30:44 +0000228 enum RegClassIDs {
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000229 IntRegClassID, // Integer
230 FloatRegClassID, // Float (both single/double)
231 IntCCRegClassID, // Int Condition Code
232 FloatCCRegClassID // Float Condition code
Ruchira Sasankae38bd5332001-09-15 00:30:44 +0000233 };
234
Ruchira Sasankaab304c42001-09-30 23:19:57 +0000235
236 // Type of registers available in Sparc. There can be several reg types
237 // in the same class. For instace, the float reg class has Single/Double
238 // types
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000239 //
Ruchira Sasankaab304c42001-09-30 23:19:57 +0000240 enum RegTypes {
241 IntRegType,
242 FPSingleRegType,
243 FPDoubleRegType,
244 IntCCRegType,
245 FloatCCRegType
246 };
247
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000248 // **** WARNING: If the above enum order is changed, also modify
Ruchira Sasankae38bd5332001-09-15 00:30:44 +0000249 // getRegisterClassOfValue method below since it assumes this particular
250 // order for efficiency.
251
Chris Lattnerc6495ee2001-09-14 03:56:45 +0000252
253 // reverse pointer to get info about the ultra sparc machine
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000254 //
Chris Lattnerc6495ee2001-09-14 03:56:45 +0000255 const UltraSparc *const UltraSparcInfo;
256
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000257 // Number of registers used for passing int args (usually 6: %o0 - %o5)
258 //
Chris Lattnerc6495ee2001-09-14 03:56:45 +0000259 unsigned const NumOfIntArgRegs;
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000260
261 // Number of registers used for passing float args (usually 32: %f0 - %f31)
262 //
Chris Lattnerc6495ee2001-09-14 03:56:45 +0000263 unsigned const NumOfFloatArgRegs;
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000264
265 // An out of bound register number that can be used to initialize register
266 // numbers. Useful for error detection.
267 //
Ruchira Sasankac4d4b762001-10-16 01:23:19 +0000268 int const InvalidRegNum;
Ruchira Sasanka20c82b12001-10-28 18:15:12 +0000269
270
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000271 // ======================== Private Methods =============================
Chris Lattnerc6495ee2001-09-14 03:56:45 +0000272
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000273 // The following methods are used to color special live ranges (e.g.
Chris Lattnerf57b8452002-04-27 06:56:12 +0000274 // function args and return values etc.) with specific hardware registers
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000275 // as required. See SparcRegInfo.cpp for the implementation.
276 //
Vikram S. Advefe09fb22002-07-08 23:34:10 +0000277 void suggestReg4RetAddr(MachineInstr *RetMI,
Chris Lattner699683c2002-02-04 05:59:25 +0000278 LiveRangeInfo &LRI) const;
Ruchira Sasankacc3ccac2001-10-15 16:25:28 +0000279
Vikram S. Adve106604e2002-09-28 16:56:59 +0000280 void suggestReg4CallAddr(MachineInstr *CallMI, LiveRangeInfo &LRI) const;
Vikram S. Advefe09fb22002-07-08 23:34:10 +0000281
282 void InitializeOutgoingArg(MachineInstr* CallMI, AddedInstrns *CallAI,
Vikram S. Adve242a8082002-05-19 15:25:51 +0000283 PhyRegAlloc &PRA, LiveRange* LR,
284 unsigned regType, unsigned RegClassID,
285 int UniArgReg, unsigned int argNo,
286 std::vector<MachineInstr *>& AddedInstrnsBefore)
287 const;
288
289 // The following 4 methods are used to find the RegType (see enum above)
Vikram S. Advefe09fb22002-07-08 23:34:10 +0000290 // for a reg class and a given primitive type, a LiveRange, a Value,
291 // or a particular machine register.
292 // The fifth function gives the reg class of the given RegType.
293 //
Vikram S. Adve242a8082002-05-19 15:25:51 +0000294 int getRegType(unsigned regClassID, const Type* type) const;
Chris Lattner699683c2002-02-04 05:59:25 +0000295 int getRegType(const LiveRange *LR) const;
296 int getRegType(const Value *Val) const;
Vikram S. Advefe09fb22002-07-08 23:34:10 +0000297 int getRegType(int unifiedRegNum) const;
Ruchira Sasanka3839e6e2001-11-03 19:59:59 +0000298
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000299 // Used to generate a copy instruction based on the register class of
300 // value.
301 //
Chris Lattner699683c2002-02-04 05:59:25 +0000302 MachineInstr *cpValue2RegMI(Value *Val, unsigned DestReg,
303 int RegType) const;
Ruchira Sasankaae4bcd72001-11-10 21:20:43 +0000304
305
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000306 // The following 2 methods are used to order the instructions addeed by
Chris Lattnerf57b8452002-04-27 06:56:12 +0000307 // the register allocator in association with function calling. See
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000308 // SparcRegInfo.cpp for more details
309 //
Chris Lattner697954c2002-01-20 22:54:45 +0000310 void moveInst2OrdVec(std::vector<MachineInstr *> &OrdVec,
311 MachineInstr *UnordInst,
312 PhyRegAlloc &PRA) const;
Ruchira Sasankaae4bcd72001-11-10 21:20:43 +0000313
Chris Lattner697954c2002-01-20 22:54:45 +0000314 void OrderAddedInstrns(std::vector<MachineInstr *> &UnordVec,
315 std::vector<MachineInstr *> &OrdVec,
316 PhyRegAlloc &PRA) const;
Ruchira Sasankaae4bcd72001-11-10 21:20:43 +0000317
318
Vikram S. Adve6d783112002-04-25 04:40:24 +0000319 // Compute which register can be used for an argument, if any
320 //
321 int regNumForIntArg(bool inCallee, bool isVarArgsCall,
322 unsigned argNo, unsigned intArgNo, unsigned fpArgNo,
323 unsigned& regClassId) const;
Ruchira Sasankaae4bcd72001-11-10 21:20:43 +0000324
Vikram S. Adve6d783112002-04-25 04:40:24 +0000325 int regNumForFPArg(unsigned RegType, bool inCallee, bool isVarArgsCall,
326 unsigned argNo, unsigned intArgNo, unsigned fpArgNo,
327 unsigned& regClassId) const;
328
Chris Lattner699683c2002-02-04 05:59:25 +0000329public:
330 UltraSparcRegInfo(const UltraSparc &tgt);
Ruchira Sasankae38bd5332001-09-15 00:30:44 +0000331
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000332 // To get complete machine information structure using the machine register
333 // information
334 //
Chris Lattner699683c2002-02-04 05:59:25 +0000335 inline const UltraSparc &getUltraSparcInfo() const {
Chris Lattnerc6495ee2001-09-14 03:56:45 +0000336 return *UltraSparcInfo;
337 }
338
Vikram S. Advedd558992002-03-18 03:02:42 +0000339 // To find the register class used for a specified Type
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000340 //
Vikram S. Advefe09fb22002-07-08 23:34:10 +0000341 unsigned getRegClassIDOfType(const Type *type,
342 bool isCCReg = false) const;
Ruchira Sasankae38bd5332001-09-15 00:30:44 +0000343
Vikram S. Advedd558992002-03-18 03:02:42 +0000344 // To find the register class of a Value
345 //
346 inline unsigned getRegClassIDOfValue(const Value *Val,
347 bool isCCReg = false) const {
348 return getRegClassIDOfType(Val->getType(), isCCReg);
349 }
350
Vikram S. Advefe09fb22002-07-08 23:34:10 +0000351 // To find the register class to which a specified register belongs
352 //
353 unsigned getRegClassIDOfReg(int unifiedRegNum) const;
354 unsigned getRegClassIDOfRegType(int regType) const;
Vikram S. Advedd558992002-03-18 03:02:42 +0000355
Chris Lattner699683c2002-02-04 05:59:25 +0000356 // getZeroRegNum - returns the register that contains always zero this is the
357 // unified register number
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000358 //
Chris Lattner699683c2002-02-04 05:59:25 +0000359 virtual int getZeroRegNum() const;
Ruchira Sasanka89fb46b2001-09-18 22:52:44 +0000360
Chris Lattner699683c2002-02-04 05:59:25 +0000361 // getCallAddressReg - returns the reg used for pushing the address when a
Chris Lattnerf57b8452002-04-27 06:56:12 +0000362 // function is called. This can be used for other purposes between calls
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000363 //
Chris Lattner699683c2002-02-04 05:59:25 +0000364 unsigned getCallAddressReg() const;
Ruchira Sasanka89fb46b2001-09-18 22:52:44 +0000365
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000366 // Returns the register containing the return address.
367 // It should be made sure that this register contains the return
368 // value when a return instruction is reached.
369 //
Chris Lattner699683c2002-02-04 05:59:25 +0000370 unsigned getReturnAddressReg() const;
Ruchira Sasanka89fb46b2001-09-18 22:52:44 +0000371
Vikram S. Adve242a8082002-05-19 15:25:51 +0000372 // Number of registers used for passing int args (usually 6: %o0 - %o5)
373 // and float args (usually 32: %f0 - %f31)
374 //
375 unsigned const GetNumOfIntArgRegs() const { return NumOfIntArgRegs; }
376 unsigned const GetNumOfFloatArgRegs() const { return NumOfFloatArgRegs; }
377
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000378 // The following methods are used to color special live ranges (e.g.
Chris Lattnerf57b8452002-04-27 06:56:12 +0000379 // function args and return values etc.) with specific hardware registers
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000380 // as required. See SparcRegInfo.cpp for the implementation for Sparc.
381 //
Chris Lattnerb7653df2002-04-08 22:03:57 +0000382 void suggestRegs4MethodArgs(const Function *Meth,
Ruchira Sasankaab304c42001-09-30 23:19:57 +0000383 LiveRangeInfo& LRI) const;
Chris Lattnerc6495ee2001-09-14 03:56:45 +0000384
Vikram S. Advefe09fb22002-07-08 23:34:10 +0000385 void suggestRegs4CallArgs(MachineInstr *CallMI,
Vikram S. Adve106604e2002-09-28 16:56:59 +0000386 LiveRangeInfo& LRI) const;
Chris Lattnerc6495ee2001-09-14 03:56:45 +0000387
Vikram S. Advefe09fb22002-07-08 23:34:10 +0000388 void suggestReg4RetValue(MachineInstr *RetMI,
Chris Lattner697954c2002-01-20 22:54:45 +0000389 LiveRangeInfo& LRI) const;
Vikram S. Advefe09fb22002-07-08 23:34:10 +0000390
Chris Lattnerb7653df2002-04-08 22:03:57 +0000391 void colorMethodArgs(const Function *Meth, LiveRangeInfo &LRI,
Chris Lattner699683c2002-02-04 05:59:25 +0000392 AddedInstrns *FirstAI) const;
Ruchira Sasankaab304c42001-09-30 23:19:57 +0000393
Vikram S. Advefe09fb22002-07-08 23:34:10 +0000394 void colorCallArgs(MachineInstr *CallMI, LiveRangeInfo &LRI,
Chris Lattner699683c2002-02-04 05:59:25 +0000395 AddedInstrns *CallAI, PhyRegAlloc &PRA,
Ruchira Sasankad00982a2002-01-07 19:20:28 +0000396 const BasicBlock *BB) const;
Ruchira Sasankaab304c42001-09-30 23:19:57 +0000397
Vikram S. Advefe09fb22002-07-08 23:34:10 +0000398 void colorRetValue(MachineInstr *RetI, LiveRangeInfo& LRI,
Chris Lattner699683c2002-02-04 05:59:25 +0000399 AddedInstrns *RetAI) const;
Ruchira Sasankaab304c42001-09-30 23:19:57 +0000400
401
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000402 // method used for printing a register for debugging purposes
403 //
Chris Lattner699683c2002-02-04 05:59:25 +0000404 static void printReg(const LiveRange *LR);
Ruchira Sasanka89fb46b2001-09-18 22:52:44 +0000405
Vikram S. Advefe09fb22002-07-08 23:34:10 +0000406 // Each register class has a seperate space for register IDs. To convert
407 // a regId in a register class to a common Id, or vice versa,
408 // we use the folloing methods.
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000409 //
Vikram S. Advefe09fb22002-07-08 23:34:10 +0000410 // This method provides a unique number for each register
411 inline int getUnifiedRegNum(unsigned regClassID, int reg) const {
412
413 if (regClassID == IntRegClassID) {
414 assert(reg < 32 && "Invalid reg. number");
Chris Lattnerc6495ee2001-09-14 03:56:45 +0000415 return reg;
Vikram S. Advefe09fb22002-07-08 23:34:10 +0000416 }
417 else if (regClassID == FloatRegClassID) {
418 assert(reg < 64 && "Invalid reg. number");
Chris Lattnerc6495ee2001-09-14 03:56:45 +0000419 return reg + 32; // we have 32 int regs
Vikram S. Advefe09fb22002-07-08 23:34:10 +0000420 }
421 else if (regClassID == FloatCCRegClassID) {
422 assert(reg < 4 && "Invalid reg. number");
Chris Lattnerc6495ee2001-09-14 03:56:45 +0000423 return reg + 32 + 64; // 32 int, 64 float
Vikram S. Advefe09fb22002-07-08 23:34:10 +0000424 }
425 else if (regClassID == IntCCRegClassID ) {
426 assert(reg == 0 && "Invalid reg. number");
427 return reg + 4+ 32 + 64; // only one int CC reg
428 }
429 else if (reg==InvalidRegNum) {
Ruchira Sasankac4d4b762001-10-16 01:23:19 +0000430 return InvalidRegNum;
Vikram S. Advefe09fb22002-07-08 23:34:10 +0000431 }
Ruchira Sasankae38bd5332001-09-15 00:30:44 +0000432 else
Vikram S. Advefe09fb22002-07-08 23:34:10 +0000433 assert(0 && "Invalid register class");
Chris Lattner6dad5062001-11-07 13:49:12 +0000434 return 0;
Chris Lattnerc6495ee2001-09-14 03:56:45 +0000435 }
Vikram S. Advefe09fb22002-07-08 23:34:10 +0000436
437 // This method converts the unified number to the number in its class,
438 // and returns the class ID in regClassID.
439 inline int getClassRegNum(int ureg, unsigned& regClassID) const {
440 if (ureg < 32) { regClassID = IntRegClassID; return ureg; }
441 else if (ureg < 32+64) { regClassID = FloatRegClassID; return ureg-32; }
442 else if (ureg < 4 +96) { regClassID = FloatCCRegClassID; return ureg-96; }
443 else if (ureg < 1 +100) { regClassID = IntCCRegClassID; return ureg-100;}
444 else if (ureg == InvalidRegNum) { return InvalidRegNum; }
445 else { assert(0 && "Invalid unified register number"); }
Chris Lattnerb82d97e2002-07-25 06:08:32 +0000446 return 0;
Vikram S. Advefe09fb22002-07-08 23:34:10 +0000447 }
448
449 // Returns the assembly-language name of the specified machine register.
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000450 //
Chris Lattner95685682002-08-12 21:25:05 +0000451 virtual const char * const getUnifiedRegName(int reg) const;
Ruchira Sasankad00982a2002-01-07 19:20:28 +0000452
453
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000454 // returns the # of bytes of stack space allocated for each register
455 // type. For Sparc, currently we allocate 8 bytes on stack for all
456 // register types. We can optimize this later if necessary to save stack
457 // space (However, should make sure that stack alignment is correct)
458 //
Chris Lattner699683c2002-02-04 05:59:25 +0000459 inline int getSpilledRegSize(int RegType) const {
Ruchira Sasankad00982a2002-01-07 19:20:28 +0000460 return 8;
Ruchira Sasankad00982a2002-01-07 19:20:28 +0000461 }
462
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000463
Vikram S. Advea44c6c02002-03-31 19:04:50 +0000464 // To obtain the return value and the indirect call address (if any)
465 // contained in a CALL machine instruction
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000466 //
Ruchira Sasankab3b6f532001-10-21 16:43:41 +0000467 const Value * getCallInstRetVal(const MachineInstr *CallMI) const;
Vikram S. Advea44c6c02002-03-31 19:04:50 +0000468 const Value * getCallInstIndirectAddrVal(const MachineInstr *CallMI) const;
Ruchira Sasankab3b6f532001-10-21 16:43:41 +0000469
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000470 // The following methods are used to generate "copy" machine instructions
471 // for an architecture.
472 //
Vikram S. Advefe09fb22002-07-08 23:34:10 +0000473 // The function regTypeNeedsScratchReg() can be used to check whether a
474 // scratch register is needed to copy a register of type `regType' to
475 // or from memory. If so, such a scratch register can be provided by
476 // the caller (e.g., if it knows which regsiters are free); otherwise
477 // an arbitrary one will be chosen and spilled by the copy instructions.
478 //
479 bool regTypeNeedsScratchReg(int RegType,
480 int& scratchRegClassId) const;
Ruchira Sasankac4d4b762001-10-16 01:23:19 +0000481
Vikram S. Advefe09fb22002-07-08 23:34:10 +0000482 void cpReg2RegMI(std::vector<MachineInstr*>& mvec,
483 unsigned SrcReg, unsigned DestReg,
484 int RegType) const;
485
486 void cpReg2MemMI(std::vector<MachineInstr*>& mvec,
487 unsigned SrcReg, unsigned DestPtrReg,
488 int Offset, int RegType, int scratchReg = -1) const;
489
490 void cpMem2RegMI(std::vector<MachineInstr*>& mvec,
491 unsigned SrcPtrReg, int Offset, unsigned DestReg,
492 int RegType, int scratchReg = -1) const;
Ruchira Sasankac4d4b762001-10-16 01:23:19 +0000493
Vikram S. Adve242a8082002-05-19 15:25:51 +0000494 void cpValue2Value(Value *Src, Value *Dest,
Anand Shuklacfb22d32002-06-25 20:55:50 +0000495 std::vector<MachineInstr*>& mvec) const;
Ruchira Sasankaef1b0cb2001-11-03 17:13:27 +0000496
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000497 // To see whether a register is a volatile (i.e., whehter it must be
498 // preserved acorss calls)
499 //
Chris Lattner699683c2002-02-04 05:59:25 +0000500 inline bool isRegVolatile(int RegClassID, int Reg) const {
501 return MachineRegClassArr[RegClassID]->isRegVolatile(Reg);
Ruchira Sasankac4d4b762001-10-16 01:23:19 +0000502 }
503
504
Chris Lattner699683c2002-02-04 05:59:25 +0000505 virtual unsigned getFramePointer() const;
506 virtual unsigned getStackPointer() const;
Ruchira Sasankac4d4b762001-10-16 01:23:19 +0000507
Chris Lattner699683c2002-02-04 05:59:25 +0000508 virtual int getInvalidRegNum() const {
Ruchira Sasankac4d4b762001-10-16 01:23:19 +0000509 return InvalidRegNum;
510 }
511
Ruchira Sasanka2563a982002-01-07 20:28:49 +0000512 // This method inserts the caller saving code for call instructions
513 //
Anand Shukla24787fa2002-07-11 00:16:28 +0000514 void insertCallerSavingCode(std::vector<MachineInstr*>& instrnsBefore,
515 std::vector<MachineInstr*>& instrnsAfter,
Vikram S. Adve6a49a1e2002-07-10 21:42:42 +0000516 MachineInstr *MInst,
Ruchira Sasanka20c82b12001-10-28 18:15:12 +0000517 const BasicBlock *BB, PhyRegAlloc &PRA ) const;
Chris Lattnerc6495ee2001-09-14 03:56:45 +0000518};
519
520
521
Chris Lattnerc6495ee2001-09-14 03:56:45 +0000522
523//---------------------------------------------------------------------------
524// class UltraSparcSchedInfo
525//
526// Purpose:
527// Interface to instruction scheduling information for UltraSPARC.
528// The parameter values above are based on UltraSPARC IIi.
529//---------------------------------------------------------------------------
530
531
532class UltraSparcSchedInfo: public MachineSchedInfo {
533public:
Chris Lattner699683c2002-02-04 05:59:25 +0000534 UltraSparcSchedInfo(const TargetMachine &tgt);
Chris Lattnerc6495ee2001-09-14 03:56:45 +0000535protected:
Chris Lattner699683c2002-02-04 05:59:25 +0000536 virtual void initializeResources();
Chris Lattnerc6495ee2001-09-14 03:56:45 +0000537};
538
Chris Lattnerf6e0e282001-09-14 04:32:55 +0000539
540//---------------------------------------------------------------------------
Vikram S. Advec1521632001-10-22 13:31:53 +0000541// class UltraSparcFrameInfo
542//
543// Purpose:
544// Interface to stack frame layout info for the UltraSPARC.
Vikram S. Adve00521d72001-11-12 23:26:35 +0000545// Starting offsets for each area of the stack frame are aligned at
546// a multiple of getStackFrameSizeAlignment().
Vikram S. Advec1521632001-10-22 13:31:53 +0000547//---------------------------------------------------------------------------
548
Vikram S. Adve7f37fe52001-11-08 04:55:13 +0000549class UltraSparcFrameInfo: public MachineFrameInfo {
Vikram S. Advec1521632001-10-22 13:31:53 +0000550public:
Chris Lattner699683c2002-02-04 05:59:25 +0000551 UltraSparcFrameInfo(const TargetMachine &tgt) : MachineFrameInfo(tgt) {}
Vikram S. Adve7f37fe52001-11-08 04:55:13 +0000552
553public:
Vikram S. Advee1f72802002-09-16 15:39:26 +0000554 // These methods provide constant parameters of the frame layout.
555 //
Chris Lattnerf57b8452002-04-27 06:56:12 +0000556 int getStackFrameSizeAlignment() const { return StackFrameSizeAlignment;}
557 int getMinStackFrameSize() const { return MinStackFrameSize; }
558 int getNumFixedOutgoingArgs() const { return NumFixedOutgoingArgs; }
559 int getSizeOfEachArgOnStack() const { return SizeOfEachArgOnStack; }
560 bool argsOnStackHaveFixedSize() const { return true; }
Vikram S. Adve7f37fe52001-11-08 04:55:13 +0000561
Vikram S. Advee1f72802002-09-16 15:39:26 +0000562 // This method adjusts a stack offset to meet alignment rules of target.
563 // The fixed OFFSET (0x7ff) must be subtracted and the result aligned.
564 virtual int adjustAlignment (int unalignedOffset,
565 bool growUp,
566 unsigned int align) const {
567 return unalignedOffset + (growUp? +1:-1)*((unalignedOffset-OFFSET) % align);
568 }
569
Vikram S. Adve7f37fe52001-11-08 04:55:13 +0000570 // These methods compute offsets using the frame contents for a
Chris Lattnerf57b8452002-04-27 06:56:12 +0000571 // particular function. The frame contents are obtained from the
572 // MachineCodeInfoForMethod object for the given function.
Vikram S. Adve7f37fe52001-11-08 04:55:13 +0000573 //
574 int getFirstIncomingArgOffset (MachineCodeForMethod& mcInfo,
Vikram S. Adve6d783112002-04-25 04:40:24 +0000575 bool& growUp) const
Vikram S. Adve7f37fe52001-11-08 04:55:13 +0000576 {
Vikram S. Adve6d783112002-04-25 04:40:24 +0000577 growUp = true; // arguments area grows upwards
Vikram S. Adve7f37fe52001-11-08 04:55:13 +0000578 return FirstIncomingArgOffsetFromFP;
579 }
580 int getFirstOutgoingArgOffset (MachineCodeForMethod& mcInfo,
Vikram S. Adve6d783112002-04-25 04:40:24 +0000581 bool& growUp) const
Vikram S. Adve7f37fe52001-11-08 04:55:13 +0000582 {
Vikram S. Adve6d783112002-04-25 04:40:24 +0000583 growUp = true; // arguments area grows upwards
Vikram S. Adve7f37fe52001-11-08 04:55:13 +0000584 return FirstOutgoingArgOffsetFromSP;
585 }
586 int getFirstOptionalOutgoingArgOffset(MachineCodeForMethod& mcInfo,
Vikram S. Adve6d783112002-04-25 04:40:24 +0000587 bool& growUp)const
Vikram S. Adve7f37fe52001-11-08 04:55:13 +0000588 {
Vikram S. Adve6d783112002-04-25 04:40:24 +0000589 growUp = true; // arguments area grows upwards
Vikram S. Adve7f37fe52001-11-08 04:55:13 +0000590 return FirstOptionalOutgoingArgOffsetFromSP;
591 }
592
593 int getFirstAutomaticVarOffset (MachineCodeForMethod& mcInfo,
Vikram S. Adve6d783112002-04-25 04:40:24 +0000594 bool& growUp) const;
Vikram S. Adve7f37fe52001-11-08 04:55:13 +0000595 int getRegSpillAreaOffset (MachineCodeForMethod& mcInfo,
Vikram S. Adve6d783112002-04-25 04:40:24 +0000596 bool& growUp) const;
Vikram S. Adve7f37fe52001-11-08 04:55:13 +0000597 int getTmpAreaOffset (MachineCodeForMethod& mcInfo,
Vikram S. Adve6d783112002-04-25 04:40:24 +0000598 bool& growUp) const;
Vikram S. Adve7f37fe52001-11-08 04:55:13 +0000599 int getDynamicAreaOffset (MachineCodeForMethod& mcInfo,
Vikram S. Adve6d783112002-04-25 04:40:24 +0000600 bool& growUp) const;
Vikram S. Adve7f37fe52001-11-08 04:55:13 +0000601
602 //
603 // These methods specify the base register used for each stack area
604 // (generally FP or SP)
605 //
606 virtual int getIncomingArgBaseRegNum() const {
607 return (int) target.getRegInfo().getFramePointer();
608 }
609 virtual int getOutgoingArgBaseRegNum() const {
610 return (int) target.getRegInfo().getStackPointer();
611 }
612 virtual int getOptionalOutgoingArgBaseRegNum() const {
613 return (int) target.getRegInfo().getStackPointer();
614 }
615 virtual int getAutomaticVarBaseRegNum() const {
616 return (int) target.getRegInfo().getFramePointer();
617 }
618 virtual int getRegSpillAreaBaseRegNum() const {
619 return (int) target.getRegInfo().getFramePointer();
620 }
621 virtual int getDynamicAreaBaseRegNum() const {
622 return (int) target.getRegInfo().getStackPointer();
623 }
624
625private:
Vikram S. Advee1f72802002-09-16 15:39:26 +0000626 /*----------------------------------------------------------------------
627 This diagram shows the stack frame layout used by llc on Sparc V9.
628 Note that only the location of automatic variables, spill area,
629 temporary storage, and dynamically allocated stack area are chosen
630 by us. The rest conform to the Sparc V9 ABI.
631 All stack addresses are offset by OFFSET = 0x7ff (2047).
632
633 Alignment assumpteions and other invariants:
634 (1) %sp+OFFSET and %fp+OFFSET are always aligned on 16-byte boundary
635 (2) Variables in automatic, spill, temporary, or dynamic regions
636 are aligned according to their size as in all memory accesses.
637 (3) Everything below the dynamically allocated stack area is only used
638 during a call to another function, so it is never needed when
639 the current function is active. This is why space can be allocated
640 dynamically by incrementing %sp any time within the function.
641
642 STACK FRAME LAYOUT:
643
644 ...
645 %fp+OFFSET+176 Optional extra incoming arguments# 1..N
646 %fp+OFFSET+168 Incoming argument #6
647 ... ...
648 %fp+OFFSET+128 Incoming argument #1
649 ... ...
650 ---%fp+OFFSET-0--------Bottom of caller's stack frame--------------------
651 %fp+OFFSET-8 Automatic variables <-- ****TOP OF STACK FRAME****
652 Spill area
653 Temporary storage
654 ...
655
656 %sp+OFFSET+176+8N Bottom of dynamically allocated stack area
657 %sp+OFFSET+168+8N Optional extra outgoing argument# N
658 ... ...
659 %sp+OFFSET+176 Optional extra outgoing argument# 1
660 %sp+OFFSET+168 Outgoing argument #6
661 ... ...
662 %sp+OFFSET+128 Outgoing argument #1
663 %sp+OFFSET+120 Save area for %i7
664 ... ...
665 %sp+OFFSET+0 Save area for %l0 <-- ****BOTTOM OF STACK FRAME****
666
667 *----------------------------------------------------------------------*/
668
Vikram S. Adve5afff3b2001-11-09 02:15:52 +0000669 // All stack addresses must be offset by 0x7ff (2047) on Sparc V9.
670 static const int OFFSET = (int) 0x7ff;
Vikram S. Adve7f37fe52001-11-08 04:55:13 +0000671 static const int StackFrameSizeAlignment = 16;
Vikram S. Advec1521632001-10-22 13:31:53 +0000672 static const int MinStackFrameSize = 176;
Vikram S. Adve7f37fe52001-11-08 04:55:13 +0000673 static const int NumFixedOutgoingArgs = 6;
674 static const int SizeOfEachArgOnStack = 8;
Vikram S. Adve5afff3b2001-11-09 02:15:52 +0000675 static const int FirstIncomingArgOffsetFromFP = 128 + OFFSET;
676 static const int FirstOptionalIncomingArgOffsetFromFP = 176 + OFFSET;
Vikram S. Advee1f72802002-09-16 15:39:26 +0000677 static const int StaticAreaOffsetFromFP = 0 + OFFSET;
Vikram S. Adve5afff3b2001-11-09 02:15:52 +0000678 static const int FirstOutgoingArgOffsetFromSP = 128 + OFFSET;
679 static const int FirstOptionalOutgoingArgOffsetFromSP = 176 + OFFSET;
Vikram S. Advec1521632001-10-22 13:31:53 +0000680};
681
682
Vikram S. Adve5afff3b2001-11-09 02:15:52 +0000683//---------------------------------------------------------------------------
684// class UltraSparcCacheInfo
685//
686// Purpose:
687// Interface to cache parameters for the UltraSPARC.
688// Just use defaults for now.
689//---------------------------------------------------------------------------
690
691class UltraSparcCacheInfo: public MachineCacheInfo {
692public:
Chris Lattner7327d7e2002-02-04 00:04:35 +0000693 UltraSparcCacheInfo(const TargetMachine &T) : MachineCacheInfo(T) {}
Vikram S. Adve5afff3b2001-11-09 02:15:52 +0000694};
695
Vikram S. Advec1521632001-10-22 13:31:53 +0000696
697//---------------------------------------------------------------------------
Vikram S. Adved55697c2002-09-20 00:52:09 +0000698// class UltraSparcOptInfo
699//
700// Purpose:
701// Interface to machine-level optimization routines for the UltraSPARC.
702//---------------------------------------------------------------------------
703
704class UltraSparcOptInfo: public MachineOptInfo {
705public:
706 UltraSparcOptInfo(const TargetMachine &T) : MachineOptInfo(T) {}
707
708 virtual bool IsUselessCopy (const MachineInstr* MI) const;
709};
710
711
712//---------------------------------------------------------------------------
Chris Lattnerf6e0e282001-09-14 04:32:55 +0000713// class UltraSparcMachine
714//
715// Purpose:
716// Primary interface to machine description for the UltraSPARC.
717// Primarily just initializes machine-dependent parameters in
718// class TargetMachine, and creates machine-dependent subclasses
Vikram S. Adve339084b2001-09-18 13:04:24 +0000719// for classes such as InstrInfo, SchedInfo and RegInfo.
Chris Lattnerf6e0e282001-09-14 04:32:55 +0000720//---------------------------------------------------------------------------
721
722class UltraSparc : public TargetMachine {
Vikram S. Adve339084b2001-09-18 13:04:24 +0000723private:
724 UltraSparcInstrInfo instrInfo;
725 UltraSparcSchedInfo schedInfo;
726 UltraSparcRegInfo regInfo;
Vikram S. Advec1521632001-10-22 13:31:53 +0000727 UltraSparcFrameInfo frameInfo;
Vikram S. Adve5afff3b2001-11-09 02:15:52 +0000728 UltraSparcCacheInfo cacheInfo;
Vikram S. Adved55697c2002-09-20 00:52:09 +0000729 UltraSparcOptInfo optInfo;
Chris Lattnerf6e0e282001-09-14 04:32:55 +0000730public:
731 UltraSparc();
Vikram S. Adved55697c2002-09-20 00:52:09 +0000732
Chris Lattner32f600a2001-09-19 13:47:12 +0000733 virtual const MachineInstrInfo &getInstrInfo() const { return instrInfo; }
734 virtual const MachineSchedInfo &getSchedInfo() const { return schedInfo; }
735 virtual const MachineRegInfo &getRegInfo() const { return regInfo; }
Vikram S. Adve7f37fe52001-11-08 04:55:13 +0000736 virtual const MachineFrameInfo &getFrameInfo() const { return frameInfo; }
Vikram S. Adve5afff3b2001-11-09 02:15:52 +0000737 virtual const MachineCacheInfo &getCacheInfo() const { return cacheInfo; }
Vikram S. Adved55697c2002-09-20 00:52:09 +0000738 virtual const MachineOptInfo &getOptInfo() const { return optInfo; }
Chris Lattner32f600a2001-09-19 13:47:12 +0000739
Vikram S. Advee1f72802002-09-16 15:39:26 +0000740 // getPrologEpilogCodeInserter - Inserts prolog/epilog code.
741 virtual Pass* getPrologEpilogInsertionPass();
Chris Lattnerf6e0e282001-09-14 04:32:55 +0000742
Vikram S. Advee1f72802002-09-16 15:39:26 +0000743 // getFunctionAsmPrinterPass - Writes out machine code for a single function
744 virtual Pass* getFunctionAsmPrinterPass(std::ostream &Out);
745
746 // getModuleAsmPrinterPass - Writes generated machine code to assembly file.
747 virtual Pass* getModuleAsmPrinterPass(std::ostream &Out);
748
749 // getEmitBytecodeToAsmPass - Emits final LLVM bytecode to assembly file.
750 virtual Pass* getEmitBytecodeToAsmPass(std::ostream &Out);
Chris Lattner6edfcc52002-02-03 07:51:17 +0000751};
Chris Lattnerf6e0e282001-09-14 04:32:55 +0000752
Chris Lattnerc6495ee2001-09-14 03:56:45 +0000753#endif