This is the mail archive of the
mailing list for the GCC project.
Re: c code CSE(common subexpression elimination) optimization
- From: "Diego Novillo" <dnovillo at google dot com>
- To: ldeveloperxl <lgeneral_usel at yahoo dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 9 Nov 2007 19:24:40 -0500
- Subject: Re: c code CSE(common subexpression elimination) optimization
- References: <firstname.lastname@example.org>
On Nov 7, 2007 11:55 AM, ldeveloperxl <email@example.com> wrote:
> I wonder if anybody knows if gcc or any other tools that is able to take a c
> program/source code (or any other high level languages), perform CSE on the
> program, then outputs the optimized program/source code?
GCC does CSE in several passes. During high-level optimization, it
does local cse using dominator-based optimization, then it does a
global full and partial redundancy elimination. At the low-level it
performs two CSE passes as well. You can request dumps from each of
these passes with -fdump-tree-dom -fdump-tree-fre -fdump-tree-pre
The first three will show you the code in a C-like form (GIMPLE), the
last two will show you a lisp-like representation of RTL (the
low-level IL used by gcc).