#include "coretypes.h"
#include "tm.h"
#include "tree.h"
+#include "stor-layout.h"
#include "tm_p.h"
#include "basic-block.h"
#include "tree-pretty-print.h"
fprintf (file, "(base ");
print_generic_expr (file, base, TDF_SLIM);
fprintf (file, ", step ");
- if (cst_and_fits_in_hwi (step))
+ if (cst_fits_shwi_p (step))
fprintf (file, HOST_WIDE_INT_PRINT_DEC, int_cst_value (step));
else
print_generic_expr (file, step, TDF_TREE);
/* If step is an integer constant, keep the list of groups sorted
by decreasing step. */
- if (cst_and_fits_in_hwi ((*groups)->step) && cst_and_fits_in_hwi (step)
+ if (cst_fits_shwi_p ((*groups)->step) && cst_fits_shwi_p (step)
&& int_cst_value ((*groups)->step) < int_cst_value (step))
break;
}
step = iv.step;
if (TREE_CODE (ibase) == POINTER_PLUS_EXPR
- && cst_and_fits_in_hwi (TREE_OPERAND (ibase, 1)))
+ && cst_fits_shwi_p (TREE_OPERAND (ibase, 1)))
{
idelta = int_cst_value (TREE_OPERAND (ibase, 1));
ibase = TREE_OPERAND (ibase, 0);
}
- if (cst_and_fits_in_hwi (ibase))
+ if (cst_fits_shwi_p (ibase))
{
idelta += int_cst_value (ibase);
ibase = build_int_cst (TREE_TYPE (ibase), 0);
if (TREE_CODE (base) == ARRAY_REF)
{
stepsize = array_ref_element_size (base);
- if (!cst_and_fits_in_hwi (stepsize))
+ if (!cst_fits_shwi_p (stepsize))
return false;
imult = int_cst_value (stepsize);
step = fold_build2 (MULT_EXPR, sizetype,
/* Limit non-constant step prefetching only to the innermost loops and
only when the step is loop invariant in the entire loop nest. */
- if (!cst_and_fits_in_hwi (step))
+ if (!cst_fits_shwi_p (step))
{
if (loop->inner != NULL)
{
bool backward;
/* If the step size is non constant, we cannot calculate prefetch_mod. */
- if (!cst_and_fits_in_hwi (ref->group->step))
+ if (!cst_fits_shwi_p (ref->group->step))
return;
step = int_cst_value (ref->group->step);
int align_unit;
/* If the step is non constant we cannot calculate prefetch_before. */
- if (!cst_and_fits_in_hwi (ref->group->step)) {
+ if (!cst_fits_shwi_p (ref->group->step)) {
return;
}
for (ap = 0; ap < n_prefetches; ap++)
{
- if (cst_and_fits_in_hwi (ref->group->step))
+ if (cst_fits_shwi_p (ref->group->step))
{
/* Determine the address to prefetch. */
delta = (ahead + ap * ref->prefetch_mod) *
FOR_EACH_VEC_ELT (exits, i, exit)
if ((exit->flags & EDGE_ABNORMAL)
- && exit->dest == EXIT_BLOCK_PTR)
+ && exit->dest == EXIT_BLOCK_PTR_FOR_FN (cfun))
ret = false;
exits.release ();
if ((unsigned) loop_depth (aloop) <= min_depth)
continue;
- if (host_integerp (step, 0))
- astep = tree_low_cst (step, 0);
+ if (tree_fits_shwi_p (step))
+ astep = tree_to_shwi (step);
else
astep = L1_CACHE_LINE_SIZE;
if (TREE_CODE (ref) == ARRAY_REF)
{
stride = TYPE_SIZE_UNIT (TREE_TYPE (ref));
- if (host_integerp (stride, 1))
- astride = tree_low_cst (stride, 1);
+ if (tree_fits_uhwi_p (stride))
+ astride = tree_to_uhwi (stride);
else
astride = L1_CACHE_LINE_SIZE;
unsigned int
tree_ssa_prefetch_arrays (void)
{
- loop_iterator li;
struct loop *loop;
bool unrolled = false;
int todo_flags = 0;
here. */
gcc_assert ((PREFETCH_BLOCK & (PREFETCH_BLOCK - 1)) == 0);
- FOR_EACH_LOOP (li, loop, LI_FROM_INNERMOST)
+ FOR_EACH_LOOP (loop, LI_FROM_INNERMOST)
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "Processing loop %d:\n", loop->num);