llvm.org GIT mirror llvm / 803f827
Move TargetFrameLowering.h to CodeGen where it's implemented This header already includes a CodeGen header and is implemented in lib/CodeGen, so move the header there to match. This fixes a link error with modular codegeneration builds - where a header and its implementation are circularly dependent and so need to be in the same library, not split between two like this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317379 91177308-0d34-0410-b5e6-96231b3b80d8 David Blaikie 1 year, 9 months ago
74 changed file(s) with 420 addition(s) and 420 deletion(s). Raw diff Collapse all Expand all
0 //===-- llvm/CodeGen/TargetFrameLowering.h ---------------------------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Interface to describe the layout of a stack frame on the target machine.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef LLVM_CODEGEN_TARGETFRAMELOWERING_H
14 #define LLVM_CODEGEN_TARGETFRAMELOWERING_H
15
16 #include "llvm/CodeGen/MachineBasicBlock.h"
17 #include
18 #include
19
20 namespace llvm {
21 class BitVector;
22 class CalleeSavedInfo;
23 class MachineFunction;
24 class RegScavenger;
25
26 /// Information about stack frame layout on the target. It holds the direction
27 /// of stack growth, the known stack alignment on entry to each function, and
28 /// the offset to the locals area.
29 ///
30 /// The offset to the local area is the offset from the stack pointer on
31 /// function entry to the first location where function data (local variables,
32 /// spill locations) can be stored.
33 class TargetFrameLowering {
34 public:
35 enum StackDirection {
36 StackGrowsUp, // Adding to the stack increases the stack address
37 StackGrowsDown // Adding to the stack decreases the stack address
38 };
39
40 // Maps a callee saved register to a stack slot with a fixed offset.
41 struct SpillSlot {
42 unsigned Reg;
43 int Offset; // Offset relative to stack pointer on function entry.
44 };
45 private:
46 StackDirection StackDir;
47 unsigned StackAlignment;
48 unsigned TransientStackAlignment;
49 int LocalAreaOffset;
50 bool StackRealignable;
51 public:
52 TargetFrameLowering(StackDirection D, unsigned StackAl, int LAO,
53 unsigned TransAl = 1, bool StackReal = true)
54 : StackDir(D), StackAlignment(StackAl), TransientStackAlignment(TransAl),
55 LocalAreaOffset(LAO), StackRealignable(StackReal) {}
56
57 virtual ~TargetFrameLowering();
58
59 // These methods return information that describes the abstract stack layout
60 // of the target machine.
61
62 /// getStackGrowthDirection - Return the direction the stack grows
63 ///
64 StackDirection getStackGrowthDirection() const { return StackDir; }
65
66 /// getStackAlignment - This method returns the number of bytes to which the
67 /// stack pointer must be aligned on entry to a function. Typically, this
68 /// is the largest alignment for any data object in the target.
69 ///
70 unsigned getStackAlignment() const { return StackAlignment; }
71
72 /// alignSPAdjust - This method aligns the stack adjustment to the correct
73 /// alignment.
74 ///
75 int alignSPAdjust(int SPAdj) const {
76 if (SPAdj < 0) {
77 SPAdj = -alignTo(-SPAdj, StackAlignment);
78 } else {
79 SPAdj = alignTo(SPAdj, StackAlignment);
80 }
81 return SPAdj;
82 }
83
84 /// getTransientStackAlignment - This method returns the number of bytes to
85 /// which the stack pointer must be aligned at all times, even between
86 /// calls.
87 ///
88 unsigned getTransientStackAlignment() const {
89 return TransientStackAlignment;
90 }
91
92 /// isStackRealignable - This method returns whether the stack can be
93 /// realigned.
94 bool isStackRealignable() const {
95 return StackRealignable;
96 }
97
98 /// Return the skew that has to be applied to stack alignment under
99 /// certain conditions (e.g. stack was adjusted before function \p MF
100 /// was called).
101 virtual unsigned getStackAlignmentSkew(const MachineFunction &MF) const;
102
103 /// getOffsetOfLocalArea - This method returns the offset of the local area
104 /// from the stack pointer on entrance to a function.
105 ///
106 int getOffsetOfLocalArea() const { return LocalAreaOffset; }
107
108 /// isFPCloseToIncomingSP - Return true if the frame pointer is close to
109 /// the incoming stack pointer, false if it is close to the post-prologue
110 /// stack pointer.
111 virtual bool isFPCloseToIncomingSP() const { return true; }
112
113 /// assignCalleeSavedSpillSlots - Allows target to override spill slot
114 /// assignment logic. If implemented, assignCalleeSavedSpillSlots() should
115 /// assign frame slots to all CSI entries and return true. If this method
116 /// returns false, spill slots will be assigned using generic implementation.
117 /// assignCalleeSavedSpillSlots() may add, delete or rearrange elements of
118 /// CSI.
119 virtual bool
120 assignCalleeSavedSpillSlots(MachineFunction &MF,
121 const TargetRegisterInfo *TRI,
122 std::vector &CSI) const {
123 return false;
124 }
125
126 /// getCalleeSavedSpillSlots - This method returns a pointer to an array of
127 /// pairs, that contains an entry for each callee saved register that must be
128 /// spilled to a particular stack location if it is spilled.
129 ///
130 /// Each entry in this array contains a pair, indicating the
131 /// fixed offset from the incoming stack pointer that each register should be
132 /// spilled at. If a register is not listed here, the code generator is
133 /// allowed to spill it anywhere it chooses.
134 ///
135 virtual const SpillSlot *
136 getCalleeSavedSpillSlots(unsigned &NumEntries) const {
137 NumEntries = 0;
138 return nullptr;
139 }
140
141 /// targetHandlesStackFrameRounding - Returns true if the target is
142 /// responsible for rounding up the stack frame (probably at emitPrologue
143 /// time).
144 virtual bool targetHandlesStackFrameRounding() const {
145 return false;
146 }
147
148 /// Returns true if the target will correctly handle shrink wrapping.
149 virtual bool enableShrinkWrapping(const MachineFunction &MF) const {
150 return false;
151 }
152
153 /// Returns true if the stack slot holes in the fixed and callee-save stack
154 /// area should be used when allocating other stack locations to reduce stack
155 /// size.
156 virtual bool enableStackSlotScavenging(const MachineFunction &MF) const {
157 return false;
158 }
159
160 /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
161 /// the function.
162 virtual void emitPrologue(MachineFunction &MF,
163 MachineBasicBlock &MBB) const = 0;
164 virtual void emitEpilogue(MachineFunction &MF,
165 MachineBasicBlock &MBB) const = 0;
166
167 /// Replace a StackProbe stub (if any) with the actual probe code inline
168 virtual void inlineStackProbe(MachineFunction &MF,
169 MachineBasicBlock &PrologueMBB) const {}
170
171 /// Adjust the prologue to have the function use segmented stacks. This works
172 /// by adding a check even before the "normal" function prologue.
173 virtual void adjustForSegmentedStacks(MachineFunction &MF,
174 MachineBasicBlock &PrologueMBB) const {}
175
176 /// Adjust the prologue to add Erlang Run-Time System (ERTS) specific code in
177 /// the assembly prologue to explicitly handle the stack.
178 virtual void adjustForHiPEPrologue(MachineFunction &MF,
179 MachineBasicBlock &PrologueMBB) const {}
180
181 /// spillCalleeSavedRegisters - Issues instruction(s) to spill all callee
182 /// saved registers and returns true if it isn't possible / profitable to do
183 /// so by issuing a series of store instructions via
184 /// storeRegToStackSlot(). Returns false otherwise.
185 virtual bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
186 MachineBasicBlock::iterator MI,
187 const std::vector &CSI,
188 const TargetRegisterInfo *TRI) const {
189 return false;
190 }
191
192 /// restoreCalleeSavedRegisters - Issues instruction(s) to restore all callee
193 /// saved registers and returns true if it isn't possible / profitable to do
194 /// so by issuing a series of load instructions via loadRegToStackSlot().
195 /// If it returns true, and any of the registers in CSI is not restored,
196 /// it sets the corresponding Restored flag in CSI to false.
197 /// Returns false otherwise.
198 virtual bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
199 MachineBasicBlock::iterator MI,
200 std::vector &CSI,
201 const TargetRegisterInfo *TRI) const {
202 return false;
203 }
204
205 /// Return true if the target needs to disable frame pointer elimination.
206 virtual bool noFramePointerElim(const MachineFunction &MF) const;
207
208 /// hasFP - Return true if the specified function should have a dedicated
209 /// frame pointer register. For most targets this is true only if the function
210 /// has variable sized allocas or if frame pointer elimination is disabled.
211 virtual bool hasFP(const MachineFunction &MF) const = 0;
212
213 /// hasReservedCallFrame - Under normal circumstances, when a frame pointer is
214 /// not required, we reserve argument space for call sites in the function
215 /// immediately on entry to the current function. This eliminates the need for
216 /// add/sub sp brackets around call sites. Returns true if the call frame is
217 /// included as part of the stack frame.
218 virtual bool hasReservedCallFrame(const MachineFunction &MF) const {
219 return !hasFP(MF);
220 }
221
222 /// canSimplifyCallFramePseudos - When possible, it's best to simplify the
223 /// call frame pseudo ops before doing frame index elimination. This is
224 /// possible only when frame index references between the pseudos won't
225 /// need adjusting for the call frame adjustments. Normally, that's true
226 /// if the function has a reserved call frame or a frame pointer. Some
227 /// targets (Thumb2, for example) may have more complicated criteria,
228 /// however, and can override this behavior.
229 virtual bool canSimplifyCallFramePseudos(const MachineFunction &MF) const {
230 return hasReservedCallFrame(MF) || hasFP(MF);
231 }
232
233 // needsFrameIndexResolution - Do we need to perform FI resolution for
234 // this function. Normally, this is required only when the function
235 // has any stack objects. However, targets may want to override this.
236 virtual bool needsFrameIndexResolution(const MachineFunction &MF) const;
237
238 /// getFrameIndexReference - This method should return the base register
239 /// and offset used to reference a frame index location. The offset is
240 /// returned directly, and the base register is returned via FrameReg.
241 virtual int getFrameIndexReference(const MachineFunction &MF, int FI,
242 unsigned &FrameReg) const;
243
244 /// Same as \c getFrameIndexReference, except that the stack pointer (as
245 /// opposed to the frame pointer) will be the preferred value for \p
246 /// FrameReg. This is generally used for emitting statepoint or EH tables that
247 /// use offsets from RSP. If \p IgnoreSPUpdates is true, the returned
248 /// offset is only guaranteed to be valid with respect to the value of SP at
249 /// the end of the prologue.
250 virtual int getFrameIndexReferencePreferSP(const MachineFunction &MF, int FI,
251 unsigned &FrameReg,
252 bool IgnoreSPUpdates) const {
253 // Always safe to dispatch to getFrameIndexReference.
254 return getFrameIndexReference(MF, FI, FrameReg);
255 }
256
257 /// This method determines which of the registers reported by
258 /// TargetRegisterInfo::getCalleeSavedRegs() should actually get saved.
259 /// The default implementation checks populates the \p SavedRegs bitset with
260 /// all registers which are modified in the function, targets may override
261 /// this function to save additional registers.
262 /// This method also sets up the register scavenger ensuring there is a free
263 /// register or a frameindex available.
264 virtual void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
265 RegScavenger *RS = nullptr) const;
266
267 /// processFunctionBeforeFrameFinalized - This method is called immediately
268 /// before the specified function's frame layout (MF.getFrameInfo()) is
269 /// finalized. Once the frame is finalized, MO_FrameIndex operands are
270 /// replaced with direct constants. This method is optional.
271 ///
272 virtual void processFunctionBeforeFrameFinalized(MachineFunction &MF,
273 RegScavenger *RS = nullptr) const {
274 }
275
276 virtual unsigned getWinEHParentFrameOffset(const MachineFunction &MF) const {
277 report_fatal_error("WinEH not implemented for this target");
278 }
279
280 /// This method is called during prolog/epilog code insertion to eliminate
281 /// call frame setup and destroy pseudo instructions (but only if the Target
282 /// is using them). It is responsible for eliminating these instructions,
283 /// replacing them with concrete instructions. This method need only be
284 /// implemented if using call frame setup/destroy pseudo instructions.
285 /// Returns an iterator pointing to the instruction after the replaced one.
286 virtual MachineBasicBlock::iterator
287 eliminateCallFramePseudoInstr(MachineFunction &MF,
288 MachineBasicBlock &MBB,
289 MachineBasicBlock::iterator MI) const {
290 llvm_unreachable("Call Frame Pseudo Instructions do not exist on this "
291 "target!");
292 }
293
294
295 /// Order the symbols in the local stack frame.
296 /// The list of objects that we want to order is in \p objectsToAllocate as
297 /// indices into the MachineFrameInfo. The array can be reordered in any way
298 /// upon return. The contents of the array, however, may not be modified (i.e.
299 /// only their order may be changed).
300 /// By default, just maintain the original order.
301 virtual void
302 orderFrameObjects(const MachineFunction &MF,
303 SmallVectorImpl &objectsToAllocate) const {
304 }
305
306 /// Check whether or not the given \p MBB can be used as a prologue
307 /// for the target.
308 /// The prologue will be inserted first in this basic block.
309 /// This method is used by the shrink-wrapping pass to decide if
310 /// \p MBB will be correctly handled by the target.
311 /// As soon as the target enable shrink-wrapping without overriding
312 /// this method, we assume that each basic block is a valid
313 /// prologue.
314 virtual bool canUseAsPrologue(const MachineBasicBlock &MBB) const {
315 return true;
316 }
317
318 /// Check whether or not the given \p MBB can be used as a epilogue
319 /// for the target.
320 /// The epilogue will be inserted before the first terminator of that block.
321 /// This method is used by the shrink-wrapping pass to decide if
322 /// \p MBB will be correctly handled by the target.
323 /// As soon as the target enable shrink-wrapping without overriding
324 /// this method, we assume that each basic block is a valid
325 /// epilogue.
326 virtual bool canUseAsEpilogue(const MachineBasicBlock &MBB) const {
327 return true;
328 }
329
330 /// Check if given function is safe for not having callee saved registers.
331 /// This is used when interprocedural register allocation is enabled.
332 static bool isSafeForNoCSROpt(const Function *F) {
333 if (!F->hasLocalLinkage() || F->hasAddressTaken() ||
334 !F->hasFnAttribute(Attribute::NoRecurse))
335 return false;
336 // Function should not be optimized as tail call.
337 for (const User *U : F->users())
338 if (auto CS = ImmutableCallSite(U))
339 if (CS.isTailCall())
340 return false;
341 return true;
342 }
343 };
344
345 } // End llvm namespace
346
347 #endif
+0
-348
include/llvm/Target/TargetFrameLowering.h less more
None //===-- llvm/Target/TargetFrameLowering.h ---------------------------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Interface to describe the layout of a stack frame on the target machine.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef LLVM_TARGET_TARGETFRAMELOWERING_H
14 #define LLVM_TARGET_TARGETFRAMELOWERING_H
15
16 #include "llvm/CodeGen/MachineBasicBlock.h"
17 #include
18 #include
19
20 namespace llvm {
21 class BitVector;
22 class CalleeSavedInfo;
23 class MachineFunction;
24 class RegScavenger;
25
26 /// Information about stack frame layout on the target. It holds the direction
27 /// of stack growth, the known stack alignment on entry to each function, and
28 /// the offset to the locals area.
29 ///
30 /// The offset to the local area is the offset from the stack pointer on
31 /// function entry to the first location where function data (local variables,
32 /// spill locations) can be stored.
33 class TargetFrameLowering {
34 public:
35 enum StackDirection {
36 StackGrowsUp, // Adding to the stack increases the stack address
37 StackGrowsDown // Adding to the stack decreases the stack address
38 };
39
40 // Maps a callee saved register to a stack slot with a fixed offset.
41 struct SpillSlot {
42 unsigned Reg;
43 int Offset; // Offset relative to stack pointer on function entry.
44 };
45 private:
46 StackDirection StackDir;
47 unsigned StackAlignment;
48 unsigned TransientStackAlignment;
49 int LocalAreaOffset;
50 bool StackRealignable;
51 public:
52 TargetFrameLowering(StackDirection D, unsigned StackAl, int LAO,
53 unsigned TransAl = 1, bool StackReal = true)
54 : StackDir(D), StackAlignment(StackAl), TransientStackAlignment(TransAl),
55 LocalAreaOffset(LAO), StackRealignable(StackReal) {}
56
57 virtual ~TargetFrameLowering();
58
59 // These methods return information that describes the abstract stack layout
60 // of the target machine.
61
62 /// getStackGrowthDirection - Return the direction the stack grows
63 ///
64 StackDirection getStackGrowthDirection() const { return StackDir; }
65
66 /// getStackAlignment - This method returns the number of bytes to which the
67 /// stack pointer must be aligned on entry to a function. Typically, this
68 /// is the largest alignment for any data object in the target.
69 ///
70 unsigned getStackAlignment() const { return StackAlignment; }
71
72 /// alignSPAdjust - This method aligns the stack adjustment to the correct
73 /// alignment.
74 ///
75 int alignSPAdjust(int SPAdj) const {
76 if (SPAdj < 0) {
77 SPAdj = -alignTo(-SPAdj, StackAlignment);
78 } else {
79 SPAdj = alignTo(SPAdj, StackAlignment);
80 }
81 return SPAdj;
82 }
83
84 /// getTransientStackAlignment - This method returns the number of bytes to
85 /// which the stack pointer must be aligned at all times, even between
86 /// calls.
87 ///
88 unsigned getTransientStackAlignment() const {
89 return TransientStackAlignment;
90 }
91
92 /// isStackRealignable - This method returns whether the stack can be
93 /// realigned.
94 bool isStackRealignable() const {
95 return StackRealignable;
96 }
97
98 /// Return the skew that has to be applied to stack alignment under
99 /// certain conditions (e.g. stack was adjusted before function \p MF
100 /// was called).
101 virtual unsigned getStackAlignmentSkew(const MachineFunction &MF) const;
102
103 /// getOffsetOfLocalArea - This method returns the offset of the local area
104 /// from the stack pointer on entrance to a function.
105 ///
106 int getOffsetOfLocalArea() const { return LocalAreaOffset; }
107
108 /// isFPCloseToIncomingSP - Return true if the frame pointer is close to
109 /// the incoming stack pointer, false if it is close to the post-prologue
110 /// stack pointer.
111 virtual bool isFPCloseToIncomingSP() const { return true; }
112
113 /// assignCalleeSavedSpillSlots - Allows target to override spill slot
114 /// assignment logic. If implemented, assignCalleeSavedSpillSlots() should
115 /// assign frame slots to all CSI entries and return true. If this method
116 /// returns false, spill slots will be assigned using generic implementation.
117 /// assignCalleeSavedSpillSlots() may add, delete or rearrange elements of
118 /// CSI.
119 virtual bool
120 assignCalleeSavedSpillSlots(MachineFunction &MF,
121 const TargetRegisterInfo *TRI,
122 std::vector &CSI) const {
123 return false;
124 }
125
126 /// getCalleeSavedSpillSlots - This method returns a pointer to an array of
127 /// pairs, that contains an entry for each callee saved register that must be
128 /// spilled to a particular stack location if it is spilled.
129 ///
130 /// Each entry in this array contains a pair, indicating the
131 /// fixed offset from the incoming stack pointer that each register should be
132 /// spilled at. If a register is not listed here, the code generator is
133 /// allowed to spill it anywhere it chooses.
134 ///
135 virtual const SpillSlot *
136 getCalleeSavedSpillSlots(unsigned &NumEntries) const {
137 NumEntries = 0;
138 return nullptr;
139 }
140
141 /// targetHandlesStackFrameRounding - Returns true if the target is
142 /// responsible for rounding up the stack frame (probably at emitPrologue
143 /// time).
144 virtual bool targetHandlesStackFrameRounding() const {
145 return false;
146 }
147
148 /// Returns true if the target will correctly handle shrink wrapping.
149 virtual bool enableShrinkWrapping(const MachineFunction &MF) const {
150 return false;
151 }
152
153 /// Returns true if the stack slot holes in the fixed and callee-save stack
154 /// area should be used when allocating other stack locations to reduce stack
155 /// size.
156 virtual bool enableStackSlotScavenging(const MachineFunction &MF) const {
157 return false;
158 }
159
160 /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
161 /// the function.
162 virtual void emitPrologue(MachineFunction &MF,
163 MachineBasicBlock &MBB) const = 0;
164 virtual void emitEpilogue(MachineFunction &MF,
165 MachineBasicBlock &MBB) const = 0;
166
167 /// Replace a StackProbe stub (if any) with the actual probe code inline
168 virtual void inlineStackProbe(MachineFunction &MF,
169 MachineBasicBlock &PrologueMBB) const {}
170
171 /// Adjust the prologue to have the function use segmented stacks. This works
172 /// by adding a check even before the "normal" function prologue.
173 virtual void adjustForSegmentedStacks(MachineFunction &MF,
174 MachineBasicBlock &PrologueMBB) const {}
175
176 /// Adjust the prologue to add Erlang Run-Time System (ERTS) specific code in
177 /// the assembly prologue to explicitly handle the stack.
178 virtual void adjustForHiPEPrologue(MachineFunction &MF,
179 MachineBasicBlock &PrologueMBB) const {}
180
181 /// spillCalleeSavedRegisters - Issues instruction(s) to spill all callee
182 /// saved registers and returns true if it isn't possible / profitable to do
183 /// so by issuing a series of store instructions via
184 /// storeRegToStackSlot(). Returns false otherwise.
185 virtual bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
186 MachineBasicBlock::iterator MI,
187 const std::vector &CSI,
188 const TargetRegisterInfo *TRI) const {
189 return false;
190 }
191
192 /// restoreCalleeSavedRegisters - Issues instruction(s) to restore all callee
193 /// saved registers and returns true if it isn't possible / profitable to do
194 /// so by issuing a series of load instructions via loadRegToStackSlot().
195 /// If it returns true, and any of the registers in CSI is not restored,
196 /// it sets the corresponding Restored flag in CSI to false.
197 /// Returns false otherwise.
198 virtual bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
199 MachineBasicBlock::iterator MI,
200 std::vector &CSI,
201 const TargetRegisterInfo *TRI) const {
202 return false;
203 }
204
205 /// Return true if the target needs to disable frame pointer elimination.
206 virtual bool noFramePointerElim(const MachineFunction &MF) const;
207
208 /// hasFP - Return true if the specified function should have a dedicated
209 /// frame pointer register. For most targets this is true only if the function
210 /// has variable sized allocas or if frame pointer elimination is disabled.
211 virtual bool hasFP(const MachineFunction &MF) const = 0;
212
213 /// hasReservedCallFrame - Under normal circumstances, when a frame pointer is
214 /// not required, we reserve argument space for call sites in the function
215 /// immediately on entry to the current function. This eliminates the need for
216 /// add/sub sp brackets around call sites. Returns true if the call frame is
217 /// included as part of the stack frame.
218 virtual bool hasReservedCallFrame(const MachineFunction &MF) const {
219 return !hasFP(MF);
220 }
221
222 /// canSimplifyCallFramePseudos - When possible, it's best to simplify the
223 /// call frame pseudo ops before doing frame index elimination. This is
224 /// possible only when frame index references between the pseudos won't
225 /// need adjusting for the call frame adjustments. Normally, that's true
226 /// if the function has a reserved call frame or a frame pointer. Some
227 /// targets (Thumb2, for example) may have more complicated criteria,
228 /// however, and can override this behavior.
229 virtual bool canSimplifyCallFramePseudos(const MachineFunction &MF) const {
230 return hasReservedCallFrame(MF) || hasFP(MF);
231 }
232
233 // needsFrameIndexResolution - Do we need to perform FI resolution for
234 // this function. Normally, this is required only when the function
235 // has any stack objects. However, targets may want to override this.
236 virtual bool needsFrameIndexResolution(const MachineFunction &MF) const;
237
238 /// getFrameIndexReference - This method should return the base register
239 /// and offset used to reference a frame index location. The offset is
240 /// returned directly, and the base register is returned via FrameReg.
241 virtual int getFrameIndexReference(const MachineFunction &MF, int FI,
242 unsigned &FrameReg) const;
243
244 /// Same as \c getFrameIndexReference, except that the stack pointer (as
245 /// opposed to the frame pointer) will be the preferred value for \p
246 /// FrameReg. This is generally used for emitting statepoint or EH tables that
247 /// use offsets from RSP. If \p IgnoreSPUpdates is true, the returned
248 /// offset is only guaranteed to be valid with respect to the value of SP at
249 /// the end of the prologue.
250 virtual int getFrameIndexReferencePreferSP(const MachineFunction &MF, int FI,
251 unsigned &FrameReg,
252 bool IgnoreSPUpdates) const {
253 // Always safe to dispatch to getFrameIndexReference.
254 return getFrameIndexReference(MF, FI, FrameReg);
255 }
256
257 /// This method determines which of the registers reported by
258 /// TargetRegisterInfo::getCalleeSavedRegs() should actually get saved.
259 /// The default implementation checks populates the \p SavedRegs bitset with
260 /// all registers which are modified in the function, targets may override
261 /// this function to save additional registers.
262 /// This method also sets up the register scavenger ensuring there is a free
263 /// register or a frameindex available.
264 virtual void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
265 RegScavenger *RS = nullptr) const;
266
267 /// processFunctionBeforeFrameFinalized - This method is called immediately
268 /// before the specified function's frame layout (MF.getFrameInfo()) is
269 /// finalized. Once the frame is finalized, MO_FrameIndex operands are
270 /// replaced with direct constants. This method is optional.
271 ///
272 virtual void processFunctionBeforeFrameFinalized(MachineFunction &MF,
273 RegScavenger *RS = nullptr) const {
274 }
275
276 virtual unsigned getWinEHParentFrameOffset(const MachineFunction &MF) const {
277 report_fatal_error("WinEH not implemented for this target");
278 }
279
280 /// This method is called during prolog/epilog code insertion to eliminate
281 /// call frame setup and destroy pseudo instructions (but only if the Target
282 /// is using them). It is responsible for eliminating these instructions,
283 /// replacing them with concrete instructions. This method need only be
284 /// implemented if using call frame setup/destroy pseudo instructions.
285 /// Returns an iterator pointing to the instruction after the replaced one.
286 virtual MachineBasicBlock::iterator
287 eliminateCallFramePseudoInstr(MachineFunction &MF,
288 MachineBasicBlock &MBB,
289 MachineBasicBlock::iterator MI) const {
290 llvm_unreachable("Call Frame Pseudo Instructions do not exist on this "
291 "target!");
292 }
293
294
295 /// Order the symbols in the local stack frame.
296 /// The list of objects that we want to order is in \p objectsToAllocate as
297 /// indices into the MachineFrameInfo. The array can be reordered in any way
298 /// upon return. The contents of the array, however, may not be modified (i.e.
299 /// only their order may be changed).
300 /// By default, just maintain the original order.
301 virtual void
302 orderFrameObjects(const MachineFunction &MF,
303 SmallVectorImpl &objectsToAllocate) const {
304 }
305
306 /// Check whether or not the given \p MBB can be used as a prologue
307 /// for the target.
308 /// The prologue will be inserted first in this basic block.
309 /// This method is used by the shrink-wrapping pass to decide if
310 /// \p MBB will be correctly handled by the target.
311 /// As soon as the target enable shrink-wrapping without overriding
312 /// this method, we assume that each basic block is a valid
313 /// prologue.
314 virtual bool canUseAsPrologue(const MachineBasicBlock &MBB) const {
315 return true;
316 }
317
318 /// Check whether or not the given \p MBB can be used as a epilogue
319 /// for the target.
320 /// The epilogue will be inserted before the first terminator of that block.
321 /// This method is used by the shrink-wrapping pass to decide if
322 /// \p MBB will be correctly handled by the target.
323 /// As soon as the target enable shrink-wrapping without overriding
324 /// this method, we assume that each basic block is a valid
325 /// epilogue.
326 virtual bool canUseAsEpilogue(const MachineBasicBlock &MBB) const {
327 return true;
328 }
329
330 /// Check if given function is safe for not having callee saved registers.
331 /// This is used when interprocedural register allocation is enabled.
332 static bool isSafeForNoCSROpt(const Function *F) {
333 if (!F->hasLocalLinkage() || F->hasAddressTaken() ||
334 !F->hasFnAttribute(Attribute::NoRecurse))
335 return false;
336 // Function should not be optimized as tail call.
337 for (const User *U : F->users())
338 if (auto CS = ImmutableCallSite(U))
339 if (CS.isTailCall())
340 return false;
341 return true;
342 }
343 };
344
345 } // End llvm namespace
346
347 #endif
2828 #include "llvm/MC/MCStreamer.h"
2929 #include "llvm/MC/MCSymbol.h"
3030 #include "llvm/Support/FormattedStream.h"
31 #include "llvm/Target/TargetFrameLowering.h"
31 #include "llvm/CodeGen/TargetFrameLowering.h"
3232 #include "llvm/Target/TargetOptions.h"
3333 #include "llvm/Target/TargetRegisterInfo.h"
3434 using namespace llvm;
9999 #include "llvm/Support/TargetRegistry.h"
100100 #include "llvm/Support/Timer.h"
101101 #include "llvm/Support/raw_ostream.h"
102 #include "llvm/Target/TargetFrameLowering.h"
102 #include "llvm/CodeGen/TargetFrameLowering.h"
103103 #include "llvm/Target/TargetInstrInfo.h"
104104 #include "llvm/Target/TargetLowering.h"
105105 #include "llvm/Target/TargetLoweringObjectFile.h"
6767 #include "llvm/Support/ErrorHandling.h"
6868 #include "llvm/Support/ScopedPrinter.h"
6969 #include "llvm/Support/SMLoc.h"
70 #include "llvm/Target/TargetFrameLowering.h"
70 #include "llvm/CodeGen/TargetFrameLowering.h"
7171 #include "llvm/Target/TargetLoweringObjectFile.h"
7272 #include "llvm/Target/TargetMachine.h"
7373 #include "llvm/Target/TargetRegisterInfo.h"
3030 #include "llvm/MC/MachineLocation.h"
3131 #include "llvm/Support/ErrorHandling.h"
3232 #include "llvm/Support/FormattedStream.h"
33 #include "llvm/Target/TargetFrameLowering.h"
33 #include "llvm/CodeGen/TargetFrameLowering.h"
3434 #include "llvm/Target/TargetLoweringObjectFile.h"
3535 #include "llvm/Target/TargetMachine.h"
3636 #include "llvm/Target/TargetOptions.h"
3535 #include "llvm/MC/MCStreamer.h"
3636 #include "llvm/MC/MCSymbol.h"
3737 #include "llvm/Support/Casting.h"
38 #include "llvm/Target/TargetFrameLowering.h"
38 #include "llvm/CodeGen/TargetFrameLowering.h"
3939 #include "llvm/Target/TargetLoweringObjectFile.h"
4040 #include "llvm/Target/TargetMachine.h"
4141 #include "llvm/Target/TargetOptions.h"
3232 #include "llvm/MC/MCWin64EH.h"
3333 #include "llvm/Support/ErrorHandling.h"
3434 #include "llvm/Support/FormattedStream.h"
35 #include "llvm/Target/TargetFrameLowering.h"
35 #include "llvm/CodeGen/TargetFrameLowering.h"
3636 #include "llvm/Target/TargetLowering.h"
3737 #include "llvm/Target/TargetLoweringObjectFile.h"
3838 #include "llvm/Target/TargetOptions.h"
1616 #include "llvm/CodeGen/Passes.h"
1717 #include "llvm/IR/Function.h"
1818 #include "llvm/IR/Module.h"
19 #include "llvm/Target/TargetFrameLowering.h"
19 #include "llvm/CodeGen/TargetFrameLowering.h"
2020 #include "llvm/Target/TargetInstrInfo.h"
2121 #include "llvm/Target/TargetSubtargetInfo.h"
2222
2323 #include "llvm/Support/Debug.h"
2424 #include "llvm/Support/ErrorHandling.h"
2525 #include "llvm/Support/raw_ostream.h"
26 #include "llvm/Target/TargetFrameLowering.h"
26 #include "llvm/CodeGen/TargetFrameLowering.h"
2727 #include "llvm/Target/TargetInstrInfo.h"
2828 #include "llvm/Target/TargetMachine.h"
2929 #include "llvm/Target/TargetRegisterInfo.h"
5353 #include "llvm/Support/LowLevelTypeImpl.h"
5454 #include "llvm/Support/MathExtras.h"
5555 #include "llvm/Support/raw_ostream.h"
56 #include "llvm/Target/TargetFrameLowering.h"
56 #include "llvm/CodeGen/TargetFrameLowering.h"
5757 #include "llvm/Target/TargetIntrinsicInfo.h"
5858 #include "llvm/Target/TargetLowering.h"
5959 #include "llvm/Target/TargetMachine.h"
4545 #include "llvm/Support/Compiler.h"
4646 #include "llvm/Support/Debug.h"
4747 #include "llvm/Support/raw_ostream.h"
48 #include "llvm/Target/TargetFrameLowering.h"
48 #include "llvm/CodeGen/TargetFrameLowering.h"
4949 #include "llvm/Target/TargetInstrInfo.h"
5050 #include "llvm/Target/TargetLowering.h"
5151 #include "llvm/Target/TargetRegisterInfo.h"
2929 #include "llvm/Support/Debug.h"
3030 #include "llvm/Support/ErrorHandling.h"
3131 #include "llvm/Support/raw_ostream.h"
32 #include "llvm/Target/TargetFrameLowering.h"
32 #include "llvm/CodeGen/TargetFrameLowering.h"
3333 #include "llvm/Target/TargetOpcodes.h"
3434 #include "llvm/Target/TargetRegisterInfo.h"
3535 #include "llvm/Target/TargetSubtargetInfo.h"
1717 #include "llvm/CodeGen/MachineRegisterInfo.h"
1818 #include "llvm/Support/Debug.h"
1919 #include "llvm/Support/raw_ostream.h"
20 #include "llvm/Target/TargetFrameLowering.h"
20 #include "llvm/CodeGen/TargetFrameLowering.h"
2121 #include "llvm/Target/TargetInstrInfo.h"
2222 #include "llvm/Target/TargetRegisterInfo.h"
2323 #include "llvm/Target/TargetSubtargetInfo.h"
5757 #include "llvm/Support/ErrorHandling.h"
5858 #include "llvm/Support/GraphWriter.h"
5959 #include "llvm/Support/raw_ostream.h"
60 #include "llvm/Target/TargetFrameLowering.h"
60 #include "llvm/CodeGen/TargetFrameLowering.h"
6161 #include "llvm/Target/TargetLowering.h"
6262 #include "llvm/Target/TargetMachine.h"
6363 #include "llvm/Target/TargetRegisterInfo.h"
1515 #include "llvm/CodeGen/MachineFunctionPass.h"
1616 #include "llvm/CodeGen/MachineInstrBuilder.h"
1717 #include "llvm/CodeGen/Passes.h"
18 #include "llvm/Target/TargetFrameLowering.h"
18 #include "llvm/CodeGen/TargetFrameLowering.h"
1919 #include "llvm/Target/TargetInstrInfo.h"
2020 #include "llvm/Target/TargetSubtargetInfo.h"
2121
5454 #include "llvm/Support/ErrorHandling.h"
5555 #include "llvm/Support/MathExtras.h"
5656 #include "llvm/Support/raw_ostream.h"
57 #include "llvm/Target/TargetFrameLowering.h"
57 #include "llvm/CodeGen/TargetFrameLowering.h"
5858 #include "llvm/Target/TargetInstrInfo.h"
5959 #include "llvm/Target/TargetMachine.h"
6060 #include "llvm/Target/TargetOpcodes.h"
2626 #include "llvm/CodeGen/RegisterUsageInfo.h"
2727 #include "llvm/Support/Debug.h"
2828 #include "llvm/Support/raw_ostream.h"
29 #include "llvm/Target/TargetFrameLowering.h"
29 #include "llvm/CodeGen/TargetFrameLowering.h"
3030
3131 using namespace llvm;
3232
2323 #include "llvm/Support/CommandLine.h"
2424 #include "llvm/Support/Debug.h"
2525 #include "llvm/Support/raw_ostream.h"
26 #include "llvm/Target/TargetFrameLowering.h"
26 #include "llvm/CodeGen/TargetFrameLowering.h"
2727 #include "llvm/Target/TargetRegisterInfo.h"
2828 #include "llvm/Target/TargetSubtargetInfo.h"
2929 #include
3232 #include "llvm/Support/Debug.h"
3333 #include "llvm/Support/ErrorHandling.h"
3434 #include "llvm/Support/raw_ostream.h"
35 #include "llvm/Target/TargetFrameLowering.h"
35 #include "llvm/CodeGen/TargetFrameLowering.h"
3636 #include "llvm/Target/TargetInstrInfo.h"
3737 #include "llvm/Target/TargetRegisterInfo.h"
3838 #include "llvm/Target/TargetSubtargetInfo.h"
3131 #include "llvm/Support/ErrorHandling.h"
3232 #include "llvm/Support/MathExtras.h"
3333 #include "llvm/Support/raw_ostream.h"
34 #include "llvm/Target/TargetFrameLowering.h"
34 #include "llvm/CodeGen/TargetFrameLowering.h"
3535 #include "llvm/Target/TargetInstrInfo.h"
3636 #include "llvm/Target/TargetLowering.h"
3737 #include "llvm/Target/TargetOptions.h"
3939 #include "llvm/Support/ErrorHandling.h"
4040 #include "llvm/Support/MathExtras.h"
4141 #include "llvm/Support/raw_ostream.h"
42 #include "llvm/Target/TargetFrameLowering.h"
42 #include "llvm/CodeGen/TargetFrameLowering.h"
4343 #include "llvm/Target/TargetLowering.h"
4444 #include "llvm/Target/TargetMachine.h"
4545 #include "llvm/Target/TargetOptions.h"
9797 #include "llvm/Support/ErrorHandling.h"
9898 #include "llvm/Support/MathExtras.h"
9999 #include "llvm/Support/raw_ostream.h"
100 #include "llvm/Target/TargetFrameLowering.h"
100 #include "llvm/CodeGen/TargetFrameLowering.h"
101101 #include "llvm/Target/TargetInstrInfo.h"
102102 #include "llvm/Target/TargetIntrinsicInfo.h"
103103 #include "llvm/Target/TargetLowering.h"
7272 #include "llvm/Support/Debug.h"
7373 #include "llvm/Support/ErrorHandling.h"
7474 #include "llvm/Support/raw_ostream.h"
75 #include "llvm/Target/TargetFrameLowering.h"
75 #include "llvm/CodeGen/TargetFrameLowering.h"
7676 #include "llvm/Target/TargetInstrInfo.h"
7777 #include "llvm/Target/TargetMachine.h"
7878 #include "llvm/Target/TargetRegisterInfo.h"
1919 #include "llvm/IR/Function.h"
2020 #include "llvm/MC/MCRegisterInfo.h"
2121 #include "llvm/Support/Compiler.h"
22 #include "llvm/Target/TargetFrameLowering.h"
22 #include "llvm/CodeGen/TargetFrameLowering.h"
2323 #include "llvm/Target/TargetMachine.h"
2424 #include "llvm/Target/TargetOptions.h"
2525 #include "llvm/Target/TargetRegisterInfo.h"
2525 #include "llvm/Support/CommandLine.h"
2626 #include "llvm/Support/ErrorHandling.h"
2727 #include "llvm/Support/raw_ostream.h"
28 #include "llvm/Target/TargetFrameLowering.h"
28 #include "llvm/CodeGen/TargetFrameLowering.h"
2929 #include "llvm/Target/TargetLowering.h"
3030 #include "llvm/Target/TargetMachine.h"
3131 #include "llvm/Target/TargetRegisterInfo.h"
1414 #include "llvm/CodeGen/MachineFunction.h"
1515 #include "llvm/IR/Function.h"
1616 #include "llvm/IR/Module.h"
17 #include "llvm/Target/TargetFrameLowering.h"
17 #include "llvm/CodeGen/TargetFrameLowering.h"
1818 #include "llvm/Target/TargetOptions.h"
1919 #include "llvm/Target/TargetSubtargetInfo.h"
2020 using namespace llvm;
2626 #include "llvm/Support/MathExtras.h"
2727 #include "llvm/Support/Printable.h"
2828 #include "llvm/Support/raw_ostream.h"
29 #include "llvm/Target/TargetFrameLowering.h"
29 #include "llvm/CodeGen/TargetFrameLowering.h"
3030 #include "llvm/Target/TargetRegisterInfo.h"
3131 #include "llvm/Target/TargetSubtargetInfo.h"
3232 #include
1313 #ifndef LLVM_LIB_TARGET_AARCH64_AARCH64FRAMELOWERING_H
1414 #define LLVM_LIB_TARGET_AARCH64_AARCH64FRAMELOWERING_H
1515
16 #include "llvm/Target/TargetFrameLowering.h"
16 #include "llvm/CodeGen/TargetFrameLowering.h"
1717
1818 namespace llvm {
1919
2525 #include "llvm/CodeGen/RegisterScavenging.h"
2626 #include "llvm/IR/Function.h"
2727 #include "llvm/Support/raw_ostream.h"
28 #include "llvm/Target/TargetFrameLowering.h"
28 #include "llvm/CodeGen/TargetFrameLowering.h"
2929 #include "llvm/Target/TargetOptions.h"
3030
3131 using namespace llvm;
1414 #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUFRAMELOWERING_H
1515 #define LLVM_LIB_TARGET_AMDGPU_AMDGPUFRAMELOWERING_H
1616
17 #include "llvm/Target/TargetFrameLowering.h"
17 #include "llvm/CodeGen/TargetFrameLowering.h"
1818
1919 namespace llvm {
2020
2222 #include "llvm/ADT/SmallString.h"
2323 #include "llvm/CodeGen/MachineScheduler.h"
2424 #include "llvm/IR/MDBuilder.h"
25 #include "llvm/Target/TargetFrameLowering.h"
25 #include "llvm/CodeGen/TargetFrameLowering.h"
2626 #include
2727
2828 using namespace llvm;
1616 #include "ARC.h"
1717 #include "llvm/CodeGen/MachineBasicBlock.h"
1818 #include "llvm/CodeGen/MachineFrameInfo.h"
19 #include "llvm/Target/TargetFrameLowering.h"
19 #include "llvm/CodeGen/TargetFrameLowering.h"
2020
2121 namespace llvm {
2222
2424 #include "llvm/CodeGen/RegisterScavenging.h"
2525 #include "llvm/IR/Function.h"
2626 #include "llvm/Support/Debug.h"
27 #include "llvm/Target/TargetFrameLowering.h"
27 #include "llvm/CodeGen/TargetFrameLowering.h"
2828 #include "llvm/Target/TargetMachine.h"
2929 #include "llvm/Target/TargetOptions.h"
3030
1010 #define LLVM_LIB_TARGET_ARM_ARMFRAMELOWERING_H
1111
1212 #include "llvm/CodeGen/MachineBasicBlock.h"
13 #include "llvm/Target/TargetFrameLowering.h"
13 #include "llvm/CodeGen/TargetFrameLowering.h"
1414 #include
1515
1616 namespace llvm {
5252 #include "llvm/Support/Debug.h"
5353 #include "llvm/Support/ErrorHandling.h"
5454 #include "llvm/Support/raw_ostream.h"
55 #include "llvm/Target/TargetFrameLowering.h"
55 #include "llvm/CodeGen/TargetFrameLowering.h"
5656 #include "llvm/Target/TargetInstrInfo.h"
5757 #include "llvm/Target/TargetLowering.h"
5858 #include "llvm/Target/TargetRegisterInfo.h"
2828 #include "llvm/IR/LLVMContext.h"
2929 #include "llvm/Support/CommandLine.h"
3030 #include "llvm/Support/ErrorHandling.h"
31 #include "llvm/Target/TargetFrameLowering.h"
31 #include "llvm/CodeGen/TargetFrameLowering.h"
3232 #include "llvm/Target/TargetMachine.h"
3333
3434 namespace llvm {
99 #ifndef LLVM_AVR_FRAME_LOWERING_H
1010 #define LLVM_AVR_FRAME_LOWERING_H
1111
12 #include "llvm/Target/TargetFrameLowering.h"
12 #include "llvm/CodeGen/TargetFrameLowering.h"
1313
1414 namespace llvm {
1515
1717 #include "llvm/CodeGen/MachineFunction.h"
1818 #include "llvm/CodeGen/MachineInstrBuilder.h"
1919 #include "llvm/IR/Function.h"
20 #include "llvm/Target/TargetFrameLowering.h"
20 #include "llvm/CodeGen/TargetFrameLowering.h"
2121
2222 #include "AVR.h"
2323 #include "AVRInstrInfo.h"
1313 #ifndef LLVM_LIB_TARGET_BPF_BPFFRAMELOWERING_H
1414 #define LLVM_LIB_TARGET_BPF_BPFFRAMELOWERING_H
1515
16 #include "llvm/Target/TargetFrameLowering.h"
16 #include "llvm/CodeGen/TargetFrameLowering.h"
1717
1818 namespace llvm {
1919 class BPFSubtarget;
1919 #include "llvm/CodeGen/RegisterScavenging.h"
2020 #include "llvm/IR/DiagnosticInfo.h"
2121 #include "llvm/Support/ErrorHandling.h"
22 #include "llvm/Target/TargetFrameLowering.h"
22 #include "llvm/CodeGen/TargetFrameLowering.h"
2323 #include "llvm/Target/TargetInstrInfo.h"
2424
2525 #define GET_REGINFO_TARGET_DESC
1414 #include "llvm/ADT/STLExtras.h"
1515 #include "llvm/CodeGen/MachineBasicBlock.h"
1616 #include "llvm/CodeGen/MachineFrameInfo.h"
17 #include "llvm/Target/TargetFrameLowering.h"
17 #include "llvm/CodeGen/TargetFrameLowering.h"
1818 #include
1919
2020 namespace llvm {
1414 #define LLVM_LIB_TARGET_LANAI_LANAIFRAMELOWERING_H
1515
1616 #include "Lanai.h"
17 #include "llvm/Target/TargetFrameLowering.h"
17 #include "llvm/CodeGen/TargetFrameLowering.h"
1818
1919 namespace llvm {
2020
2222 #include "llvm/IR/Function.h"
2323 #include "llvm/IR/Type.h"
2424 #include "llvm/Support/ErrorHandling.h"
25 #include "llvm/Target/TargetFrameLowering.h"
25 #include "llvm/CodeGen/TargetFrameLowering.h"
2626 #include "llvm/Target/TargetInstrInfo.h"
2727
2828 #define GET_REGINFO_TARGET_DESC
1818 #include "LanaiInstrInfo.h"
1919 #include "LanaiSelectionDAGInfo.h"
2020 #include "llvm/IR/DataLayout.h"
21 #include "llvm/Target/TargetFrameLowering.h"
21 #include "llvm/CodeGen/TargetFrameLowering.h"
2222 #include "llvm/Target/TargetMachine.h"
2323 #include "llvm/Target/TargetSubtargetInfo.h"
2424
1818 #include "LanaiInstrInfo.h"
1919 #include "LanaiSelectionDAGInfo.h"
2020 #include "LanaiSubtarget.h"
21 #include "llvm/Target/TargetFrameLowering.h"
21 #include "llvm/CodeGen/TargetFrameLowering.h"
2222 #include "llvm/Target/TargetMachine.h"
2323
2424 namespace llvm {
1414 #define LLVM_LIB_TARGET_MSP430_MSP430FRAMELOWERING_H
1515
1616 #include "MSP430.h"
17 #include "llvm/Target/TargetFrameLowering.h"
17 #include "llvm/CodeGen/TargetFrameLowering.h"
1818
1919 namespace llvm {
2020 class MSP430FrameLowering : public TargetFrameLowering {
1515 #define LLVM_LIB_TARGET_MSP430_MSP430TARGETMACHINE_H
1616
1717 #include "MSP430Subtarget.h"
18 #include "llvm/Target/TargetFrameLowering.h"
18 #include "llvm/CodeGen/TargetFrameLowering.h"
1919 #include "llvm/Target/TargetMachine.h"
2020
2121 namespace llvm {
2929 #include "llvm/MC/MCRegisterInfo.h"
3030 #include "llvm/MC/MachineLocation.h"
3131 #include "llvm/Support/MathExtras.h"
32 #include "llvm/Target/TargetFrameLowering.h"
32 #include "llvm/CodeGen/TargetFrameLowering.h"
3333 #include
3434 #include
3535 #include
2828 #include "llvm/Support/Debug.h"
2929 #include "llvm/Support/ErrorHandling.h"
3030 #include "llvm/Support/raw_ostream.h"
31 #include "llvm/Target/TargetFrameLowering.h"
31 #include "llvm/CodeGen/TargetFrameLowering.h"
3232 #include "llvm/Target/TargetInstrInfo.h"
3333 #include "llvm/Target/TargetMachine.h"
3434 #include "llvm/Target/TargetOptions.h"
1414 #define LLVM_LIB_TARGET_MIPS_MIPSFRAMELOWERING_H
1515
1616 #include "Mips.h"
17 #include "llvm/Target/TargetFrameLowering.h"
17 #include "llvm/CodeGen/TargetFrameLowering.h"
1818
1919 namespace llvm {
2020 class MipsSubtarget;
6161 #include "llvm/Support/Compiler.h"
6262 #include "llvm/Support/ErrorHandling.h"
6363 #include "llvm/Support/MathExtras.h"
64 #include "llvm/Target/TargetFrameLowering.h"
64 #include "llvm/CodeGen/TargetFrameLowering.h"
6565 #include "llvm/Target/TargetInstrInfo.h"
6666 #include "llvm/Target/TargetMachine.h"
6767 #include "llvm/Target/TargetOptions.h"
2727 #include "llvm/Support/Debug.h"
2828 #include "llvm/Support/ErrorHandling.h"
2929 #include "llvm/Support/raw_ostream.h"
30 #include "llvm/Target/TargetFrameLowering.h"
30 #include "llvm/CodeGen/TargetFrameLowering.h"
3131 #include "llvm/Target/TargetRegisterInfo.h"
3232 #include "llvm/Target/TargetSubtargetInfo.h"
3333 #include
2929 #include "llvm/Support/Debug.h"
3030 #include "llvm/Support/ErrorHandling.h"
3131 #include "llvm/Support/raw_ostream.h"
32 #include "llvm/Target/TargetFrameLowering.h"
32 #include "llvm/CodeGen/TargetFrameLowering.h"
3333 #include "llvm/Target/TargetInstrInfo.h"
3434 #include "llvm/Target/TargetMachine.h"
3535 #include "llvm/Target/TargetOptions.h"
1313 #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXFRAMELOWERING_H
1414 #define LLVM_LIB_TARGET_NVPTX_NVPTXFRAMELOWERING_H
1515
16 #include "llvm/Target/TargetFrameLowering.h"
16 #include "llvm/CodeGen/TargetFrameLowering.h"
1717
1818 namespace llvm {
1919 class NVPTXSubtarget;
1919 #include "llvm/Pass.h"
2020 #include "llvm/Support/Debug.h"
2121 #include "llvm/Support/raw_ostream.h"
22 #include "llvm/Target/TargetFrameLowering.h"
22 #include "llvm/CodeGen/TargetFrameLowering.h"
2323 #include "llvm/Target/TargetRegisterInfo.h"
2424 #include "llvm/Target/TargetSubtargetInfo.h"
2525
1616 #include "ManagedStringPool.h"
1717 #include "NVPTXSubtarget.h"
1818 #include "llvm/CodeGen/SelectionDAGTargetInfo.h"
19 #include "llvm/Target/TargetFrameLowering.h"
19 #include "llvm/CodeGen/TargetFrameLowering.h"
2020 #include "llvm/Target/TargetMachine.h"
2121
2222 namespace llvm {
1313 #define LLVM_LIB_TARGET_NIOS2_NIOS2FRAMELOWERING_H
1414
1515 #include "Nios2.h"
16 #include "llvm/Target/TargetFrameLowering.h"
16 #include "llvm/CodeGen/TargetFrameLowering.h"
1717
1818 namespace llvm {
1919 class Nios2Subtarget;
2121 #include "llvm/CodeGen/MachineRegisterInfo.h"
2222 #include "llvm/CodeGen/Passes.h"
2323 #include "llvm/Support/Debug.h"
24 #include "llvm/Target/TargetFrameLowering.h"
24 #include "llvm/CodeGen/TargetFrameLowering.h"
2525 #include "llvm/Target/TargetInstrInfo.h"
2626 #include "llvm/Target/TargetSubtargetInfo.h"
2727
1414
1515 #include "PPC.h"
1616 #include "llvm/ADT/STLExtras.h"
17 #include "llvm/Target/TargetFrameLowering.h"
17 #include "llvm/CodeGen/TargetFrameLowering.h"
1818 #include "llvm/Target/TargetMachine.h"
1919
2020 namespace llvm {
3636 #include "llvm/Support/ErrorHandling.h"
3737 #include "llvm/Support/MathExtras.h"
3838 #include "llvm/Support/raw_ostream.h"
39 #include "llvm/Target/TargetFrameLowering.h"
39 #include "llvm/CodeGen/TargetFrameLowering.h"
4040 #include "llvm/Target/TargetInstrInfo.h"
4141 #include "llvm/Target/TargetMachine.h"
4242 #include "llvm/Target/TargetOptions.h"
1313 #ifndef LLVM_LIB_TARGET_RISCV_RISCVFRAMELOWERING_H
1414 #define LLVM_LIB_TARGET_RISCV_RISCVFRAMELOWERING_H
1515
16 #include "llvm/Target/TargetFrameLowering.h"
16 #include "llvm/CodeGen/TargetFrameLowering.h"
1717
1818 namespace llvm {
1919 class RISCVSubtarget;
1818 #include "llvm/CodeGen/MachineInstrBuilder.h"
1919 #include "llvm/CodeGen/RegisterScavenging.h"
2020 #include "llvm/Support/ErrorHandling.h"
21 #include "llvm/Target/TargetFrameLowering.h"
21 #include "llvm/CodeGen/TargetFrameLowering.h"
2222 #include "llvm/Target/TargetInstrInfo.h"
2323
2424 #define GET_REGINFO_TARGET_DESC
1414 #define LLVM_LIB_TARGET_SPARC_SPARCFRAMELOWERING_H
1515
1616 #include "Sparc.h"
17 #include "llvm/Target/TargetFrameLowering.h"
17 #include "llvm/CodeGen/TargetFrameLowering.h"
1818
1919 namespace llvm {
2020
1818 #include "SparcInstrInfo.h"
1919 #include "llvm/CodeGen/SelectionDAGTargetInfo.h"
2020 #include "llvm/IR/DataLayout.h"
21 #include "llvm/Target/TargetFrameLowering.h"
21 #include "llvm/CodeGen/TargetFrameLowering.h"
2222 #include "llvm/Target/TargetSubtargetInfo.h"
2323 #include
2424
1010 #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZFRAMELOWERING_H
1111
1212 #include "llvm/ADT/IndexedMap.h"
13 #include "llvm/Target/TargetFrameLowering.h"
13 #include "llvm/CodeGen/TargetFrameLowering.h"
1414
1515 namespace llvm {
1616 class SystemZTargetMachine;
1212 #include "llvm/CodeGen/LiveIntervalAnalysis.h"
1313 #include "llvm/CodeGen/MachineInstrBuilder.h"
1414 #include "llvm/CodeGen/MachineRegisterInfo.h"
15 #include "llvm/Target/TargetFrameLowering.h"
15 #include "llvm/CodeGen/TargetFrameLowering.h"
1616
1717 using namespace llvm;
1818
1515 #ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYFRAMELOWERING_H
1616 #define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYFRAMELOWERING_H
1717
18 #include "llvm/Target/TargetFrameLowering.h"
18 #include "llvm/CodeGen/TargetFrameLowering.h"
1919
2020 namespace llvm {
2121 class MachineFrameInfo;
2323 #include "llvm/CodeGen/MachineRegisterInfo.h"
2424 #include "llvm/IR/Function.h"
2525 #include "llvm/Support/raw_ostream.h"
26 #include "llvm/Target/TargetFrameLowering.h"
26 #include "llvm/CodeGen/TargetFrameLowering.h"
2727 #include "llvm/Target/TargetOptions.h"
2828 using namespace llvm;
2929
1313 #ifndef LLVM_LIB_TARGET_X86_X86FRAMELOWERING_H
1414 #define LLVM_LIB_TARGET_X86_X86FRAMELOWERING_H
1515
16 #include "llvm/Target/TargetFrameLowering.h"
16 #include "llvm/CodeGen/TargetFrameLowering.h"
1717
1818 namespace llvm {
1919
3232 #include "llvm/MC/MCAsmInfo.h"
3333 #include "llvm/Support/CommandLine.h"
3434 #include "llvm/Support/ErrorHandling.h"
35 #include "llvm/Target/TargetFrameLowering.h"
35 #include "llvm/CodeGen/TargetFrameLowering.h"
3636 #include "llvm/Target/TargetInstrInfo.h"
3737 #include "llvm/Target/TargetMachine.h"
3838 #include "llvm/Target/TargetOptions.h"
1414 #ifndef LLVM_LIB_TARGET_XCORE_XCOREFRAMELOWERING_H
1515 #define LLVM_LIB_TARGET_XCORE_XCOREFRAMELOWERING_H
1616
17 #include "llvm/Target/TargetFrameLowering.h"
17 #include "llvm/CodeGen/TargetFrameLowering.h"
1818 #include "llvm/Target/TargetMachine.h"
1919
2020 namespace llvm {
2929 #include "llvm/Support/ErrorHandling.h"
3030 #include "llvm/Support/MathExtras.h"
3131 #include "llvm/Support/raw_ostream.h"
32 #include "llvm/Target/TargetFrameLowering.h"
32 #include "llvm/CodeGen/TargetFrameLowering.h"
3333 #include "llvm/Target/TargetMachine.h"
3434 #include "llvm/Target/TargetOptions.h"
3535
1111 #include "llvm/CodeGen/MachineModuleInfo.h"
1212 #include "llvm/Support/TargetRegistry.h"
1313 #include "llvm/Support/TargetSelect.h"
14 #include "llvm/Target/TargetFrameLowering.h"
14 #include "llvm/CodeGen/TargetFrameLowering.h"
1515 #include "llvm/Target/TargetInstrInfo.h"
1616 #include "llvm/Target/TargetLowering.h"
1717 #include "llvm/Target/TargetMachine.h"