[PATCH] D93764: [LoopUnswitch] Implement first version of partial unswitching.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 28 14:50:08 PST 2020
fhahn added a comment.
In D93764#2472579 <https://reviews.llvm.org/D93764#2472579>, @xbolva00 wrote:
> GCC has separate pass for this - loopsplit. It can handle also general case like:
>
> for (i = 0; i < 100; i++)
> {
> if (i < 50)
> A;
> else
> B;
> }
> into:
> for (i = 0; i < 50; i++)
> {
> A;
> }
> for (; i < 100; i++)
> {
> B;
> }
>
> https://godbolt.org/z/zqsPY6
I think this is a separate issue (the condition is dependent on the induction variable), but nevertheless interesting to pursue. IIRC there is already a pass that tries to do something similar, but I don't know which one of the top of my head. Will check.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D93764/new/
https://reviews.llvm.org/D93764
More information about the llvm-commits
mailing list