This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c code CSE(common subexpression elimination) optimization


On Nov 7, 2007 11:55 AM, ldeveloperxl <lgeneral_usel@yahoo.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
-fdump-rtl-cse -fdump-rtl-gcse.

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).


Diego.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]