mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-05 10:50:51 +08:00
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
This commit is contained in:
parent
26b14bc192
commit
e01f223f28
@ -1,3 +1,7 @@
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user