This is an archive of the discontinued LLVM Phabricator instance.

[flang] Add PowerPC vec_ld, vec_lde, vec_ldl, vec_lxvp, vsx_lxvp, vec_xld2 and vec_xlw4 intrinsic
ClosedPublic

Authored by kkwli0 on Aug 11 2023, 11:46 AM.

Details

Summary

This patch adds a subset of PowerPC vector load intrinsics - vec_ld, vec_lde, vec_ldl, vec_lxvp, vsx_lxvp, vec_xld2 and vec_xlw4.

Diff Detail

Event Timeline

kkwli0 created this revision.Aug 11 2023, 11:46 AM
kkwli0 requested review of this revision.Aug 11 2023, 11:46 AM
DanielCChen added inline comments.Aug 14 2023, 6:45 AM
flang/lib/Optimizer/Builder/PPCIntrinsicCall.cpp
1385

Should this be llvm_unreachable?

1409

Same as above.

flang/test/Lower/PowerPC/ppc-vec-load.f90
436

Since this is Power10 only, we probably should move it to the Power10 specific test file test/Lower/PowerPC/ppc-pwr10-vec-intrinsics.f90

kkwli0 marked 3 inline comments as done.Aug 14 2023, 8:50 AM
kkwli0 added inline comments.
flang/lib/Optimizer/Builder/PPCIntrinsicCall.cpp
1385

Will change it llvm_unreachable

1409

Will change it llvm_unreachable

flang/test/Lower/PowerPC/ppc-vec-load.f90
4

Remove it

436

I will move the test of vec_lxvp into another file.

kkwli0 updated this revision to Diff 549976.Aug 14 2023, 8:51 AM
kkwli0 marked 3 inline comments as done.

Changes:

  • put the vec_lxvp test into a separate file
  • change assert to llvm_unreachable
  • fix a typo in ppc-vec-load.f90
DanielCChen added inline comments.Aug 14 2023, 8:58 AM
flang/test/Lower/PowerPC/ppc-vec-load-pwr10.f90
2

For dumping the LLVM IR, we used

! RUN: %flang_fc1 -triple powerpc64le-unknown-unknown -target-cpu pwr10 -emit-llvm %s -o  - | FileCheck --check-prefixes="CHECK" %s
kkwli0 updated this revision to Diff 549982.Aug 14 2023, 9:08 AM

Add vsx_lxvp intrinsic

kkwli0 retitled this revision from [flang] Add PowerPC vec_ld, vec_lde, vec_ldl, vec_lxvp, vec_xld2 and vec_xlw4 intrinsic to [flang] Add PowerPC vec_ld, vec_lde, vec_ldl, vec_lxvp, vsx_lxvp, vec_xld2 and vec_xlw4 intrinsic.Aug 14 2023, 9:09 AM
kkwli0 edited the summary of this revision. (Show Details)
kkwli0 added inline comments.Aug 14 2023, 9:54 AM
flang/test/Lower/PowerPC/ppc-vec-load-pwr10.f90
2

Is REQUIRES: target=powerpc{{.*}} sufficient? Do you want to exclude all non-powerpc64le targets for this test?

DanielCChen added inline comments.Aug 14 2023, 10:18 AM
flang/test/Lower/PowerPC/ppc-vec-load-pwr10.f90
2

To be more specific, this is what is in the other Power10 test file

! RUN: %flang_fc1 -triple powerpc64le-unknown-unknown -target-cpu pwr10 -emit-llvm %s -o - | FileCheck --check-prefixes="CHECK" %s
! REQUIRES: target=powerpc{{.*}}

Since it is testing the LLVM IR, I think we use use %$flang_fc1 instead of %flang. Because -mcpu is not a -fc1 option, we used -target-cpu power10, so we no longer need -S .

kkwli0 marked 2 inline comments as done.Aug 14 2023, 10:27 AM
kkwli0 added inline comments.
flang/test/Lower/PowerPC/ppc-vec-load-pwr10.f90
2

Thanks for the clarification. I will make the change accordingly.

kkwli0 updated this revision to Diff 550019.Aug 14 2023, 10:29 AM
kkwli0 marked an inline comment as done.

Update the test run command

kkwli0 updated this revision to Diff 550050.Aug 14 2023, 12:14 PM

Move the vec_lxvp test to ppc-pwr10-vec-intrinsics.f90

This revision is now accepted and ready to land.Aug 14 2023, 12:24 PM
This revision was landed with ongoing or failed builds.Aug 14 2023, 1:59 PM
This revision was automatically updated to reflect the committed changes.