diff options
author | Martin Jambor <mjambor@suse.cz> | 2017-07-31 14:43:24 +0200 |
---|---|---|
committer | Martin Jambor <mjambor@suse.cz> | 2017-07-31 14:43:24 +0200 |
commit | b32f12dece884f1fa0f04c643a77105aff6ce8bc (patch) | |
tree | cdab5f10806561fc198f907299b0e55eb5701ef0 /gcc/tree-data-ref.h | |
parent | 166bec868d991fdf71f9a66f994e5977fcab4aa2 (diff) | |
parent | a168a775e93ec31ae743ad282d8e60fa1c116891 (diff) | |
download | gcc-gcn.tar.gz |
Merge branch 'master' into gcngcn
Diffstat (limited to 'gcc/tree-data-ref.h')
-rw-r--r-- | gcc/tree-data-ref.h | 63 |
1 files changed, 58 insertions, 5 deletions
diff --git a/gcc/tree-data-ref.h b/gcc/tree-data-ref.h index 0013049053f..1559cd90bd2 100644 --- a/gcc/tree-data-ref.h +++ b/gcc/tree-data-ref.h @@ -52,9 +52,49 @@ struct innermost_loop_behavior tree init; tree step; - /* Alignment information. ALIGNED_TO is set to the largest power of two - that divides OFFSET. */ - tree aligned_to; + /* BASE_ADDRESS is known to be misaligned by BASE_MISALIGNMENT bytes + from an alignment boundary of BASE_ALIGNMENT bytes. For example, + if we had: + + struct S __attribute__((aligned(16))) { ... }; + + char *ptr; + ... *(struct S *) (ptr - 4) ...; + + the information would be: + + base_address: ptr + base_aligment: 16 + base_misalignment: 4 + init: -4 + + where init cancels the base misalignment. If instead we had a + reference to a particular field: + + struct S __attribute__((aligned(16))) { ... int f; ... }; + + char *ptr; + ... ((struct S *) (ptr - 4))->f ...; + + the information would be: + + base_address: ptr + base_aligment: 16 + base_misalignment: 4 + init: -4 + offsetof (S, f) + + where base_address + init might also be misaligned, and by a different + amount from base_address. */ + unsigned int base_alignment; + unsigned int base_misalignment; + + /* The largest power of two that divides OFFSET, capped to a suitably + high value if the offset is zero. This is a byte rather than a bit + quantity. */ + unsigned int offset_alignment; + + /* Likewise for STEP. */ + unsigned int step_alignment; }; /* Describes the evolutions of indices of the memory reference. The indices @@ -143,7 +183,10 @@ struct data_reference #define DR_INIT(DR) (DR)->innermost.init #define DR_STEP(DR) (DR)->innermost.step #define DR_PTR_INFO(DR) (DR)->alias.ptr_info -#define DR_ALIGNED_TO(DR) (DR)->innermost.aligned_to +#define DR_BASE_ALIGNMENT(DR) (DR)->innermost.base_alignment +#define DR_BASE_MISALIGNMENT(DR) (DR)->innermost.base_misalignment +#define DR_OFFSET_ALIGNMENT(DR) (DR)->innermost.offset_alignment +#define DR_STEP_ALIGNMENT(DR) (DR)->innermost.step_alignment #define DR_INNERMOST(DR) (DR)->innermost typedef struct data_reference *data_reference_p; @@ -322,7 +365,7 @@ typedef struct data_dependence_relation *ddr_p; #define DDR_REVERSED_P(DDR) (DDR)->reversed_p -bool dr_analyze_innermost (struct data_reference *, struct loop *); +bool dr_analyze_innermost (innermost_loop_behavior *, tree, struct loop *); extern bool compute_data_dependences_for_loop (struct loop *, bool, vec<loop_p> *, vec<data_reference_p> *, @@ -362,6 +405,16 @@ extern bool compute_all_dependences (vec<data_reference_p> , vec<loop_p>, bool); extern tree find_data_references_in_bb (struct loop *, basic_block, vec<data_reference_p> *); +extern unsigned int dr_alignment (innermost_loop_behavior *); + +/* Return the alignment in bytes that DR is guaranteed to have at all + times. */ + +inline unsigned int +dr_alignment (data_reference *dr) +{ + return dr_alignment (&DR_INNERMOST (dr)); +} extern bool dr_may_alias_p (const struct data_reference *, const struct data_reference *, bool); |