diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-05-03 11:09:59 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-05-03 11:09:59 +0000 |
commit | 9a8b9e265b9d0df37bb0cead795c30a01d9da22f (patch) | |
tree | 7d533f06f94bafb5dd09f062d0ef17a1ab83a989 /gcc/tree-ssa-alias.c | |
parent | 91b3c1af6b0d2b459e8a4aaba23680852dbfdb59 (diff) | |
download | gcc-9a8b9e265b9d0df37bb0cead795c30a01d9da22f.tar.gz |
2013-05-03 Richard Biener <rguenther@suse.de>
* double-int.h (lshift): New overload without precision
and arith argument.
(operator *=, operator +=, operator -=): Move ...
* double-int.c (operator *=, operator +=, operator -=): ... here
and implement more efficiently.
(mul_double_with_sign): Remove.
(lshift_double): Adjust to take unsinged shift argument, push
dispatching code to callers.
(mul_double_wide_with_sign): Add early out for callers that
are not interested in high parts or overflow.
(lshift): New function.
(lshift, rshift, alshift, arshift, llshift, lrshift): Add
dispatch code here.
(lrotate, rrotate): Use logical shifts.
* expr.c (get_inner_reference): Use lshift.
* fixed-value.c (do_fixed_divide): Likewise.
* tree-dfa.c (get_ref_base_and_extent): Likewise.
* tree-ssa-alias.c (indirect_ref_may_alias_decl_p): Likewise.
(indirect_refs_may_alias_p): Likewise.
(stmt_kills_ref_p_1): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198576 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r-- | gcc/tree-ssa-alias.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 70e9e008783..971a34763d8 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -882,9 +882,7 @@ indirect_ref_may_alias_decl_p (tree ref1 ATTRIBUTE_UNUSED, tree base1, /* The offset embedded in MEM_REFs can be negative. Bias them so that the resulting offset adjustment is positive. */ moff = mem_ref_offset (base1); - moff = moff.alshift (BITS_PER_UNIT == 8 - ? 3 : exact_log2 (BITS_PER_UNIT), - HOST_BITS_PER_DOUBLE_INT); + moff = moff.lshift (BITS_PER_UNIT == 8 ? 3 : exact_log2 (BITS_PER_UNIT)); if (moff.is_negative ()) offset2p += (-moff).low; else @@ -960,9 +958,7 @@ indirect_ref_may_alias_decl_p (tree ref1 ATTRIBUTE_UNUSED, tree base1, || TREE_CODE (dbase2) == TARGET_MEM_REF) { double_int moff = mem_ref_offset (dbase2); - moff = moff.alshift (BITS_PER_UNIT == 8 - ? 3 : exact_log2 (BITS_PER_UNIT), - HOST_BITS_PER_DOUBLE_INT); + moff = moff.lshift (BITS_PER_UNIT == 8 ? 3 : exact_log2 (BITS_PER_UNIT)); if (moff.is_negative ()) doffset1 -= (-moff).low; else @@ -1056,17 +1052,13 @@ indirect_refs_may_alias_p (tree ref1 ATTRIBUTE_UNUSED, tree base1, /* The offset embedded in MEM_REFs can be negative. Bias them so that the resulting offset adjustment is positive. */ moff = mem_ref_offset (base1); - moff = moff.alshift (BITS_PER_UNIT == 8 - ? 3 : exact_log2 (BITS_PER_UNIT), - HOST_BITS_PER_DOUBLE_INT); + moff = moff.lshift (BITS_PER_UNIT == 8 ? 3 : exact_log2 (BITS_PER_UNIT)); if (moff.is_negative ()) offset2 += (-moff).low; else offset1 += moff.low; moff = mem_ref_offset (base2); - moff = moff.alshift (BITS_PER_UNIT == 8 - ? 3 : exact_log2 (BITS_PER_UNIT), - HOST_BITS_PER_DOUBLE_INT); + moff = moff.lshift (BITS_PER_UNIT == 8 ? 3 : exact_log2 (BITS_PER_UNIT)); if (moff.is_negative ()) offset1 += (-moff).low; else @@ -2014,14 +2006,12 @@ stmt_kills_ref_p_1 (gimple stmt, ao_ref *ref) TREE_OPERAND (ref->base, 0))) { double_int off1 = mem_ref_offset (base); - off1 = off1.alshift (BITS_PER_UNIT == 8 - ? 3 : exact_log2 (BITS_PER_UNIT), - HOST_BITS_PER_DOUBLE_INT); + off1 = off1.lshift (BITS_PER_UNIT == 8 + ? 3 : exact_log2 (BITS_PER_UNIT)); off1 = off1 + double_int::from_shwi (offset); double_int off2 = mem_ref_offset (ref->base); - off2 = off2.alshift (BITS_PER_UNIT == 8 - ? 3 : exact_log2 (BITS_PER_UNIT), - HOST_BITS_PER_DOUBLE_INT); + off2 = off2.lshift (BITS_PER_UNIT == 8 + ? 3 : exact_log2 (BITS_PER_UNIT)); off2 = off2 + double_int::from_shwi (ref_offset); if (off1.fits_shwi () && off2.fits_shwi ()) { |