This patch adds code so that using bbc we are able to see an end-to-end lowering of simd construct in action.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Looks OK. Have a few comments.
flang/lib/Lower/OpenMP.cpp | ||
---|---|---|
326 | Nit: Can this be added to the previous if using ||? | |
787 | Can you add Todos for the clauses or add tests for supported clauses? | |
flang/test/Lower/OpenMP/simd.f90 | ||
4 | We are aligning with the rest of the FIR lowering tests and only testing the lowering to FIR+OpenMP dialects here. Please change this test to do just that and remove the LLVM IR check. | |
7 | Nit: align this with rest of the code. | |
21 | Nit: no new line. |
flang/test/Lower/OpenMP/simd.f90 | ||
---|---|---|
4 | Also add a FIR+OpenMP -> LLVM+OpenMP dialect test in https://github.com/llvm/llvm-project/blob/main/flang/test/Fir/convert-to-llvm-openmp-and-fir.fir |
flang/lib/Lower/OpenMP.cpp | ||
---|---|---|
714 | It's time to refactor this function. It's better not to share all the code of lowering clauses for different LoopDirective since they does have different clauses. Considering the following: if (LoopDirective == llvm::omp::OMPD_do) { genWsLoop(...); } else if (LoopDirective == llvm::omp::OMPD_simd) { genSIMDLoop(...); } else { TODO } Or a switch case statement? The clauses operands collection should be extracted into some functions so that they can be shared. | |
787 | @shraiysh @kiranchandramohan Please notice that no clause is supported for SIMD in MLIR for now. It's better not to refactor the code for wsloop before the upstream of it is done. So it seems to be better give TODOs when getting any clause in SIMD construct. When the upstream for wsloop is done, it's better to refactor this code as I suggested above. |
Addressing reviewers comments. No test case for clauses could be added as we currently support simd without any clauses
LG.
Not for this patch: Maybe we should also adopt the base flang style of hard TODOs for unimplemented features/clauses.
Nit: Can this be added to the previous if using ||?