summaryrefslogtreecommitdiff
path: root/gcc/lra-constraints.c
diff options
context:
space:
mode:
authorVladimir Makarov <vmakarov@redhat.com>2015-01-30 17:47:44 +0000
committerVladimir Makarov <vmakarov@gcc.gnu.org>2015-01-30 17:47:44 +0000
commit3c954213eb65db35937c2415761827f10f457828 (patch)
treee64c22793a483107ced6784af5070048c977e952 /gcc/lra-constraints.c
parent40fecdd62f7d293a214dd71b81de5e0f1099bba7 (diff)
downloadgcc-3c954213eb65db35937c2415761827f10f457828.tar.gz
re PR target/64617 (ICE: Max. number of generated reload insns per insn is achieved (90) with -ftree-vectorize -mavx512bw -march=slm)
2015-01-30 Vladimir Makarov <vmakarov@redhat.com> PR target/64617 * lra-constraints.c (prohibited_class_reg_set_mode_p): New function. (process_alt_operands): Use it. (curr_insn_transform): Check the optional reload pseudo class is ok for the mode. 2015-01-30 Vladimir Makarov <vmakarov@redhat.com> PR target/64617 * gcc.target/i386/pr64617.c: New test. From-SVN: r220294
Diffstat (limited to 'gcc/lra-constraints.c')
-rw-r--r--gcc/lra-constraints.c51
1 files changed, 32 insertions, 19 deletions
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index 6e4be72fedd..762889ce13c 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -1637,6 +1637,22 @@ reg_in_class_p (rtx reg, enum reg_class cl)
return in_class_p (reg, cl, NULL);
}
+/* Return true if SET of RCLASS contains no hard regs which can be
+ used in MODE. */
+static bool
+prohibited_class_reg_set_mode_p (enum reg_class rclass,
+ HARD_REG_SET &set,
+ enum machine_mode mode)
+{
+ HARD_REG_SET temp;
+
+ lra_assert (hard_reg_set_subset_p (set, reg_class_contents[rclass]));
+ COPY_HARD_REG_SET (temp, set);
+ AND_COMPL_HARD_REG_SET (temp, lra_no_alloc_regs);
+ return (hard_reg_set_subset_p
+ (temp, ira_prohibited_class_mode_regs[rclass][mode]));
+}
+
/* Major function to choose the current insn alternative and what
operands should be reloaded and how. If ONLY_ALTERNATIVE is not
negative we should consider only this alternative. Return false if
@@ -2311,28 +2327,20 @@ process_alt_operands (int only_alternative)
not hold the mode value. */
&& ! HARD_REGNO_MODE_OK (ira_class_hard_regs
[this_alternative][0],
- GET_MODE (*curr_id->operand_loc[nop])))
- {
- HARD_REG_SET temp;
-
- COPY_HARD_REG_SET (temp, this_alternative_set);
- AND_COMPL_HARD_REG_SET (temp, lra_no_alloc_regs);
+ GET_MODE (*curr_id->operand_loc[nop]))
/* The above condition is not enough as the first
reg in ira_class_hard_regs can be not aligned for
multi-words mode values. */
- if (hard_reg_set_subset_p (temp,
- ira_prohibited_class_mode_regs
- [this_alternative]
- [GET_MODE (*curr_id->operand_loc[nop])]))
- {
- if (lra_dump_file != NULL)
- fprintf
- (lra_dump_file,
- " alt=%d: reload pseudo for op %d "
- " can not hold the mode value -- refuse\n",
- nalt, nop);
- goto fail;
- }
+ && (prohibited_class_reg_set_mode_p
+ (this_alternative, this_alternative_set,
+ GET_MODE (*curr_id->operand_loc[nop]))))
+ {
+ if (lra_dump_file != NULL)
+ fprintf (lra_dump_file,
+ " alt=%d: reload pseudo for op %d "
+ " can not hold the mode value -- refuse\n",
+ nalt, nop);
+ goto fail;
}
/* Check strong discouragement of reload of non-constant
@@ -3732,6 +3740,11 @@ curr_insn_transform (bool check_only_p)
&& regno < new_regno_start
&& ! lra_former_scratch_p (regno)
&& reg_renumber[regno] < 0
+ /* Check that the optional reload pseudo will be able to
+ hold given mode value. */
+ && ! (prohibited_class_reg_set_mode_p
+ (goal_alt[i], reg_class_contents[goal_alt[i]],
+ PSEUDO_REGNO_MODE (regno)))
&& (curr_insn_set == NULL_RTX
|| !((REG_P (SET_SRC (curr_insn_set))
|| MEM_P (SET_SRC (curr_insn_set))