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-sccvn.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-sccvn.c')
-rw-r--r-- | gcc/tree-ssa-sccvn.c | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index fed7c55..5cc88ae 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -656,13 +656,12 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result) if (TREE_INT_CST_LOW (bit_offset) % BITS_PER_UNIT == 0) { double_int off - = double_int_add (tree_to_double_int (this_offset), - double_int_rshift - (tree_to_double_int (bit_offset), - BITS_PER_UNIT == 8 - ? 3 : exact_log2 (BITS_PER_UNIT), - HOST_BITS_PER_DOUBLE_INT, true)); - if (double_int_fits_in_shwi_p (off)) + = tree_to_double_int (this_offset) + + tree_to_double_int (bit_offset) + .arshift (BITS_PER_UNIT == 8 + ? 3 : exact_log2 (BITS_PER_UNIT), + HOST_BITS_PER_DOUBLE_INT); + if (off.fits_shwi ()) temp.off = off.low; } } @@ -680,11 +679,9 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result) && TREE_CODE (temp.op2) == INTEGER_CST) { double_int off = tree_to_double_int (temp.op0); - off = double_int_add (off, - double_int_neg - (tree_to_double_int (temp.op1))); - off = double_int_mul (off, tree_to_double_int (temp.op2)); - if (double_int_fits_in_shwi_p (off)) + off += -tree_to_double_int (temp.op1); + off *= tree_to_double_int (temp.op2); + if (off.fits_shwi ()) temp.off = off.low; } break; @@ -1018,8 +1015,8 @@ vn_reference_fold_indirect (VEC (vn_reference_op_s, heap) **ops, if (addr_base != op->op0) { double_int off = tree_to_double_int (mem_op->op0); - off = double_int_sext (off, TYPE_PRECISION (TREE_TYPE (mem_op->op0))); - off = double_int_add (off, shwi_to_double_int (addr_offset)); + off = off.sext (TYPE_PRECISION (TREE_TYPE (mem_op->op0))); + off += double_int::from_shwi (addr_offset); mem_op->op0 = double_int_to_tree (TREE_TYPE (mem_op->op0), off); op->op0 = build_fold_addr_expr (addr_base); if (host_integerp (mem_op->op0, 0)) @@ -1052,7 +1049,7 @@ vn_reference_maybe_forwprop_address (VEC (vn_reference_op_s, heap) **ops, return; off = tree_to_double_int (mem_op->op0); - off = double_int_sext (off, TYPE_PRECISION (TREE_TYPE (mem_op->op0))); + off = off.sext (TYPE_PRECISION (TREE_TYPE (mem_op->op0))); /* The only thing we have to do is from &OBJ.foo.bar add the offset from .foo.bar to the preceding MEM_REF offset and replace the @@ -1069,8 +1066,8 @@ vn_reference_maybe_forwprop_address (VEC (vn_reference_op_s, heap) **ops, || TREE_CODE (addr_base) != MEM_REF) return; - off = double_int_add (off, shwi_to_double_int (addr_offset)); - off = double_int_add (off, mem_ref_offset (addr_base)); + off += double_int::from_shwi (addr_offset); + off += mem_ref_offset (addr_base); op->op0 = TREE_OPERAND (addr_base, 0); } else @@ -1082,7 +1079,7 @@ vn_reference_maybe_forwprop_address (VEC (vn_reference_op_s, heap) **ops, || TREE_CODE (ptroff) != INTEGER_CST) return; - off = double_int_add (off, tree_to_double_int (ptroff)); + off += tree_to_double_int (ptroff); op->op0 = ptr; } @@ -1242,11 +1239,9 @@ valueize_refs_1 (VEC (vn_reference_op_s, heap) *orig, bool *valueized_anything) && TREE_CODE (vro->op2) == INTEGER_CST) { double_int off = tree_to_double_int (vro->op0); - off = double_int_add (off, - double_int_neg - (tree_to_double_int (vro->op1))); - off = double_int_mul (off, tree_to_double_int (vro->op2)); - if (double_int_fits_in_shwi_p (off)) + off += -tree_to_double_int (vro->op1); + off *= tree_to_double_int (vro->op2); + if (off.fits_shwi ()) vro->off = off.low; } } |