This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Remove legacy TA/TU pseudo distinction for load instructions
ClosedPublic

Authored by reames on Jun 29 2023, 12:58 PM.

Details

Summary

This change continues with the line of work discussed in https://discourse.llvm.org/t/riscv-transition-in-vector-pseudo-structure-policy-variants/71295.

This change targets all the pseudos used in loads (unit, strided, segmented, fault first, and their combinations). As with previous changes in the series, we replace the existing TA and TU forms with a single unified pseudo with a passthru (which may be implicit_def) and a policy operand.

One quirk is that I went ahead and treated the unmasked mask load instruction (vlm) the same way. We need the pass thru operand to model tail undefined, but since the instruction is unconditionally agnostic and the instruction has no mask, the policy operand is arguably unneeded. I kept it mostly for consistency sake.

Another quirk worth highlighting is that segment loads require a bit of dedicated handling. Surprisingly, we don't have IMPLICIT_DEF nodes of the right types, and attempting to use them results in some odd looking codegen and a few crashes. Instead, I left the REG_SEQUENCE form, and extended InsertVSETVLI to recognize the complex undefs. Arguably, we should probably revisit the handling of undef reg_sequence nodes here, but I'm hoping to side step that in this patch.

As before, we see codegen changes (some improvements and some regressions) due to scheduling differences caused by the extra implicit_def instructions. I did have to delete one register allocation regression test as I couldn't figure out how to meaningfully update it. I spent a significant amount of time trying, and finally gave up.

Diff Detail

Event Timeline

reames created this revision.Jun 29 2023, 12:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 29 2023, 12:58 PM
reames requested review of this revision.Jun 29 2023, 12:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 29 2023, 12:58 PM
This revision is now accepted and ready to land.Jul 5 2023, 11:31 AM
This revision was landed with ongoing or failed builds.Jul 5 2023, 1:12 PM
This revision was automatically updated to reflect the committed changes.
llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td