Commit e01f223f by Dominik Vogt Committed by Andreas Krebbel

combine: Omit redundant AND in change_zero_ext.

This is another micro-optimisation in change_zero_ext.  If an

  (and (lshiftrt ... (N)) (M))

generated by change_zero_ext is equivalent to just

  (lshiftrt ... (N))

(because the AND constant selects the N rightmost bits of the
result), strip off the AND.

gcc/ChangeLog:

2016-12-19  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	* combine.c (change_zero_ext): Skip generation of redundant AND.

From-SVN: r243792
parent 26b14bc1
2016-12-19 Dominik Vogt <vogt@linux.vnet.ibm.com>
* combine.c (change_zero_ext): Skip generation of redundant AND.
2016-12-19 Krister Walfridsson <krister.walfridsson@gmail.com>
* config/netbsd.h (LINK_EH_SPEC): Define.
......@@ -11289,8 +11289,13 @@ change_zero_ext (rtx pat)
else
continue;
wide_int mask = wi::mask (size, false, GET_MODE_PRECISION (mode));
x = gen_rtx_AND (mode, x, immed_wide_int_const (mask, mode));
if (!(GET_CODE (x) == LSHIFTRT
&& CONST_INT_P (XEXP (x, 1))
&& size + INTVAL (XEXP (x, 1)) == GET_MODE_PRECISION (mode)))
{
wide_int mask = wi::mask (size, false, GET_MODE_PRECISION (mode));
x = gen_rtx_AND (mode, x, immed_wide_int_const (mask, mode));
}
SUBST (**iter, x);
changed = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment