[LLVMdev] Whole-function isel

Christopher Lamb christopher.lamb at gmail.com
Sun Apr 20 21:59:29 PDT 2008


I thought I'd share a little bit of progress I made this weekend.  
I've gotten the first interesting test-case (a simple switch) through  
hyperblock-based DAGISel, and there's a pretty picture too! Each part  
of the switch is emitted directly into the DAG, rather than being  
deferred.

This is the function:
define i32 @foo(i32 %x, i32 %z) nounwind  {
entry:
         switch i32 %x, label %UnifiedReturnBlock [
                  i32 0, label %bb
                  i32 1, label %bb5
         ]
bb:             ; preds = %entry
         %tmp4 = mul i32 %z, %x          ; <i32> [#uses=1]
         ret i32 %tmp4
bb5:            ; preds = %entry
         %tmp8 = add i32 %z, %x          ; <i32> [#uses=1]
         ret i32 %tmp8
UnifiedReturnBlock:             ; preds = %entry
         ret i32 %z
}

And here's the X86 DAG right before it gets fed one BB at a time into  
pre-RA scheduling. Each color is a different basic block.

Cheers!
--
Chris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: simple_switch.pdf
Type: application/pdf
Size: 33075 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080420/fa2c55e7/attachment.pdf>


More information about the llvm-dev mailing list