[PATCH] D75384: OpenMP for loop fusion

Abid via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 7 09:45:12 PDT 2020


abidmalikwaterloo marked 3 inline comments as done.
abidmalikwaterloo added a comment.

In D75384#1955925 <https://reviews.llvm.org/D75384#1955925>, @abidmalikwaterloo wrote:

> In D75384#1932847 <https://reviews.llvm.org/D75384#1932847>, @jdoerfert wrote:
>
> > This doesn't seem to use dominance at all. How do you handle
> >
> >   if (a) {
> >   #pragma omp for
> >   for (int i = 0; i < 10; i++)
> >     ;
> >   } else {
> >   #pragma omp for
> >   for (int i = 0; i < 10; i++)
> >     ;
> >   }
> >
>
>
>
>
>   if the value of a is known at the time of compilation, we will only have one "for loop". Therefore, for this specific case,  the implemented technique will see only one "for loop" at the IR level. This case should be a problem. 


This can be done if we collapse the loops within basic blocks. Then this will make the two for loops independent of each other.


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

https://reviews.llvm.org/D75384





More information about the llvm-commits mailing list