You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[RISCV] Move exact VLEN VLMAX encoding to RISCVInsertVSETVLI. NFC-ish
In llvm#75412 and llvm#75509 we started to use the vsetvli a0, zero encoding to reduce
register pressure when we know the exact VLEN.
We do this by canonicalizing VL ops to X0 in RISCVISelLowering.
This is only needed for cases where the AVL doesn't fit inside an immediate
though, since we already have code in RISCVInsertVSETVLI that detects if we
know the exact VLEN and uses the immediate encoding if possible.
This patch removes the need to do the canonicalization in RISCVISelLowering by
handling said case in RISCVInsertVSETVLI itself.
There are a handful of reasons I'm proposing to do this:
- It keeps the vsetvli logic in the one pass
- We get to move code out of SelectionDAG so we don't forget about it in
GlobalISEL when the time comes
- Canonicalizing the VL in RISCVISelLowering means that we lose the original VL
for fixed length vectors, which might be useful information for passes that
sit between lowering and RISCVInsertVSETVLI. (I discovered this when working
on a patch for RISCVFoldMasks.cpp that worked on fixed length vectors)
0 commit comments