Page MenuHomePhabricator

[NFC][PowerPC] Move the folding RLWINMs from ppc-mi-peephole to PPCInstrInfo.
ClosedPublic

Authored by Esme on Oct 20 2020, 9:44 PM.

Details

Summary

We have the patterns to fold 2 RLWINMs in ppc-mi-peephole, while some RLWINM will be generated after RA, for example https://reviews.llvm.org/rGc4690b007743d2f564bc1156fdbdbcaad2adddcc. If the RLWINM generated after RA followed by another RLWINM, we expect to perform the optimization after RA, too.
This is a NFC patch to move the folding patterns to PPCInstrInfo, and the follow-up works will be calling it in pre-emit-peephole and expand the patterns to handle more cases.

Diff Detail

Event Timeline

Esme created this revision.Oct 20 2020, 9:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 20 2020, 9:44 PM
Esme requested review of this revision.Oct 20 2020, 9:44 PM
Esme added a reviewer: Restricted Project.Oct 20 2020, 9:54 PM
Esme updated this revision to Diff 299576.Oct 21 2020, 12:30 AM
shchenz accepted this revision.Oct 21 2020, 6:18 PM

Thanks for trying to extend it for post-RA. This makes sense to me as some RLWINM will be generated after RA. One nit and please also fix the lint suggestions.

llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
3193

I think a more general name for this function would be better for later extension? For example simplifyRotateAndMaskInstr()

This revision is now accepted and ready to land.Oct 21 2020, 6:18 PM
This revision was landed with ongoing or failed builds.Mon, Nov 2, 10:30 PM
This revision was automatically updated to reflect the committed changes.