This is the mail archive of the gcc-patches@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] |
This patch implements a simple variant of RTA (see "Fast Static Analysis of C++ Virtual Function Call" by Bacon & Sweeney - OOPSLA'96) for devirtualization of C++ function calls. The interprocedural analysis done may infer the type of the object upon which a virtual method is invoked. If this happens the virtual call may be transformed in a direct call, this making possible the inlining of the method afterward. The current patch contains the analysis part. For transforming a virtual call in a direct call it uses already existent GCC code that works only in limited cases. This means that currently, even if we infer the type of the object for a virtual call, not always this virtual call is transformed in a direct one. This will be fixed by a further patch with support for transformation of a virtual call in a direct one in the general case. This optimization works only for C++ code. To enable it use the option -fipa-cha. It is assumes that all the application files are compiled together. The option -fdump-ipa-cha generates information in the *.cha file. Bootstrapping done, regression test successfully on Power. Mircea
Attachment:
ChangeLog
Description: Binary data
Attachment:
ndiffn.log
Description: Binary data
Attachment:
ipa-cha.c
Description: Binary data
Attachment:
foo1.C
Description: Binary data
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |