/* IRA conflict builder.
- Copyright (C) 2006-2015 Free Software Foundation, Inc.
+ Copyright (C) 2006-2019 Free Software Foundation, Inc.
Contributed by Vladimir Makarov <vmakarov@redhat.com>.
This file is part of GCC.
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include "tm.h"
-#include "regs.h"
-#include "rtl.h"
-#include "tm_p.h"
+#include "backend.h"
#include "target.h"
-#include "flags.h"
-#include "hard-reg-set.h"
+#include "rtl.h"
#include "predict.h"
-#include "vec.h"
-#include "hashtab.h"
-#include "hash-set.h"
-#include "input.h"
-#include "function.h"
-#include "basic-block.h"
+#include "memmodel.h"
+#include "tm_p.h"
#include "insn-config.h"
-#include "recog.h"
-#include "diagnostic-core.h"
+#include "regs.h"
+#include "ira.h"
+#include "ira-int.h"
#include "params.h"
-#include "df.h"
#include "sparseset.h"
-#include "ira-int.h"
#include "addresses.h"
/* This file contains code responsible for allocno conflict creation,
if (REGNO (reg) < FIRST_PSEUDO_REGISTER)
*offset = subreg_regno_offset (REGNO (reg), GET_MODE (reg),
SUBREG_BYTE (x), GET_MODE (x));
- else
- *offset = (SUBREG_BYTE (x) / REGMODE_NATURAL_SIZE (GET_MODE (x)));
+ else if (!can_div_trunc_p (SUBREG_BYTE (x),
+ REGMODE_NATURAL_SIZE (GET_MODE (x)), offset))
+ /* Checked by validate_subreg. We must know at compile time which
+ inner hard registers are being accessed. */
+ gcc_unreachable ();
return reg;
}
if (! IN_RANGE (allocno_preferenced_hard_regno,
0, FIRST_PSEUDO_REGISTER - 1))
- /* Can not be tied. */
+ /* Cannot be tied. */
return false;
rclass = REGNO_REG_CLASS (allocno_preferenced_hard_regno);
mode = ALLOCNO_MODE (a);
return false;
index = ira_class_hard_reg_index[aclass][allocno_preferenced_hard_regno];
if (index < 0)
- /* Can not be tied. It is not in the allocno class. */
+ /* Cannot be tied. It is not in the allocno class. */
return false;
ira_init_register_move_cost_if_necessary (mode);
if (HARD_REGISTER_P (reg1))
ira_object_conflict_iterator oci;
if (OBJECT_CONFLICT_ARRAY (obj) == NULL)
- continue;
+ {
+ fprintf (file, "\n;; total conflict hard regs:\n");
+ fprintf (file, ";; conflict hard regs:\n\n");
+ continue;
+ }
+
if (n > 1)
fprintf (file, "\n;; subobject %d:", i);
FOR_EACH_OBJECT_CONFLICT (obj, conflict_obj, oci)
FOR_EACH_ALLOCNO (a, ai)
print_allocno_conflicts (file, reg_p, a);
+ putc ('\n', file);
}
/* Print information about allocno or only regno (if REG_P) conflicts
for (i = 0; i < n; i++)
{
ira_object_t obj = ALLOCNO_OBJECT (a, i);
+ machine_mode obj_mode = obj->allocno->mode;
rtx allocno_reg = regno_reg_rtx [ALLOCNO_REGNO (a)];
if ((! flag_caller_saves && ALLOCNO_CALLS_CROSSED_NUM (a) != 0)
cannot be accessed in the widest mode. */
machine_mode outer_mode = ALLOCNO_WMODE (a);
machine_mode inner_mode = ALLOCNO_MODE (a);
- if (GET_MODE_SIZE (outer_mode) > GET_MODE_SIZE (inner_mode))
+ if (paradoxical_subreg_p (outer_mode, inner_mode))
{
enum reg_class aclass = ALLOCNO_CLASS (a);
for (int j = ira_class_hard_regs_num[aclass] - 1; j >= 0; --j)
if (outer_regno < 0
|| !in_hard_reg_set_p (reg_class_contents[aclass],
outer_mode, outer_regno))
- SET_HARD_REG_BIT (OBJECT_CONFLICT_HARD_REGS (obj),
- inner_regno);
+ {
+ SET_HARD_REG_BIT (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj),
+ inner_regno);
+ SET_HARD_REG_BIT (OBJECT_CONFLICT_HARD_REGS (obj),
+ inner_regno);
+ }
}
}
regs must conflict with them. */
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
if (!TEST_HARD_REG_BIT (call_used_reg_set, regno)
- && HARD_REGNO_CALL_PART_CLOBBERED (regno,
- obj->allocno->mode))
+ && targetm.hard_regno_call_part_clobbered (NULL, regno,
+ obj_mode))
{
SET_HARD_REG_BIT (OBJECT_CONFLICT_HARD_REGS (obj), regno);
SET_HARD_REG_BIT (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj),