Lines Matching defs:stores
21 /* The purpose of the store merging pass is to combine multiple memory stores
23 or bit-field values, to consecutive locations, into fewer wider stores.
25 For example, if we have a sequence peforming four byte stores to
66 These stores can be a result of structure element initializers, array stores
75 2) Analyze the chains of stores recorded in phase 1) (i.e. the vector of
76 store_immediate_info objects) and coalesce contiguous stores into
77 merged_store_group objects. For bit-field stores, we don't need to
78 require the stores to be contiguous, just their surrounding bit regions
80 between adjacent stores, such as one store storing a constant and
84 For example, given the stores:
96 to generate the sequence of wider stores that set the contiguous memory
98 multiple stores per store group to handle contiguous stores that are not
101 We try to emit as wide stores as we can while respecting STRICT_ALIGNMENT
105 Consider 2 contiguous 16-bit stores followed by 2 contiguous 8-bit stores:
122 on little-endian we insert stores to higher (consecutive) bitpositions
126 For big-endian we insert stores to higher bitpositions into the least
174 /* The maximum size (in bits) of the stores this pass should generate. */
1702 /* Struct representing a group of stores to contiguous memory locations.
1704 third phase that outputs the widened stores. */
1729 auto_vec<store_immediate_info *> stores;
1732 track of them separately as 'stores' is reordered by apply_stores. */
2120 stores.create (1);
2121 stores.safe_push (info);
2148 if (info->rhs_code == stores[0]->rhs_code)
2152 if (info->rhs_code == BIT_INSERT_EXPR && stores[0]->rhs_code == INTEGER_CST)
2155 if (stores[0]->rhs_code == BIT_INSERT_EXPR && info->rhs_code == INTEGER_CST)
2158 /* We can turn MEM_REF into BIT_INSERT_EXPR for bit-field stores, but do it
2161 && (stores[0]->rhs_code == INTEGER_CST
2162 || stores[0]->rhs_code == BIT_INSERT_EXPR)
2163 && info->bitregion_start == stores[0]->bitregion_start
2164 && info->bitregion_end == stores[0]->bitregion_end
2168 if (stores[0]->rhs_code == MEM_REF
2171 && info->bitregion_start == stores[0]->bitregion_start
2172 && info->bitregion_end == stores[0]->bitregion_end
2178 && stores[0]->rhs_code == INTEGER_CST
2179 && stores[0]->bitsize == CHAR_BIT)
2182 if (stores[0]->rhs_code == STRING_CST
2223 stores.safe_push (info);
2252 /* But we cannot use it if we don't have consecutive stores. */
2262 stores. */
2290 /* Go through all the recorded stores in this group in program order and
2304 || stores.length () == 1)
2326 stores.qsort (sort_by_order);
2328 FOR_EACH_VEC_ELT (stores, i, info)
2367 fprintf (dump_file, "Failed to merge stores\n");
2372 stores.qsort (sort_by_bitpos);
2468 /* The number of stores currently tracked. */
2512 /* We already checked all the stores in chain_info and terminated the
2560 be able to sink load of REF across stores between FIRST and LAST, up
2604 store_immediate_info *infof = merged_store->stores[0];
2612 store_immediate_info *infol = merged_store->stores.last ();
2635 stores, so no further checks are needed. Example:
2642 of the stores in the group, or any other stores in between those.
2644 merged_store->stores IDX loads, no stmts starting with
2649 /* The stores are sorted by increasing store bitpos, so if info->stmt store
2656 for (store_immediate_info *infoc : merged_store->stores)
2666 for (store_immediate_info *infoc : merged_store->stores)
2714 /* Check if there are any stores in M_STORE_INFO after index I
2718 all the stores already merged and the one under consideration
2719 have rhs_code of INTEGER_CST. Return true if there are no such stores.
2735 into the group and merging of those 3 stores is successful, merged
2743 INTEGER_CST stores, those are mergeable using merge_overlapping,
2746 Similarly, check stores from FIRST_EARLIER (inclusive) to END_EARLIER
3016 /* Go through the candidate stores recorded in m_store_info and merge them
3018 representing the widened stores. Return true if coalescing was successful
3019 and the number of widened stores is fewer than the original number
3020 of stores. */
3030 fprintf (dump_file, "Attempting to coalesce %u stores in chain\n",
3038 /* Order the stores by the bitposition they write to. */
3059 /* First try to handle group of stores like:
3066 && merged_store->stores.length () == 1
3067 && merged_store->stores[0]->ins_stmt != NULL
3079 ignore = i + merged_store->stores.length () - 1;
3104 Overlapping stores. */
3108 Handle also the consecutive INTEGER_CST stores case here,
3115 /* Only allow overlapping stores of constants. */
3132 overlapping stores with non-INTEGER_CST rhs_code
3133 in between the first and last of the stores we've
3135 stores in between, we need to merge_overlapping them
3137 overlapping stores in between. Keep those stores as is.
3147 we can't merge with them. We can merge the first 3 stores
3175 then we need to process more stores than
3221 merge some further INTEGER_CST stores. */
3260 /* Other stores are kept and not merged in any
3272 the stores, but there can't be gaps in between bitregions. */
3276 store_immediate_info *infof = merged_store->stores[0];
3300 /* Turn MEM_REF into BIT_INSERT_EXPR for bit-field stores. */
3309 for (store_immediate_info *infoj : merged_store->stores)
3331 Gap between stores or the rhs not compatible. Start a new group. */
3333 /* Try to apply all the stores recorded for the group to determine
3373 fprintf (dump_file, "Coalescing successful!\nMerged into %u stores\n",
3379 /* Return the type to use for the merged stores or loads described by STMTS.
3439 regularly-sized stores in split_group. */
3464 /* Record all stores in GROUP that write to the region starting at BITPOS and
3465 is of size BITSIZE. Record infos for such statements in STORES if
3466 non-NULL. The stores in GROUP must be sorted by bitposition. Return INFO
3472 vec<store_immediate_info *> *stores,
3482 for (i = *first; group->stores.iterate (i, &info); ++i)
3491 Only do it if all stores before this one also pass this. */
3499 /* The stores in GROUP are ordered by bitposition so if we're past
3506 if (stores)
3507 stores->safe_push (info);
3512 if (stores)
3514 stores->safe_push (info);
3611 Return number of new stores.
3612 If ALLOW_UNALIGNED_STORE is false, then all stores must be aligned.
3616 unmodified and emit further stores for the overrides only.
3618 new stores. */
3637 /* For bswap framework using sets of stores, all the checking has been done
3640 if (group->stores[0]->rhs_code == LROTATE_EXPR
3641 || group->stores[0]->rhs_code == NOP_EXPR
3678 store_immediate_info *info = group->stores[0];
3682 info = group->stores[0];
3697 total_orig[0] *= group->stores.length ();
3699 FOR_EACH_VEC_ELT (group->stores, i, info)
3716 FOR_EACH_VEC_ELT (group->stores, first, gstore)
3756 /* If we can't do or don't want to do unaligned stores
3768 - group->stores[0]->bitpos
3769 + group->stores[0]->ops[i].bitpos
3901 /* If we are reusing some original stores and any of the
3911 store_immediate_info *info = group->stores[0];
3993 clear regions with !bit_not_p, so that gaps in between stores aren't
4050 unaligned stores for STRICT_ALIGNMENT targets or if it's too expensive.
4060 unsigned int orig_num_stmts = group->stores.length ();
4070 if (group->stores[0]->rhs_code == INTEGER_CST)
4073 FOR_EACH_VEC_ELT (group->stores, i, store)
4088 FOR_EACH_VEC_ELT_FROM (group->stores, i, store, i)
4097 /* If unaligned stores are allowed, see how many stores we'd emit
4098 for unaligned and how many stores we'd emit for aligned stores.
4099 Only use unaligned stores if it allows fewer stores than aligned.
4102 further stores. */
4130 followed by proposed split stores that cover the whole group. In that
4135 && gimple_clobber_p (group->stores[0]->stmt)
4136 && group->start == group->stores[0]->bitpos
4137 && group->width == group->stores[0]->bitsize
4180 if (group->stores[0]->rhs_code == INTEGER_CST)
4193 FOR_EACH_VEC_ELT (group->stores, i, store)
4198 if (cnt == group->stores.length ())
4225 if (group->stores[0]->rhs_code == LROTATE_EXPR
4226 || group->stores[0]->rhs_code == NOP_EXPR)
4229 gimple *ins_stmt = group->stores[0]->ins_stmt;
4230 struct symbolic_number *n = &group->stores[0]->n;
4231 bool bswap = group->stores[0]->rhs_code == LROTATE_EXPR;
4291 store_operand_info &op = group->stores[0]->ops[j];
4295 store_immediate_info *infol = group->stores.last ();
4311 FOR_EACH_VEC_ELT (group->stores, i, info)
4639 provably uninitialized (no stores at all yet or previous
4705 "New sequence of %u stores to replace old one of %u stores\n",
4716 /* We're going to insert a sequence of (potentially) throwing stores
4778 The stores are all against the base object BASE.
4779 Try to output the widened stores and delete the original statements if
4795 FOR_EACH_VEC_ELT (merged_store->stores, j, store)
4830 fprintf (dump_file, "Terminating chain with %u stores\n",
4990 address-taken to be able to emit pointer-based stores to it.
5280 /* If we reach the limit of stores to merge in a chain terminate and
5326 fprintf (dump_file, "Too many chains (%u > %d) or stores (%u > %d), "
5419 immediate stores. Upon encountering a terminating statement (as defined
5420 by stmt_terminates_chain_p) process the recorded stores and emit the widened
5431 to merge stores across different basic blocks so we need to first unsplit