This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][NFC] Make Reduction scheduler resources SEW aware
ClosedPublic

Authored by michaelmaitland on May 25 2023, 10:15 AM.

Details

Summary

Create SchedWrites, WriteRes for reduction instructions that
are SEW specific. Future patches can use these resources
to customize the behavior of these resources depending on SEW.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptMay 25 2023, 10:15 AM
michaelmaitland requested review of this revision.May 25 2023, 10:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 25 2023, 10:15 AM
llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
3195–3196

As a side note, are both of these records supposed to set isCommutable? It is unclear because formatting was committed incorrectly. In either case I can fix braces and/or formatting in another patch.

Fix typo in comment string.

Use correct LMUL depending on F or FW instruction.

michaelmaitland marked an inline comment as not done.May 25 2023, 10:54 AM

Widening Reductions can work on M8.

craig.topper added inline comments.May 25 2023, 9:54 PM
llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
3467–3472

Should we have a different SEWSet that doesn't 64 in it since we can't widen those?

3503–3508

Same question about SEW=64.

llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
3467–3472

We would need to do this for all widening instructions, not just reductions? Same for narrowing instructions shouldn't contain the smallest SEW?

craig.topper added inline comments.May 26 2023, 8:17 AM
llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
3467–3472

SEW is the destination for narrowing instructions. SEW=64 can never be the destination of a narrowing instruction.

Do we use SEWSet on any widening or narrowing instructions other than reductions?

llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
3467–3472

Yes, we do. Let me put together another patch that fixes this for all widening and narrowing instructions.

llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
3467–3472

I take the back. We do not use SEWSet on any other widening or narrowing instructions. I will make the fix in this patch.

michaelmaitland marked 2 inline comments as done.

Remove SEW=64 from widening and narrowing instructions.

michaelmaitland marked an inline comment as done.May 26 2023, 9:05 AM
This revision is now accepted and ready to land.May 26 2023, 11:38 AM