This is an archive of the discontinued LLVM Phabricator instance.

[flang] Add support for LSHIFT and RSHIFT intrinsics
ClosedPublic

Authored by kkwli0 on Nov 28 2022, 11:26 AM.

Details

Summary

This patch is to add support for LSHIFT and RSHIFT intrinsics which functionality is the same as the standard SHIFTL and SHIFTA intrinsics respectively. The change is to alias the two intrinsics to the standardized ones.

Diff Detail

Event Timeline

kkwli0 created this revision.Nov 28 2022, 11:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 28 2022, 11:26 AM
Herald added a subscriber: jdoerfert. · View Herald Transcript
kkwli0 requested review of this revision.Nov 28 2022, 11:26 AM

Needs a test.

@klausler Thanks for the quick review. Since these two intrinsics are made alias to the existing ones, I am not sure what is the suitable tests. The functionality part (e.g. code gen) is already covered by flang/test/Lower/Intrinsics/shift[lr].f90 and flang/test/Evalute/fold-shift.f90. Will the same tests with the name changed be good? Any advice is appreciated. Thanks.

@klausler Thanks for the quick review. Since these two intrinsics are made alias to the existing ones, I am not sure what is the suitable tests. The functionality part (e.g. code gen) is already covered by flang/test/Lower/Intrinsics/shift[lr].f90 and flang/test/Evalute/fold-shift.f90. Will the same tests with the name changed be good? Any advice is appreciated. Thanks.

I'd try writing a test with -fdebug-unparse and FileCheck to confirm that references to the extension names have been replaced with the conforming names. If you grep the tests you'll find some others that do this.

@klausler Thanks for the quick review. Since these two intrinsics are made alias to the existing ones, I am not sure what is the suitable tests. The functionality part (e.g. code gen) is already covered by flang/test/Lower/Intrinsics/shift[lr].f90 and flang/test/Evalute/fold-shift.f90. Will the same tests with the name changed be good? Any advice is appreciated. Thanks.

I'd try writing a test with -fdebug-unparse and FileCheck to confirm that references to the extension names have been replaced with the conforming names. If you grep the tests you'll find some others that do this.

Thanks for the advice.

kkwli0 updated this revision to Diff 478400.Nov 28 2022, 3:27 PM

Add tests

klausler accepted this revision.Nov 28 2022, 3:34 PM
This revision is now accepted and ready to land.Nov 28 2022, 3:34 PM
This revision was automatically updated to reflect the committed changes.