This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Move the creation of VLMaxSentinel to isel. Use X0 during lowering.
ClosedPublic

Authored by craig.topper on Feb 2 2022, 1:23 PM.

Details

Summary

The VLMaxSentinel is represented as TargetConstant, but that's included
in isa<ConstantSDNode>. To keep constant VLs and VLMax separate as long
as possible use the X0 register during lowering and only convert to
VLMaxSentinel during isel.

Diff Detail

Event Timeline

craig.topper created this revision.Feb 2 2022, 1:23 PM
craig.topper requested review of this revision.Feb 2 2022, 1:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2022, 1:23 PM

To clarify I understand the motivation of this: lowering won't have to special case every constant in the AVL operand just in case it is VLMaxSentinel, right?

If this is the intent, LGTM.

To clarify I understand the motivation of this: lowering won't have to special case every constant in the AVL operand just in case it is VLMaxSentinel, right?

If this is the intent, LGTM.

Yes that's the intent.

frasercrmck accepted this revision.Feb 10 2022, 2:03 AM

Thanks for a clarifying; I was also unsure as to the motivation, if I'm honest. LGTM too.

llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
652–653

I was curious when this landed: can't we use true_mask here? If the length of this vmset isn't VLMax we can still choose the undefined lanes to be 1, can't we?

This revision is now accepted and ready to land.Feb 10 2022, 2:03 AM
This revision was landed with ongoing or failed builds.Feb 10 2022, 9:29 AM
This revision was automatically updated to reflect the committed changes.