[PATCH] D93764: [LoopUnswitch] Implement first version of partial unswitching.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 17 10:34:33 PST 2021


fhahn updated this revision to Diff 317231.
fhahn added a comment.

In D93764#2496964 <https://reviews.llvm.org/D93764#2496964>, @jonpa wrote:

> If a dead path in a loop is unswitched into an empty loop, I suppose the idea is that LoopDeletion will later then delete it?

Yes exactly, this work is delegated to LoopDeletion; LoopUnswitch does not really care if the loop is dead at the moment or not, just if a condition in the body can be simplified by moving out a memory dependent check.

> What about the remaining original loop: will it remain the same or will it get the edge into the dead path redirected to the new smaller loop?

At the moment, it remains the same. But it would be a great extension to update the body to jump to the unswitched version, if possible. I think this would best be done in a separate patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93764/new/

https://reviews.llvm.org/D93764

Files:
  llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
  llvm/test/Transforms/LoopUnswitch/partial-unswitch-mssa-threshold.ll
  llvm/test/Transforms/LoopUnswitch/partial-unswitch.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93764.317231.patch
Type: text/x-patch
Size: 31890 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210117/2b85b4ad/attachment-0001.bin>


More information about the llvm-commits mailing list