This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Promote i1 shuffles to i8 shuffles.
ClosedPublic

Authored by craig.topper on May 2 2023, 11:19 PM.

Details

Summary

Otherwise I think we extract and use a build_vector. There may be
some more improvements that can be made and there might be some
cases that we should do something different for, but this seemed like a
decent starting point.

Diff Detail

Event Timeline

craig.topper created this revision.May 2 2023, 11:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 2 2023, 11:19 PM
craig.topper requested review of this revision.May 2 2023, 11:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 2 2023, 11:19 PM
luke added inline comments.May 3 2023, 1:57 AM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
3841

Can widenVectorOpsToi8 be reused here? It uses truncates instead of setcc, I'm not sure if that changes the resulting code

craig.topper added inline comments.May 3 2023, 9:42 AM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
3841

Using SETCC avoids a vand.vi instruction from the truncate lowering that looked unnecessary to me. That probably applies to VECTOR_REVERSE, VECTOR_INTERLEAVE, and VECTOR_DEINTERLEAVE too.

The main issue preventing using widenVectorOpsToi8 is that we can't create a shuffle with getNode. We have to call getVectorShuffle because the Mask isn't part of the operand list.

luke accepted this revision.May 3 2023, 9:47 AM

LGTM

This revision is now accepted and ready to land.May 3 2023, 9:47 AM
This revision was landed with ongoing or failed builds.May 4 2023, 7:47 PM
This revision was automatically updated to reflect the committed changes.