This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Look through OR, AND, XOR instructions when checking a clear.
ClosedPublic

Authored by stefanp on Apr 25 2023, 6:13 PM.

Details

Summary

This patch adds the additional step of looking through AND, OR, XOR
instructions when we check the number of leading zeros.

Diff Detail

Event Timeline

stefanp created this revision.Apr 25 2023, 6:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 25 2023, 6:13 PM
stefanp requested review of this revision.Apr 25 2023, 6:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 25 2023, 6:13 PM
stefanp added a reviewer: Restricted Project.Apr 25 2023, 6:15 PM
shchenz added inline comments.Apr 25 2023, 6:41 PM
llvm/lib/Target/PowerPC/PPCMIPeephole.cpp
231

typo? Seem the two operand of the min/max are the same.

shchenz added inline comments.Apr 25 2023, 7:07 PM
llvm/lib/Target/PowerPC/PPCMIPeephole.cpp
222

record form too?

amyk added inline comments.Apr 27 2023, 8:19 AM
llvm/lib/Target/PowerPC/PPCMIPeephole.cpp
224

Is it possible to pull out MI->getOperand(1).getReg() to be used in both cases?

227

Do we need PPC::OR8, too?

stefanp updated this revision to Diff 518023.Apr 28 2023, 12:43 PM

Fixed the operands because they were not supposed to be the same.
Added the record forms.
Fixed the typo of having two XOR8 and no OR8.

shchenz accepted this revision as: shchenz.May 3 2023, 9:47 PM

LGTM.

This revision is now accepted and ready to land.May 3 2023, 9:47 PM
This revision was landed with ongoing or failed builds.May 8 2023, 11:25 AM
This revision was automatically updated to reflect the committed changes.