[PATCH] D33523: [Polly] [OpenMP] Update Subtree values for nested parallel loop

Tobias Grosser via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 25 22:50:37 PDT 2017


grosser added a comment.

Hi Mohan,

thanks for working on this bug. I am slightly surprised we even try to generate code with nested parallelism.

  bool IslAstInfo::isExecutedInParallel(__isl_keep isl_ast_node *Node) {           
                                                                                   
    if (!PollyParallel)                                                            
      return false;                                                                
                                                                                   
    // Do not parallelize innermost loops.                                         
    //                                                                             
    // Parallelizing innermost loops is often not profitable, especially if        
    // they have a low number of iterations.                                       
    //                                                                             
    // TODO: Decide this based on the number of loop iterations that will be       
    //       executed. This can possibly require run-time checks, which again      
    //       raises the question of both run-time check overhead and code size     
    //       costs.                                                                
    if (!PollyParallelForce && isInnermost(Node))                                  
      return false;                                                                
                                                                                   
    return isOutermostParallel(Node) && !isReductionParallel(Node);                
  }  

checks specifically for outermost parallelism. Something seems broken here.

Even if we generate correct LLVM-IR, I am not sure nested parallelism makes sense when calling OpenMP semantically and especially not performance wise. I think as a first step we should investigate why we generate nested parallelism at all.


https://reviews.llvm.org/D33523





More information about the llvm-commits mailing list