http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49575

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |openmp
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-06-29 
18:40:42 UTC ---
The problem isn't that the loop isn't unrolled, it is unrolled just fine.
The problem is that ompexp pass runs too early, no CCP is performed before
that, so it isn't able to figure out that k is constant in the loop unless you
explicitly say so or unless you declare it in the body of the parallel region.
We currently expand omp before SSA, while CCP needs SSA, but not sure what
kinds of issues could cause the pass reordering.
Alternative to reshuffling the passes would be to do some kind of OpenMP IPA
optimization, if constant/gimple invariant values are stored into the omp_data
structure, we could modify both the caller not to store them and callees to
replace all reads from that with the invariant.

Reply via email to