Page MenuHomePhabricator

[PowerPC] handle more splat loads
Needs ReviewPublic

Authored by shchenz on Jul 22 2021, 8:15 AM.

Details

Reviewers
nemanjai
jsji
qiucf
Group Reviewers
Restricted Project
Summary

This is based on the patch in https://reviews.llvm.org/D106353 provided by @nemanjai

Add more splat load types handling and more tests.

Diff Detail

Event Timeline

shchenz created this revision.Jul 22 2021, 8:15 AM
shchenz requested review of this revision.Jul 22 2021, 8:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 22 2021, 8:15 AM
nemanjai added inline comments.Jul 26 2021, 4:13 AM
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
9071

Why take Op as a non-const reference? I don't see it being modified so it is not an output operand AFAICT.

llvm/lib/Target/PowerPC/PPCInstrVSX.td
2840

As far as I can tell, this is in a block that only sets let Predicates = [VSX]. It is not safe to use direct moves on subtargets that don't have direct moves.

llvm/test/CodeGen/PowerPC/load-and-splat.ll
223

Definitely bad. P7 doesn't have direct moves.

shchenz updated this revision to Diff 361984.Jul 27 2021, 5:08 AM
shchenz marked an inline comment as done.

1: Lint warning fix
2: LD_SPLAT for v8i16/v16i8 on pwr7

shchenz marked 2 inline comments as done.Jul 27 2021, 5:11 AM
shchenz added inline comments.
llvm/test/CodeGen/PowerPC/load-and-splat.ll
223

For this case, now we use one more instruction than the left ones. But I think it should still be a win as we don't use the stack which is always good for some opts, like leaf calls related optimizations. And now it uses fewer memory operations 2 vs 3.

shchenz marked an inline comment as done.Aug 8 2021, 7:29 PM

ping

gentle ping

@nemanjai Hi Nemanja, could you please help to have another look at this issue? Thanks.