summaryrefslogtreecommitdiffhomepage
path: root/ir/tr
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2016-04-25 04:26:07 +0200
committerMatthias Braun <matze@braunis.de>2016-04-25 04:59:30 +0200
commit61c58871191228d7a99cabdc310771edfb2bccdc (patch)
treedcb0f48723e2c1e50be4c3049cb17041eb439411 /ir/tr
parent3bf2c113c41dc79583a9ef34242001d364afb1fe (diff)
bespillslots: Change spillslot collection API to take size+align
Taking explicit size+po2align makes things easier compared to the previously used ir_type: ir_type* is a middleend concept not everything in the backend is represented as a type/mode anymore (x86_insn_size_t). Furthermore we only respected size+alignment of that type anyway, additional semantics would be unexpectedly ignored. It also simplifies the code in some places. This should also naturally fix a problem in 188.amp where we wrongly passed the type for mode_Ls instead of the type for mode_D before.
Diffstat (limited to 'ir/tr')
-rw-r--r--ir/tr/entity.c4
-rw-r--r--ir/tr/entity_t.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/ir/tr/entity.c b/ir/tr/entity.c
index 92e4d64..5fd1d58 100644
--- a/ir/tr/entity.c
+++ b/ir/tr/entity.c
@@ -119,13 +119,13 @@ ir_entity *new_label_entity(ir_label_t label)
}
ir_entity *new_spillslot(ir_type *const frame, unsigned const size,
- unsigned const alignment)
+ unsigned const po2align)
{
assert(is_frame_type(frame));
ir_type *const type = get_unknown_type();
ir_entity *const res = intern_new_entity(frame, IR_ENTITY_SPILLSLOT, NULL,
type, ir_visibility_private);
- set_entity_alignment(res, alignment);
+ set_entity_alignment(res, 1u << po2align);
res->attr.spillslot.base.offset = INVALID_OFFSET;
res->attr.spillslot.size = size;
return res;
diff --git a/ir/tr/entity_t.h b/ir/tr/entity_t.h
index 54ba086..a205d8d 100644
--- a/ir/tr/entity_t.h
+++ b/ir/tr/entity_t.h
@@ -228,7 +228,7 @@ void ir_init_entity(ir_prog *irp);
*/
ir_entity *new_label_entity(ir_label_t label);
-ir_entity *new_spillslot(ir_type *frame, unsigned size, unsigned alignment);
+ir_entity *new_spillslot(ir_type *frame, unsigned size, unsigned po2align);
void set_entity_irg(ir_entity *ent, ir_graph *irg);