#include "coretypes.h"
#include "backend.h"
#include "rtl.h"
+#include "rtlanal.h"
#include "cfghooks.h"
#include "df.h"
#include "insn-config.h"
/* If we've failed perform the replacement, have a single SET to
a REG destination and don't yet have a note, add a REG_EQUAL note
to not lose information. */
- if (!success && note == 0 && set != 0 && REG_P (SET_DEST (set)))
+ if (!success && note == 0 && set != 0 && REG_P (SET_DEST (set))
+ && !contains_paradoxical_subreg_p (SET_SRC (set)))
note = set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src));
}
#include "coretypes.h"
#include "backend.h"
#include "rtl.h"
+#include "rtlanal.h"
#include "df.h"
#include "rtl-ssa.h"
return REG_P (x) && crtl->ssa->single_dominating_def (REGNO (x));
}
-/* Return true if X contains a paradoxical subreg. */
-
-static bool
-contains_paradoxical_subreg_p (rtx x)
-{
- subrtx_var_iterator::array_type array;
- FOR_EACH_SUBRTX_VAR (iter, array, x, NONCONST)
- {
- x = *iter;
- if (SUBREG_P (x) && paradoxical_subreg_p (x))
- return true;
- }
- return false;
-}
-
/* Try to substitute (set DEST SRC), which defines DEF, into note NOTE of
USE_INSN. Return the number of substitutions on success, otherwise return
-1 and leave USE_INSN unchanged.
}
return false;
}
+
+/* Return true if X contains a paradoxical subreg. */
+
+bool
+contains_paradoxical_subreg_p (rtx x)
+{
+ subrtx_var_iterator::array_type array;
+ FOR_EACH_SUBRTX_VAR (iter, array, x, NONCONST)
+ {
+ x = *iter;
+ if (SUBREG_P (x) && paradoxical_subreg_p (x))
+ return true;
+ }
+ return false;
+}
bool
vec_series_lowpart_p (machine_mode result_mode, machine_mode op_mode, rtx sel);
+bool
+contains_paradoxical_subreg_p (rtx x);
#endif
--- /dev/null
+/* PR target/110206 */
+/* { dg-do run } */
+/* { dg-options "-Os -mavx512bw -mavx512vl" } */
+/* { dg-require-effective-target avx512bw } */
+/* { dg-require-effective-target avx512vl } */
+
+#define AVX512BW
+#define AVX512VL
+
+#include "avx512f-check.h"
+
+typedef unsigned char __attribute__((__vector_size__ (4))) U;
+typedef unsigned char __attribute__((__vector_size__ (8))) V;
+typedef unsigned short u16;
+
+V g;
+
+void
+__attribute__((noinline))
+foo (U u, u16 c, V *r)
+{
+ if (!c)
+ abort ();
+ V x = __builtin_shufflevector (u, (204 >> u), 7, 0, 5, 1, 3, 5, 0, 2);
+ V y = __builtin_shufflevector (g, (V) { }, 7, 6, 6, 7, 2, 6, 3, 5);
+ V z = __builtin_shufflevector (y, 204 * x, 3, 9, 8, 1, 4, 6, 14, 5);
+ *r = z;
+}
+
+static void test_256 (void) { };
+
+static void
+test_128 (void)
+{
+ V r;
+ foo ((U){4}, 5, &r);
+ if (r[6] != 0x30)
+ abort();
+}