[PATCH] D129368: [mlir][OpenMP] Lower simd if clause to LLVM IR

Dominik Adamski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 00:22:33 PDT 2022


domada added inline comments.


================
Comment at: llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h:341
+                                         const Twine &Name = "loop",
+                                         bool CreatePreheader = false);
 
----------------
Meinersbur wrote:
> [serious] This is //really// ugly from a software architecture point of view. Where previously all could expect a CanonicalLoopInfo has a preheader has to exist, it now any loop-handling code has to check for it.
> 
> The description of CanonicalLoopInfo needs to be updated.
Hi,
thanks for the remarks.

I decided to modify createCanonicalLoop interface, because omp loop trip count was calculated outside the loop preheader.

I needed to calculate trip count inside loop preheader because I used cloneLoopWithPreheader function. This function needs a BasicBlock which dominates. If we create loop trip count outside loop preheader then we cannot use loop preheader as dominator block.

According to your comments we can omit cloneLoopWithPreheader function call. In consequence there is no need to modify createCanonicalLoop function.


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

https://reviews.llvm.org/D129368



More information about the llvm-commits mailing list