From cf8f0e636f5ca214299481dff1ff2697ebb02596 Mon Sep 17 00:00:00 2001 From: crowl Date: Fri, 7 Sep 2012 00:06:35 +0000 Subject: 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 * 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 --- gcc/builtins.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'gcc/builtins.c') diff --git a/gcc/builtins.c b/gcc/builtins.c index 26f5d481203..e6b10ea43b9 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -4990,7 +4990,7 @@ expand_builtin_signbit (tree exp, rtx target) if (bitpos < GET_MODE_BITSIZE (rmode)) { - double_int mask = double_int_setbit (double_int_zero, bitpos); + double_int mask = double_int_zero.set_bit (bitpos); if (GET_MODE_SIZE (imode) > GET_MODE_SIZE (rmode)) temp = gen_lowpart (rmode, temp); @@ -8775,14 +8775,14 @@ fold_builtin_memory_op (location_t loc, tree dest, tree src, if (! operand_equal_p (TREE_OPERAND (src_base, 0), TREE_OPERAND (dest_base, 0), 0)) return NULL_TREE; - off = double_int_add (mem_ref_offset (src_base), - shwi_to_double_int (src_offset)); - if (!double_int_fits_in_shwi_p (off)) + off = mem_ref_offset (src_base) + + double_int::from_shwi (src_offset); + if (!off.fits_shwi ()) return NULL_TREE; src_offset = off.low; - off = double_int_add (mem_ref_offset (dest_base), - shwi_to_double_int (dest_offset)); - if (!double_int_fits_in_shwi_p (off)) + off = mem_ref_offset (dest_base) + + double_int::from_shwi (dest_offset); + if (!off.fits_shwi ()) return NULL_TREE; dest_offset = off.low; if (ranges_overlap_p (src_offset, maxsize, @@ -12696,7 +12696,7 @@ fold_builtin_object_size (tree ptr, tree ost) { bytes = compute_builtin_object_size (ptr, object_size_type); if (double_int_fits_to_tree_p (size_type_node, - uhwi_to_double_int (bytes))) + double_int::from_uhwi (bytes))) return build_int_cstu (size_type_node, bytes); } else if (TREE_CODE (ptr) == SSA_NAME) @@ -12707,7 +12707,7 @@ fold_builtin_object_size (tree ptr, tree ost) bytes = compute_builtin_object_size (ptr, object_size_type); if (bytes != (unsigned HOST_WIDE_INT) (object_size_type < 2 ? -1 : 0) && double_int_fits_to_tree_p (size_type_node, - uhwi_to_double_int (bytes))) + double_int::from_uhwi (bytes))) return build_int_cstu (size_type_node, bytes); } -- cgit v1.2.1