This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Generate Power9 extswsli extend sign and shift immediate instruction
ClosedPublic

Authored by RolandF on Jul 26 2018, 3:22 PM.

Details

Summary

Add a DAG combine for the PowerPC code generator to generate the Power9 extswsli extend sign and shift immediate instruction.

Diff Detail

Repository
rL LLVM

Event Timeline

RolandF created this revision.Jul 26 2018, 3:22 PM
inouehrs added inline comments.
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
14113 ↗(On Diff #157588)

Do you have any reason to use isConstOrConstSplat instead of more common isa<ConstantSDNode>(N1)?

14120 ↗(On Diff #157588)

You don't need to use a variable N000 since it is used only once. N000 and N00 seem confusing for me.

RolandF updated this revision to Diff 159816.Aug 8 2018, 3:31 PM

Updated to incorporate review comments.

RolandF marked 2 inline comments as done.Aug 8 2018, 3:34 PM
nemanjai added inline comments.Aug 13 2018, 6:29 AM
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
14118 ↗(On Diff #159816)

The use of isa followed by cast is discouraged. Please use dyn_cast. Then this can be turned into an early exit if any of the conditions are not met and the body of this block doesn't need to be nested in an if.

RolandF updated this revision to Diff 160709.Aug 14 2018, 3:37 PM

Update to access constant shift amount by dynamic cast and to reverse if from block form to early exit.

nemanjai accepted this revision.Aug 15 2018, 6:18 AM

LGTM aside from the minor nit.

llvm/lib/Target/PowerPC/PPCISelLowering.cpp
14118 ↗(On Diff #160709)

Nit: please change CN1 == NULL to either !CN1 or CN1 == nullptr. Feel free to do this on the commit - no new review required.

This revision is now accepted and ready to land.Aug 15 2018, 6:18 AM
RolandF marked an inline comment as done.Aug 15 2018, 11:49 AM
RolandF updated this revision to Diff 160881.Aug 15 2018, 11:57 AM

Changed == NULL to == nullptr.

RolandF added inline comments.Aug 15 2018, 12:00 PM
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
14118 ↗(On Diff #160709)

Sorry, I don't have commit access, so I have updated the diff.

RolandF marked 2 inline comments as done.Aug 15 2018, 12:00 PM
This revision was automatically updated to reflect the committed changes.