path: root/ir/be/benode.h
diff options
authorMatthias Braun <>2016-02-15 02:04:32 +0100
committerMatthias Braun <>2016-04-04 00:20:12 +0200
commitb6787e36eb0d99eb28f4fb478932e0c9ed094e90 (patch)
tree6ebad7cccab3ec6cf31ed7ce87ac3b9139f5d04f /ir/be/benode.h
parentf2b6fca42c0970aa27fcdc5657968995b818a477 (diff)
be: Rewrite stack frame handling
This is a bigger rewrite of stack frame handling in the backend: - Do the stack frame type layout late, after all the spill slots have been created. This way we can avoid (and remove) the brittle frame_alloc_area(). - Standardize the meaning of stack entity offsets. After stack frame type layout they are relative to the stack pointer position at the beginning of the function. It is all in one type now, no splitting into "arg", "between" and "stack_frame" type anymore. - Generalize the stack pointer simulation code to work with a single callback. Represent stack state as current offset and align_padding number. Now that callbacks can access and modify them both we do not need custom code in the sparc backend anymore. - Remove alignment specification on IncSP, only keep a ignore_align flag used for the last IncSP that has to remove all existing sp adjustments and may end up on a misaligned SP on ia32/amd64. - Align stack by default on ia32+amd64 backends.
Diffstat (limited to 'ir/be/benode.h')
1 files changed, 3 insertions, 6 deletions
diff --git a/ir/be/benode.h b/ir/be/benode.h
index 97c2d10..20d1c13 100644
--- a/ir/be/benode.h
+++ b/ir/be/benode.h
@@ -114,14 +114,13 @@ enum {
* (negative offset). Note that the offset is independent of the
* natural stack direction of the architecture but just specifies
* abstract expanding/shrinking of the stack area.
- * @param align force stack alignment to this power of 2. (i.e. specifying 4
- * results in a 2**4 = 16 bytes stack alignment)
+ * @param no_align Ignore SP alignment requirements.
* @return A new stack pointer increment/decrement node.
* @note This node sets a register constraint to the @p sp register on
* its output.
ir_node *be_new_IncSP(const arch_register_t *sp, ir_node *block,
- ir_node *old_sp, int offset, unsigned align);
+ ir_node *old_sp, int offset, bool no_align);
/** Returns the previous node that computes the stack pointer. */
ir_node *be_get_IncSP_pred(ir_node *incsp);
@@ -139,9 +138,7 @@ void be_set_IncSP_offset(ir_node *irn, int offset);
/** Gets the offset from a IncSP node. */
int be_get_IncSP_offset(const ir_node *irn);
-/** Return requested stack alignment (as a logarithm of two, i.e. 4 means
- * the stack alignment will be 2**4=16 bytes) */
-unsigned be_get_IncSP_align(const ir_node *irn);
+bool be_get_IncSP_no_align(const ir_node *irn);
enum {