-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[Flang][OpenMP] Port OpenMP single tests to hlfir flow #69877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
flang/test/Lower/OpenMP/single.f90
Outdated
!CHECK: omp.parallel | ||
!$omp parallel | ||
!CHECK: omp.single | ||
!$omp single | ||
!CHECK: %[[xval:.*]] = fir.load %[[x]] : !fir.ref<i32> | ||
!CHECK: %[[xval:.*]] = fir.load %[[X_DECL]]#0 : !fir.ref<i32> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: keep the alignment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
flang/test/Lower/OpenMP/single.f90
Outdated
! CHECK: %[[Y_DECL:.*]]:2 = hlfir.declare %[[Y]] {uniq_name = "_QFsingle_privatizationEy"} : (!fir.ref<f64>) -> (!fir.ref<f64>, !fir.ref<f64>) | ||
! CHECK: %[[VAL_6:.*]] = fir.load %[[VAL_1_DECL]]#1 : !fir.ref<f64> | ||
! CHECK: fir.store %[[VAL_6]] to %[[Y_DECL]]#1 : !fir.ref<f64> | ||
! CHECK: fir.call @_QPbar(%[[X_DECL]]#1, %[[Y_DECL]]#1) fastmath<contract> : (!fir.ref<f32>, !fir.ref<f64>) -> () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Maintain the alignment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
flang/test/Lower/OpenMP/single.f90
Outdated
!=============================================================================== | ||
|
||
!CHECK-LABEL: func @_QPomp_single | ||
!CHECK-SAME: (%[[x:.*]]: !fir.ref<i32> {fir.bindc_name = "x"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Change x
to a capital X
, here and elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
flang/test/Lower/OpenMP/single.f90
Outdated
! CHECK: %[[X:.*]] = fir.alloca f32 {bindc_name = "x", pinned, uniq_name = "_QFsingle_privatization2Ex"} | ||
! CHECK: %[[X_DECL:.*]]:2 = hlfir.declare %[[X]] {uniq_name = "_QFsingle_privatization2Ex"} : (!fir.ref<f32>) -> (!fir.ref<f32>, !fir.ref<f32>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Better to call these as X_PVT
, X_PVT_DECL
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
flang/test/Lower/OpenMP/single.f90
Outdated
! CHECK: %[[VAL_0_DECL:.*]]:2 = hlfir.declare %[[VAL_0]] {uniq_name = "_QFsingle_privatization2Ex"} : (!fir.ref<f32>) -> (!fir.ref<f32>, !fir.ref<f32>) | ||
! CHECK: %[[VAL_1_DECL:.*]]:2 = hlfir.declare %[[VAL_1]] {uniq_name = "_QFsingle_privatization2Ey"} : (!fir.ref<f64>) -> (!fir.ref<f64>, !fir.ref<f64>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Better to call these as X
and X_DECL
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
This current merge created a check-flang failure. A Fix(#70164) will be merged shortly. |
No description provided.