[LLVMdev] Multiple successors, single dynamic successor

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



Nella citazione martedì 2 agosto 2011 20:02:08, Michael Ilseman ha 
scritto:
> I'm assuming that you're talking about a situation where this can't be
> determined statically in the existing LLVM IR, but you know it's true
> and want to put it in (e.g. you're the one generating LLVM IR). 
Correct. Or, more precisely, I'd like to investigate macro compression, 
i.e. finding duplicate sequences of instructions and merging them 
together.
Suppose you have two fragments in the cfg like this: a -> b -> c and d 
-> e -> f. Suppose that basic blocks b and e are identical: macro 
compression would discard e and have the second fragment transformed 
like this: d -> b -> f.
b has now two predecessor (a and d) and two successors (c and f), but 
we know that when control comes from a we will always have to jump to c 
and when coming from d we will always jump to f (basically we could say 
that macro compression is the inverse of jump threading). 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.

-- 
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/ce4698f5/attachment.vcf>


More information about the llvm-dev mailing list