This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Provide a isOneSourceVECTOR_SHUFFLE function. NFC.
Needs ReviewPublic

Authored by HanKuanChen on Nov 13 2022, 12:38 AM.

Details

Summary

This function is used to reduce multiple check about whether a
vector_shuffle is from a same and contiguous source.

Diff Detail

Event Timeline

HanKuanChen created this revision.Nov 13 2022, 12:38 AM
HanKuanChen requested review of this revision.Nov 13 2022, 12:38 AM
craig.topper added inline comments.Nov 13 2022, 4:14 PM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
2734

I kind of think a function starting with is should return a bool. Maybe getSingleShuffleSource?

craig.topper added inline comments.Nov 13 2022, 4:16 PM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
2768

Should isVnsrlShuffle return the SDValue returned from isOneSourceVECTOR_SHUFFLE? Looks like the caller makes an assumption about how to find the source.

HanKuanChen added inline comments.Nov 13 2022, 8:34 PM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
2768

Should isVnsrlShuffle return the SDValue returned from isOneSourceVECTOR_SHUFFLE? Looks like the caller makes an assumption about how to find the source.

Does that mean isVnsrlShuffle should be renamed to something like getVnsrlShuffle?