+2014-10-27 Richard Sandiford <richard.sandiford@arm.com>
+
+ * config/i386/i386.c: Include rtl-iter.h
+ (ix86_check_avx256_register): Take a const_rtx and return a bool.
+ (ix86_check_avx256_stores): Update call accordingly.
+ (ix86_avx_u128_mode_entry, ix86_avx_u128_mode_exit): Likewise.
+ (ix86_avx_u128_mode_needed): Likewise. Use FOR_EACH_SUBRTX.
+
2014-10-27 Richard Sandiford <richard.sandiford@arm.com>
* config/alpha/alpha-protos.h (some_small_symbolic_operand_int):
#include "tree-vectorizer.h"
#include "shrink-wrap.h"
#include "builtins.h"
+#include "rtl-iter.h"
static rtx legitimize_dllimport_symbol (rtx, bool);
static rtx legitimize_pe_coff_extern_decl (rtx, bool);
/* Check if a 256bit AVX register is referenced inside of EXP. */
-static int
-ix86_check_avx256_register (rtx *pexp, void *)
+static bool
+ix86_check_avx256_register (const_rtx exp)
{
- rtx exp = *pexp;
-
if (GET_CODE (exp) == SUBREG)
exp = SUBREG_REG (exp);
- if (REG_P (exp)
- && VALID_AVX256_REG_OR_OI_MODE (GET_MODE (exp)))
- return 1;
-
- return 0;
+ return (REG_P (exp)
+ && VALID_AVX256_REG_OR_OI_MODE (GET_MODE (exp)));
}
/* Return needed mode for entity in optimize_mode_switching pass. */
{
rtx arg = XEXP (XEXP (link, 0), 0);
- if (ix86_check_avx256_register (&arg, NULL))
+ if (ix86_check_avx256_register (arg))
return AVX_U128_DIRTY;
}
}
changes state only when a 256bit register is written to, but we need
to prevent the compiler from moving optimal insertion point above
eventual read from 256bit register. */
- if (for_each_rtx (&PATTERN (insn), ix86_check_avx256_register, NULL))
- return AVX_U128_DIRTY;
+ subrtx_iterator::array_type array;
+ FOR_EACH_SUBRTX (iter, array, PATTERN (insn), NONCONST)
+ if (ix86_check_avx256_register (*iter))
+ return AVX_U128_DIRTY;
return AVX_U128_ANY;
}
static void
ix86_check_avx256_stores (rtx dest, const_rtx, void *data)
{
- if (ix86_check_avx256_register (&dest, NULL))
+ if (ix86_check_avx256_register (dest))
{
bool *used = (bool *) data;
*used = true;
{
rtx incoming = DECL_INCOMING_RTL (arg);
- if (incoming && ix86_check_avx256_register (&incoming, NULL))
+ if (incoming && ix86_check_avx256_register (incoming))
return AVX_U128_DIRTY;
}
/* Exit mode is set to AVX_U128_DIRTY if there are
256bit modes used in the function return register. */
- if (reg && ix86_check_avx256_register (®, NULL))
+ if (reg && ix86_check_avx256_register (reg))
return AVX_U128_DIRTY;
return AVX_U128_CLEAN;