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>
Very nice! Why did you decide on hyperblock instead of SEME region and how are you forming the blocks? Evan On Apr 20, 2008, at 9:59 PM, Christopher Lamb wrote:> 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 > > <simple_switch.pdf>_______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
On Apr 20, 2008, at 9:59 PM, Christopher Lamb wrote:> 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 really cool! -Chris
My mistake Evan, they are SEME regions. I had a chat with a friend about hyper-blocks the other day and got confused in my email. =) -- Chris On Apr 22, 2008, at 12:27 AM, Evan Cheng wrote:> Very nice! Why did you decide on hyperblock instead of SEME region and > how are you forming the blocks? > > Evan > > On Apr 20, 2008, at 9:59 PM, Christopher Lamb wrote: > >> 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 >> >> <simple_switch.pdf>_______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-- Christopher Lamb -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080423/6b6df7c6/attachment.html>