summaryrefslogtreecommitdiff
path: root/gcc/poly-int-types.h
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-12-20 12:56:50 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-12-20 12:56:50 +0000
commit8a91d5455313fb3c4fc07935d848921012cb297f (patch)
treec67e2c4060eba6622d9a7853ef5030b77da88297 /gcc/poly-int-types.h
parent7df9b6f12abfa68c13d9485855dbe22da3167d49 (diff)
poly_int: store merging
This patch makes pass_store_merging track polynomial sizes and offsets. store_immediate_info remains restricted to stores with a constant offset and size. 2017-12-20 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * poly-int-types.h (round_down_to_byte_boundary): New macro. (round_up_to_byte_boundary): Likewise. * expr.h (get_bit_range): Add temporary shim. * gimple-ssa-store-merging.c (store_operand_info): Change the bitsize, bitpos, bitregion_start and bitregion_end fields from unsigned HOST_WIDE_INT to poly_uint64. (merged_store_group): Likewise load_align_base. (compatible_load_p, compatible_load_p): Update accordingly. (imm_store_chain_info::coalesce_immediate_stores): Likewise. (split_group, imm_store_chain_info::output_merged_store): Likewise. (mem_valid_for_store_merging): Return the bitsize, bitpos, bitregion_start and bitregion_end as poly_uint64s rather than unsigned HOST_WIDE_INTs. Track polynomial offsets internally. (handled_load): Take the bitsize, bitpos, bitregion_start and bitregion_end as poly_uint64s rather than unsigned HOST_WIDE_INTs. (pass_store_merging::process_store): Update call to mem_valid_for_store_merging. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r255894
Diffstat (limited to 'gcc/poly-int-types.h')
-rw-r--r--gcc/poly-int-types.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/poly-int-types.h b/gcc/poly-int-types.h
index 1c62ff88ff7..d681c374fc1 100644
--- a/gcc/poly-int-types.h
+++ b/gcc/poly-int-types.h
@@ -60,6 +60,18 @@ typedef poly_int<NUM_POLY_INT_COEFFS, widest_int> poly_widest_int;
of bytes in size. */
#define num_trailing_bits(X) force_get_misalignment (X, BITS_PER_UNIT)
+/* Round bit quantity X down to the nearest byte boundary.
+
+ This is safe because non-constant mode sizes must be a whole number
+ of bytes in size. */
+#define round_down_to_byte_boundary(X) force_align_down (X, BITS_PER_UNIT)
+
+/* Round bit quantity X up the nearest byte boundary.
+
+ This is safe because non-constant mode sizes must be a whole number
+ of bytes in size. */
+#define round_up_to_byte_boundary(X) force_align_up (X, BITS_PER_UNIT)
+
/* Return the size of an element in a vector of size SIZE, given that
the vector has NELTS elements. The return value is in the same units
as SIZE (either bits or bytes).