static bool
equiv_can_be_consumed_p (int regno, rtx to, rtx_insn *insn, bool invariant_p)
{
- if (invariant_p)
+ validate_replace_src_group (regno_reg_rtx[regno], to, insn);
+ /* We can change register to equivalent memory in autoinc rtl. Some code
+ including verify_changes assumes that autoinc contains only a register.
+ So check this first. */
+ bool res = validate_autoinc_and_mem_addr_p (PATTERN (insn));
+ if (res)
+ res = verify_changes (0);
+ cancel_changes (0);
+ if (!res && invariant_p)
{
- /* We use more expensive code for the invariant because we need to
+ /* Here we use more expensive code for the invariant because we need to
simplify the result insn as the invariant can be arithmetic rtx
- inserted into another arithmetic rtx. */
+ inserted into another arithmetic rtx, e.g. into memory address. */
rtx pat = PATTERN (insn);
int code = INSN_CODE (insn);
PATTERN (insn) = copy_rtx (pat);
PATTERN (insn)
= simplify_replace_rtx (PATTERN (insn), regno_reg_rtx[regno], to);
- bool res = !insn_invalid_p (insn, false);
+ res = !insn_invalid_p (insn, false);
PATTERN (insn) = pat;
INSN_CODE (insn) = code;
- return res;
}
- validate_replace_src_group (regno_reg_rtx[regno], to, insn);
- /* We can change register to equivalent memory in autoinc rtl. Some code
- including verify_changes assumes that autoinc contains only a register.
- So check this first. */
- bool res = validate_autoinc_and_mem_addr_p (PATTERN (insn));
- if (res)
- res = verify_changes (0);
- cancel_changes (0);
return res;
}