This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Materialize 34 bit constants with pli on Power 10.
ClosedPublic

Authored by stefanp on Dec 8 2020, 12:50 PM.

Details

Summary
NOTE: This patch was originally written by Anil Mahmud. His code has been rebased but otherwise left mostly unchanged.

A new instructon on Power 10 allows for the materialization of 34 bit
immediate values. This patch allows the compiler to take advantage of
the new instruction in this situation.

Diff Detail

Event Timeline

stefanp created this revision.Dec 8 2020, 12:50 PM
stefanp requested review of this revision.Dec 8 2020, 12:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 8 2020, 12:50 PM
stefanp added a reviewer: Restricted Project.Dec 8 2020, 12:51 PM

Good point. I will rebase on top of that patch since that should go in first.

stefanp updated this revision to Diff 310832.Dec 10 2020, 4:00 AM

Rebased on top of D92089

amyk accepted this revision as: amyk.Dec 17 2020, 7:46 AM
amyk added a subscriber: amyk.

I just have a minor nit, but overall it looks good to me.

llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
1054

nit: I think the preference is to name this as Subtarget rather than PPCSubTarget (As seen in https://reviews.llvm.org/D81623)

This revision is now accepted and ready to land.Dec 17 2020, 7:46 AM
lei added inline comments.Dec 17 2020, 8:58 AM
llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
1053

doc.

llvm/lib/Target/PowerPC/PPCInstrPrefix.td
2622

tc?

stefanp updated this revision to Diff 314712.Jan 5 2021, 1:47 PM

Added comment for function.
Fixed variable name.
Added test case for 32 bit target.

stefanp updated this revision to Diff 314953.Jan 6 2021, 11:49 AM

Updated some of the test cases for the 32 bit compilation.

amyk added a comment.Jan 6 2021, 1:27 PM

Thanks for updating. I just noticed one more minor nit.

llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
1055

s/meterialize/materialize

stefanp updated this revision to Diff 315094.Jan 7 2021, 4:06 AM

Fixed spelling mistake in comment.

stefanp updated this revision to Diff 320742.Feb 2 2021, 4:05 AM

Rebased to top of main branch.

stefanp updated this revision to Diff 320756.Feb 2 2021, 5:19 AM

Adjusted test cast that I forgot to fix on rebase.

This revision was landed with ongoing or failed builds.Feb 2 2021, 7:50 AM
This revision was automatically updated to reflect the committed changes.