This is the mail archive of the gcc@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: [tree-ssa] RFC: Making control flow more explicit


Richard Henderson Said:
> I'd be surprised if we could do as well if we lower this to ifs.
> I think we probably want to keep a multi-way branch until rtl.
> But something more like
>	multi-goto [ 1: label1, 2: label2, 3: label3, else: label4 ];
> than a switch statement per-se.  You could still use SWITCH_EXPR,
> probably, so long as all the labels and values are collected in
> the node.

For what it's worth, this is what we do in LLVM, and it works quite well.
At the codegen/RTL emission stage you can decide whether you want to emit
a tablejump or decision tree...

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/


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