This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Removal of gotos from cfg based ir
- From: Jan Hubicka <jh at suse dot cz>
- To: Chris Lattner <sabre at nondot dot org>
- Cc: Jan Hubicka <jh at suse dot cz>, Andrew MacLeod <amacleod at redhat dot com>,Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>,Diego Novillo <dnovillo at redhat dot com>,gcc-patches <gcc-patches at gcc dot gnu dot org>, Jeff Law <law at redhat dot com>
- Date: Fri, 14 Nov 2003 17:06:13 +0100
- Subject: Re: [tree-ssa] Removal of gotos from cfg based ir
- References: <20031114154601.GY1729@kam.mff.cuni.cz> <Pine.LNX.4.44.0311141001540.7311-100000@nondot.org>
> > > In LLVM, all control flow (for both normal and exceptional control) is
> > > represented explicitly in the program. For example, "fall-through" edges
> > > are explicit gotos, which are eliminated during code generation. This
>
> > Interesting. How do you deal with the exception handling edges?
> > Does call having EH edge become somthing like call+goto combo?
>
> Exactly right. As an example:
>
> void test() {
> A x; // has ctor/dtor
> mightthrow();
> ...
>
> }
>
> Would be represented as:
>
> void %test() {
> %x = alloca %A
> call void %A::A(%A* %x) // construct A
> invoke void %mightthrow() to %normal except %exceptionthrown
>
> normal:
> ...
>
> exceptionthrown:
> call void %A::~A(%A* %x) // destruct A
> unwind
> }
>
> The LLVM EH constructs are described in more detail in this paper:
> http://llvm.cs.uiuc.edu/pubs/2003-09-30-LifelongOptimizationTR.html
>
> Note that this makes spliting exception edges and other CFG work both
> completely trivial, and uniform with the rest of the representation.
Do you have such a implicit goto hidden in each call, or just calls that
may trap? What about other kinds of instructions?
Do you support non-call exception like Java has?
Honza
>
> -Chris
>
> --
> http://llvm.cs.uiuc.edu/
> http://www.nondot.org/~sabre/Projects/
>