struct-reorg optimization
Olga Golovanevsky
OLGA@il.ibm.com
Wed Aug 1 12:06:00 GMT 2007
"Daniel Berlin" <dberlin@dberlin.org> wrote on 20/07/2007 00:22:33:
>
> Comments on struct-reorg.c:
>
>
> 1. The comments in strip_t ype do not make clear what it does
> Just based on looking at it, it should be using POINTER_TYPE_P, not
> TREE_CODE (type) == POINTER_TYPE
done.
> 2. why is get_type_name returning a char * and not a const char *?
changed, done.
> 3. why is get_type_var using DECL_ARG_TYPE?
because get_type_var receives function parameters as arguments as well.
> 4.
> if (SSA_NAME_IS_DEFAULT_DEF(before_cast))
> return false;
> Should be
> if (SSA_NAME_IS_DEFAULT_DEF (before_cast))
> return false;
fixed.
> 5. your offset/base splitting code seems to be trying to approximate
> exactly what get_ref_and_base_extent will do for you.
>
not exactly, as I need offset/base variables there.
> 6. In build_basic_struct, why are you touching C_* fields?
fixed.
>
> 7. Don't use CONSTANT_CLASS_P and simple_cst_equal, just call
> operand_equal_p on rhs
fixed.
>
> 8. It seems you assume struct sizes fit in unsigned int in a lot of
> places, when they should actually be HOST_WIDE_INT
fixed.
This is an updated patch. In addition to changes mentioned above,
by suggestion of Peter Bergner, I have changes the model to
peel hot fields one by one instead of clustering them. It scales
better, and now we are getting 47% on art with and w/o profiling, i.e.
when by default we completely peel the structure into separate fields.
Any further comments? Ok for mainline?
:ADDPATCH ipa ssa:
Olga
2007-08-01 Olga Golovanevsky <olga@il.ibm.com>
* struct-reorg.c, struct-reorg.h: New files.
* tree.h: Add pass_ipa_struct_reorg.
* common.opt: Add ipa-struct-reorg flag.
* Makefile.in: Add strcut-reorg.o compilation.
* passes.c: Add pass pass_ipa_struct_reorg.
(See attached file: struct-reorg.h)(See attached file: struct_reorg.txt)
(See attached file: struct-reorg.c)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: struct-reorg.h
Type: application/octet-stream
Size: 3837 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070801/bc830819/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: struct_reorg.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070801/bc830819/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: struct-reorg.c
Type: application/octet-stream
Size: 86743 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070801/bc830819/attachment-0001.obj>
More information about the Gcc-patches
mailing list