Simdloop collapse clause is supported in the same way as colllapse clause for worksharing loops.
Details
Diff Detail
Event Timeline
nit: add NFC to the title.
flang/test/Lower/OpenMP/simd.f90 | ||
---|---|---|
123 | This is not one good test case for SIMD directive. Can you replace it with the one that can be vectorized? |
As far as possible we should try to have Flang and MLIR OpenMP dialect changes in separate patches.
I would recommend splitting this into two simple patches.
- Testing the lowering of OpenMP dialect simdloop collapse to LLVM IR. There is an existing test case, simdloop_multi in the translation tests. You need to strengthen it minimally to check the occurrence of collapse. And adding the collapse information to the OpenMP dialect op description.
The relevant code for this came in the patch https://reviews.llvm.org/D118065.
- Test the lowering from source to FIR+OpenMP simdloop with collapse. Add the relevant patch that enabled lowering of the collapse in simdloop. I think the patches that you have provided are not the right ones.
flang/test/Lower/OpenMP/simd.f90 | ||
---|---|---|
109 | All the above checks can either be with the same CHECK line or with the CHECK-SAME directive. |
Add only OpenMP specific changes. Update simd loop MLIR description and strengthen translation test.
Done. I modified this review so that it contains only OpenMP specific changes.
- Test the lowering from source to FIR+OpenMP simdloop with collapse. Add the relevant patch that enabled lowering of the collapse in simdloop. I think the patches that you have provided are not the right ones.
Will be done as the separate patch.
@peixin
Thank you for your review. I will apply your remarks in the separate patch which will be Flang specific.
Updated test: Do not rely on hardcoded labels. Check if collapsed loop bound is calculated.
Follow up review: https://reviews.llvm.org/D132023 . This review contains Fortran test with simd clause.
flang/test/Lower/OpenMP/simd.f90 | ||
---|---|---|
109 | Done | |
123 | @peixin done: please look at https://reviews.llvm.org/D132023 |
All the above checks can either be with the same CHECK line or with the CHECK-SAME directive.