if (!ldp_operand_mode_ok_p (mem_mode))
return;
- // Note ldp_operand_mode_ok_p already rejected VL modes.
- const HOST_WIDE_INT mem_size = GET_MODE_SIZE (mem_mode).to_constant ();
-
rtx reg_op = XEXP (PATTERN (insn->rtl ()), !load_p);
+ // Ignore the access if the register operand isn't suitable for ldp/stp.
+ if (load_p
+ ? !aarch64_ldp_reg_operand (reg_op, mem_mode)
+ : !aarch64_stp_reg_operand (reg_op, mem_mode))
+ return;
+
// We want to segregate FP/SIMD accesses from GPR accesses.
//
// Before RA, we use the modes, noting that stores of constant zero
: (GET_MODE_CLASS (mem_mode) != MODE_INT
&& (load_p || !aarch64_const_zero_rtx_p (reg_op)));
+ // Note ldp_operand_mode_ok_p already rejected VL modes.
+ const HOST_WIDE_INT mem_size = GET_MODE_SIZE (mem_mode).to_constant ();
const lfs_fields lfs = { load_p, fpsimd_op_p, mem_size };
if (track_via_mem_expr (insn, mem, lfs))