diff options
author | crowl <crowl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-09-07 00:06:35 +0000 |
---|---|---|
committer | crowl <crowl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-09-07 00:06:35 +0000 |
commit | cf8f0e636f5ca214299481dff1ff2697ebb02596 (patch) | |
tree | 82231821d6793cd33f15d6b9792a8b82f2ec15d1 /gcc/dwarf2out.c | |
parent | 0131450a329f26a25432d2904f50215f3e01214c (diff) | |
download | gcc-cf8f0e636f5ca214299481dff1ff2697ebb02596.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191047 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index a87eaf2bd7d..9adb07106ba 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -9332,13 +9332,13 @@ static inline double_int double_int_type_size_in_bits (const_tree type) { if (TREE_CODE (type) == ERROR_MARK) - return uhwi_to_double_int (BITS_PER_WORD); + return double_int::from_uhwi (BITS_PER_WORD); else if (TYPE_SIZE (type) == NULL_TREE) return double_int_zero; else if (TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST) return tree_to_double_int (TYPE_SIZE (type)); else - return uhwi_to_double_int (TYPE_ALIGN (type)); + return double_int::from_uhwi (TYPE_ALIGN (type)); } /* Given a pointer to a tree node for a subrange type, return a pointer @@ -11758,7 +11758,7 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode, mem_loc_result->dw_loc_oprnd2.val_class = dw_val_class_const_double; mem_loc_result->dw_loc_oprnd2.v.val_double - = shwi_to_double_int (INTVAL (rtl)); + = double_int::from_shwi (INTVAL (rtl)); } } break; @@ -12317,7 +12317,7 @@ loc_descriptor (rtx rtl, enum machine_mode mode, double_int val = rtx_to_double_int (elt); if (elt_size <= sizeof (HOST_WIDE_INT)) - insert_int (double_int_to_shwi (val), elt_size, p); + insert_int (val.to_shwi (), elt_size, p); else { gcc_assert (elt_size == 2 * sizeof (HOST_WIDE_INT)); @@ -13646,11 +13646,11 @@ simple_decl_align_in_bits (const_tree decl) static inline double_int round_up_to_align (double_int t, unsigned int align) { - double_int alignd = uhwi_to_double_int (align); - t = double_int_add (t, alignd); - t = double_int_add (t, double_int_minus_one); - t = double_int_div (t, alignd, true, TRUNC_DIV_EXPR); - t = double_int_mul (t, alignd); + double_int alignd = double_int::from_uhwi (align); + t += alignd; + t += double_int_minus_one; + t = t.div (alignd, true, TRUNC_DIV_EXPR); + t *= alignd; return t; } @@ -13757,23 +13757,21 @@ field_byte_offset (const_tree decl) /* Figure out the bit-distance from the start of the structure to the "deepest" bit of the bit-field. */ - deepest_bitpos = double_int_add (bitpos_int, field_size_in_bits); + deepest_bitpos = bitpos_int + field_size_in_bits; /* This is the tricky part. Use some fancy footwork to deduce where the lowest addressed bit of the containing object must be. */ - object_offset_in_bits - = double_int_sub (deepest_bitpos, type_size_in_bits); + object_offset_in_bits = deepest_bitpos - type_size_in_bits; /* Round up to type_align by default. This works best for bitfields. */ object_offset_in_bits = round_up_to_align (object_offset_in_bits, type_align_in_bits); - if (double_int_ucmp (object_offset_in_bits, bitpos_int) > 0) + if (object_offset_in_bits.ugt (bitpos_int)) { - object_offset_in_bits - = double_int_sub (deepest_bitpos, type_size_in_bits); + object_offset_in_bits = deepest_bitpos - type_size_in_bits; /* Round up to decl_align instead. */ object_offset_in_bits @@ -13785,10 +13783,9 @@ field_byte_offset (const_tree decl) object_offset_in_bits = bitpos_int; object_offset_in_bytes - = double_int_div (object_offset_in_bits, - uhwi_to_double_int (BITS_PER_UNIT), true, - TRUNC_DIV_EXPR); - return double_int_to_shwi (object_offset_in_bytes); + = object_offset_in_bits.div (double_int::from_uhwi (BITS_PER_UNIT), + true, TRUNC_DIV_EXPR); + return object_offset_in_bytes.to_shwi (); } /* The following routines define various Dwarf attributes and any data @@ -14064,7 +14061,7 @@ add_const_value_attribute (dw_die_ref die, rtx rtl) double_int val = rtx_to_double_int (elt); if (elt_size <= sizeof (HOST_WIDE_INT)) - insert_int (double_int_to_shwi (val), elt_size, p); + insert_int (val.to_shwi (), elt_size, p); else { gcc_assert (elt_size == 2 * sizeof (HOST_WIDE_INT)); |