[PATCH] D46706: [PM/LoopUnswitch] Support partial trivial unswitching.

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 20 11:59:55 PDT 2018


chandlerc marked an inline comment as done.
chandlerc added a comment.

In https://reviews.llvm.org/D46706#1127667, @sanjoy wrote:

> This lgtm.
>
> Have you considered making full unswitching a special case for partial unswitching?  It seems like we could "partially unswitch" `br %loop_invariant, label %t, label %f` into `br true/false, label %t, label %f` and have a beefed up LoopSimplifyCFG clean this up?


We'd have to make LoopSimplifyCFG substantially more powerful, and all of the complex CFG-fixing logic here would need to be ported to it.

We can do that, but I'm not sure how valuable it is in practice. The really tricky thing is that we'd have to have LoopSimplifyCFG trigger the iteration when it re-shapes the loop nest. That seems a bit more clear here at the moment... but happy to chat about it further and if it makes sense, we can move all the CFG rewriting logic to LoopSimplifyCFG and make that change.


Repository:
  rL LLVM

https://reviews.llvm.org/D46706





More information about the llvm-commits mailing list