This generalizes isElementRotate to work when there's only a single
slide needed. I've removed matchShuffleAsSlideDown which is now
redundant.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
2501–2513 | nit: I feel it would be good to have a comment talk about what's number mean for L0 and Hi. | |
2568–2569 | If I understand code correctly, the Lo and Hi could be either 0 or 1, why do we need to check >=0 for them? | |
2672 | Why not move this line into 2650? is it because readability? | |
2691 | nit: I feel a little bit confusing here because we have already mentioned this behavior above but using different words. // We found a rotation. We need to slide V1 down by Rotation. Using // (NumElts - Rotation) for VL. Then we need to slide V2 up by // (NumElts - Rotation) using NumElts for VL. If we are doing SLIDEDOWN+SLIDEUP (alias to rotation), reduce the VL (alias reduce VL into to "NumElts - Rotation") for the SLIDEDOWN. In addition, I think 2654~2656 comment need to replace V1 and V2 with LoV and HiV? |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
2568–2569 | They start as -1 and they won't always be overwritten to 0 or 1. |
Thanks, it's very clear!
Reuse the isElementRotate is a really good catch and even find out the more optimization opportunity, Good job Craig!
extra word is here?