diff options
author | Lawrence Crowl <crowl@google.com> | 2012-09-07 00:06:35 +0000 |
---|---|---|
committer | Lawrence Crowl <crowl@gcc.gnu.org> | 2012-09-07 00:06:35 +0000 |
commit | 27bcd47cfab04b1b1e6d2712e34b9b289c7a2dd7 (patch) | |
tree | 82231821d6793cd33f15d6b9792a8b82f2ec15d1 /gcc/tree-ssa-alias.c | |
parent | 316b938ed79ef024177ab82057a061a7a4b5af67 (diff) | |
download | gcc-27bcd47cfab04b1b1e6d2712e34b9b289c7a2dd7.zip gcc-27bcd47cfab04b1b1e6d2712e34b9b289c7a2dd7.tar.gz gcc-27bcd47cfab04b1b1e6d2712e34b9b289c7a2dd7.tar.bz2 |
Modify gcc/*.[hc] double_int call sites to use the new interface.
This change entailed adding a few new methods to double_int.
The change results in a 0.163% time improvement with a 70% confidence.
Tested on x86_64.
Index: gcc/ChangeLog
2012-09-06 Lawrence Crowl <crowl@google.com>
* double-int.h (double_int::operator &=): New.
(double_int::operator ^=): New.
(double_int::operator |=): New.
(double_int::mul_with_sign): Modify overflow parameter to bool*.
(double_int::add_with_sign): New.
(double_int::ule): New.
(double_int::sle): New.
(binary double_int::operator *): Remove parameter name.
(binary double_int::operator +): Likewise.
(binary double_int::operator -): Likewise.
(binary double_int::operator &): Likewise.
(double_int::operator |): Likewise.
(double_int::operator ^): Likewise.
(double_int::and_not): Likewise.
(double_int::from_shwi): Tidy formatting.
(double_int::from_uhwi): Likewise.
(double_int::from_uhwi): Likewise.
* double-int.c (double_int::mul_with_sign): Modify overflow parameter
to bool*.
(double_int::add_with_sign): New.
(double_int::ule): New.
(double_int::sle): New.
* builtins.c: Modify to use the new double_int interface.
* cgraph.c: Likewise.
* combine.c: Likewise.
* dwarf2out.c: Likewise.
* emit-rtl.c: Likewise.
* expmed.c: Likewise.
* expr.c: Likewise.
* fixed-value.c: Likewise.
* fold-const.c: Likewise.
* gimple-fold.c: Likewise.
* gimple-ssa-strength-reduction.c: Likewise.
* gimplify-rtx.c: Likewise.
* ipa-prop.c: Likewise.
* loop-iv.c: Likewise.
* optabs.c: Likewise.
* stor-layout.c: Likewise.
* tree-affine.c: Likewise.
* tree-cfg.c: Likewise.
* tree-dfa.c: Likewise.
* tree-flow-inline.h: Likewise.
* tree-object-size.c: Likewise.
* tree-predcom.c: Likewise.
* tree-pretty-print.c: Likewise.
* tree-sra.c: Likewise.
* tree-ssa-address.c: Likewise.
* tree-ssa-alias.c: Likewise.
* tree-ssa-ccp.c: Likewise.
* tree-ssa-forwprop.c: Likewise.
* tree-ssa-loop-ivopts.c: Likewise.
* tree-ssa-loop-niter.c: Likewise.
* tree-ssa-phiopt.c: Likewise.
* tree-ssa-pre.c: Likewise.
* tree-ssa-sccvn: Likewise.
* tree-ssa-structalias.c: Likewise.
* tree-ssa.c: Likewise.
* tree-switch-conversion.c: Likewise.
* tree-vect-loop-manip.c: Likewise.
* tree-vrp.c: Likewise.
* tree.h: Likewise.
* tree.c: Likewise.
* varasm.c: Likewise.
From-SVN: r191047
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r-- | gcc/tree-ssa-alias.c | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 8d51570..b045da2 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -756,12 +756,11 @@ 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 = double_int_lshift (moff, - BITS_PER_UNIT == 8 - ? 3 : exact_log2 (BITS_PER_UNIT), - HOST_BITS_PER_DOUBLE_INT, true); - if (double_int_negative_p (moff)) - offset2p += double_int_neg (moff).low; + moff = moff.alshift (BITS_PER_UNIT == 8 + ? 3 : exact_log2 (BITS_PER_UNIT), + HOST_BITS_PER_DOUBLE_INT); + if (moff.is_negative ()) + offset2p += (-moff).low; else offset1p += moff.low; @@ -835,12 +834,11 @@ 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 = double_int_lshift (moff, - BITS_PER_UNIT == 8 - ? 3 : exact_log2 (BITS_PER_UNIT), - HOST_BITS_PER_DOUBLE_INT, true); - if (double_int_negative_p (moff)) - doffset1 -= double_int_neg (moff).low; + moff = moff.alshift (BITS_PER_UNIT == 8 + ? 3 : exact_log2 (BITS_PER_UNIT), + HOST_BITS_PER_DOUBLE_INT); + if (moff.is_negative ()) + doffset1 -= (-moff).low; else doffset2 -= moff.low; } @@ -932,21 +930,19 @@ 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 = double_int_lshift (moff, - BITS_PER_UNIT == 8 - ? 3 : exact_log2 (BITS_PER_UNIT), - HOST_BITS_PER_DOUBLE_INT, true); - if (double_int_negative_p (moff)) - offset2 += double_int_neg (moff).low; + moff = moff.alshift (BITS_PER_UNIT == 8 + ? 3 : exact_log2 (BITS_PER_UNIT), + HOST_BITS_PER_DOUBLE_INT); + if (moff.is_negative ()) + offset2 += (-moff).low; else offset1 += moff.low; moff = mem_ref_offset (base2); - moff = double_int_lshift (moff, - BITS_PER_UNIT == 8 - ? 3 : exact_log2 (BITS_PER_UNIT), - HOST_BITS_PER_DOUBLE_INT, true); - if (double_int_negative_p (moff)) - offset1 += double_int_neg (moff).low; + moff = moff.alshift (BITS_PER_UNIT == 8 + ? 3 : exact_log2 (BITS_PER_UNIT), + HOST_BITS_PER_DOUBLE_INT); + if (moff.is_negative ()) + offset1 += (-moff).low; else offset2 += moff.low; return ranges_overlap_p (offset1, max_size1, offset2, max_size2); |