Matthijs Kooijman
2008-May-06 09:03 UTC
[LLVMdev] [PATCH] Split LoopUnroll pass into mechanism and policy
Hi, the attached patch splits the loop unroll pass into a LoopUnroll superclass that implements the unrolling mechanism, and a SimpleLoopUnroll subclass implementing the current policy. This split is modeled after the split between Inliner and SimpleInliner. The superclass currently still finds out the TripCount and TripMultiple, and passes those, together with the Loop in question, to a policy method. Currently, TripMultiple is not yet used in the SimpleLoopUnroll, but I can imagine that this might change, so I included it already. Currently, there is only the SimpleLoopUnroll subclass, so there is no direct gain. However, this opens up the way for other policies and in particular I need to implement a platform specific policy so I require this change. Comments are welcome, I hope this change can be committed. Gr. Matthijs -------------- next part -------------- A non-text attachment was scrubbed... Name: split-unroll.diff Type: text/x-diff Size: 14632 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080506/a747bafc/attachment.diff> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: Digital signature URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080506/a747bafc/attachment.sig>
Matthijs Kooijman
2008-May-06 10:11 UTC
[LLVMdev] [PATCH] Split LoopUnroll pass into mechanism and policy
Hi, please find an updated patch attached that incorporates the (trivial) changes introduced by r50696 and which makes this patch apply cleanly again. Gr. Matthijs -------------- next part -------------- A non-text attachment was scrubbed... Name: split-unroll.diff Type: text/x-diff Size: 14660 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080506/73a12eb3/attachment.diff> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: Digital signature URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080506/73a12eb3/attachment.sig>
Dan Gohman
2008-May-07 00:56 UTC
[LLVMdev] [PATCH] Split LoopUnroll pass into mechanism and policy
Hello Matthijs, Separating mechanism from policy is a good thing for the LoopUnroll pass. Instead of moving the policy to a subclass though, I think it'd be better to move the mechanism, the unrollLoop function, out to be a standalone utility function, with the LoopInfo object passed in explicitly. FoldBlockIntoPredecessor would also be good to make into a standalone utility function, since it isn't specific to unrolling. This should still make it easy to write new unrolling passes with custom heuristics, but it would also be more flexible for passes to do unrolling in combination with other transformations. What do you think? Dan On May 6, 2008, at 3:11 AM, Matthijs Kooijman wrote:> Hi, > > please find an updated patch attached that incorporates the > (trivial) changes > introduced by r50696 and which makes this patch apply cleanly again. > > Gr. > > Matthijs > <split-unroll.diff>_______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Maybe Matching Threads
- [LLVMdev] [PATCH] Split LoopUnroll pass into mechanism and policy
- [LLVMdev] [PATCH] Split LoopUnroll pass into mechanism and policy
- [LLVMdev] [PATCH] Split LoopUnroll pass into mechanism and policy
- [LLVMdev] [PATCH] Split LoopUnroll pass into mechanism and policy
- [LLVMdev] [PATCH] Split LoopUnroll pass into mechanism and policy