diff mbox series

[committed] Use scalar_mode in expand_shift_1

Message ID 87po9eyzsv.fsf@linaro.org
State New
Headers show
Series [committed] Use scalar_mode in expand_shift_1 | expand

Commit Message

Richard Sandiford Oct. 23, 2017, 9:32 a.m. UTC
Since this function handles scalar and vector shifts:

  machine_mode scalar_mode = mode;
  if (VECTOR_MODE_P (mode))
    scalar_mode = GET_MODE_INNER (mode);

is equivalent to:

  scalar_mode = GET_MODE_INNER (mode);

Tested on aarch64-linux-gnu, x86_64-linux-gnu and powerpc64le-linux-gnu.
Applied as obvious.

Richard


2017-10-23  Richard Sandiford  <richard.sandiford@linaro.org>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

gcc/
	* expmed.c (expand_shift_1): Use scalar_mode for scalar_mode.
diff mbox series

Patch

Index: gcc/expmed.c
===================================================================
--- gcc/expmed.c	2017-09-23 10:27:39.925846365 +0100
+++ gcc/expmed.c	2017-10-23 10:30:47.246081163 +0100
@@ -2337,12 +2337,10 @@  expand_shift_1 (enum tree_code code, mac
   optab lrotate_optab = rotl_optab;
   optab rrotate_optab = rotr_optab;
   machine_mode op1_mode;
-  machine_mode scalar_mode = mode;
+  scalar_mode scalar_mode = GET_MODE_INNER (mode);
   int attempt;
   bool speed = optimize_insn_for_speed_p ();
 
-  if (VECTOR_MODE_P (mode))
-    scalar_mode = GET_MODE_INNER (mode);
   op1 = amount;
   op1_mode = GET_MODE (op1);