[LLVMdev] Multiple successors, single dynamic successor

Carlo Alberto Ferraris cafxx at strayorange.com
Tue Aug 2 13:16:53 PDT 2011


Nella citazione martedì 2 agosto 2011 22:01:13, Carlo Alberto Ferraris 
ha scritto:
> My question is: 
> what is the best way to
> express such relationships in LLVM IR ("best" in the sense of allowing 
> other optimizations to run effectively)? Bear in mind that in this 
> example N=2, but it may be way bigger than that.
Just to clarify: I already figured out two ways to do it, i.e.:

%0 = phi i8* [blockaddr(%succ0), %pred0], [blockaddr(%succ1), %pred1], 
...
...
indirectbr %0, [%succ0, %succ1, ...]

or

%0 = phi i8 [0, %pred0], [1, %pred1], ...
...
switch %0, undef, [0, %succ0], [1, %succ1], ...

what I'd like to know is which one do you think is better (and why) or 
if there are better ways I didn't think of.

-- 
Carlo Alberto Ferraris <cafxx at strayorange.com 
<mailto:cafxx at strayorange.com>>
website/blog <http://cafxx.strayorange.com> - +39 333 7643 235

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cafxx.vcf
Type: text/x-vcard
Size: 233 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110802/bf1eb783/attachment.vcf>


More information about the llvm-dev mailing list