This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Define different pseudo instructions for different FPR.
ClosedPublic

Authored by HsiangKai on Jan 22 2021, 7:15 AM.

Details

Summary

When spilling, the spill size will depend on the size of register class.
For .vf vector instructions, it may spill the floating point scalar
argument. In order to use the correct load/store instructions for
spilling, we need to provide the correct floating point register class
for the .vf vector pseudo instructions.

In this commit, we define the .vf pseudo instructions as three
different kinds of pseudo instructions for half/float/double. For
example, PseudoVFADD_M1 will become as PseudoVFADD_F16_M1,
PseudoVFADD_F32_M1, and PseudoVFADD_F64_M1.

Diff Detail

Event Timeline

HsiangKai created this revision.Jan 22 2021, 7:15 AM
HsiangKai requested review of this revision.Jan 22 2021, 7:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 22 2021, 7:15 AM
Herald added a subscriber: MaskRay. · View Herald Transcript
HsiangKai updated this revision to Diff 318520.Jan 22 2021, 7:28 AM
  • Avoid defining redundant pseudo instructions for widening instructions.
craig.topper accepted this revision.Jan 22 2021, 1:43 PM

L:GTM with that one comment.

llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
42

Please mark this with a FIXME to cleanup. Fraser or I can take care of it as a follow up.

This revision is now accepted and ready to land.Jan 22 2021, 1:43 PM
HsiangKai updated this revision to Diff 318700.Jan 22 2021, 5:21 PM
frasercrmck added inline comments.Jan 25 2021, 1:46 AM
llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
4195

How come you're not using GetScalarSuffix in these cases too?

llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
42

Yeah, no problem, I can take a look.

craig.topper added a comment.EditedJan 25 2021, 11:59 AM

Is this patch really dependent on frame lowering and spilling or can we land this before the branch tomorrow?

It's looking like we may have to cherry pick frame lowering and spilling after the branch. So if this patch isn't dependent we should go ahead so we don't have to cherry pick it too.

We're multiplying by 3 the _VF pseudos but to be honest I don't see any better alternative.

craig.topper added inline comments.Jan 25 2021, 2:20 PM
llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
42

@frasercrmck I'm looking at this and might be proposing changes to this patch as well.

Is this patch really dependent on frame lowering and spilling or can we land this before the branch tomorrow?

It's looking like we may have to cherry pick frame lowering and spilling after the branch. So if this patch isn't dependent we should go ahead so we don't have to cherry pick it too.

I will land this patch first.

llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
4195

getScalarSuffix() may need to be defined in more general way.

This revision was landed with ongoing or failed builds.Jan 25 2021, 11:52 PM
This revision was automatically updated to reflect the committed changes.