This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] GlobalIsel codegen for gpr CTZ
ClosedPublic

Authored by stuij on Dec 6 2022, 5:32 AM.

Details

Summary

If feature CSSC is available, CTTZ intrinsics are lowered using the CTZ
instruction when using GlobalIsel.

spec:
https://developer.arm.com/documentation/ddi0602/2022-09/Base-Instructions/CTZ--Count-Trailing-Zeros-

Diff Detail

Event Timeline

stuij created this revision.Dec 6 2022, 5:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 6 2022, 5:32 AM
stuij requested review of this revision.Dec 6 2022, 5:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 6 2022, 5:32 AM
paquette added inline comments.Dec 7 2022, 2:11 PM
llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
78

I think the HasCSSC variable should go somewhere around here so that we can avoid moving it around as you add support for the CSSC feature.

669

You have a bunch of changes which declare this variable/move it around.

How about just moving it to the top of this function so that you don't have to move it every time?

stuij updated this revision to Diff 483552.Dec 16 2022, 8:10 AM

moved HasCSSC further up the file

stuij marked 2 inline comments as done.Dec 16 2022, 8:19 AM
stuij added inline comments.
llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
78

done. thanks.

paquette accepted this revision.Dec 16 2022, 11:24 AM

I had two minor comments, but after you fix those, I think this is good to go.

llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
674

Might as well just return here.

679

Might as well just return here.

This revision is now accepted and ready to land.Dec 16 2022, 11:24 AM
stuij updated this revision to Diff 483896.Dec 19 2022, 3:32 AM
stuij marked an inline comment as done.

minor code cleanup

This revision was landed with ongoing or failed builds.Dec 21 2022, 3:32 AM
This revision was automatically updated to reflect the committed changes.