We can use a 32-bit splat and bitcast to i64 vector.
This only handles the case where we are using vlmax so that the new
vl is cheap to compute. This could be generalized to double the VL.
Paths
| Differential D158879
[RISCV] Improve splatPartsI64WithVL for vlmax scalable vector constants where Hi and Lo are the same. ClosedPublic Authored by craig.topper on Aug 25 2023, 12:39 PM.
Details Summary We can use a 32-bit splat and bitcast to i64 vector. This only handles the case where we are using vlmax so that the new
Diff Detail
Event TimelineComment Actions LGTM As I follow up, I'd be really tempted to just double the VL. At a minimum, doing so for constants encodable in vsetivli seems like a clear win. This revision is now accepted and ready to land.Aug 25 2023, 1:00 PM Comment Actions
Yep that's exactly the change that's needed to improve the output of D158870. We have to be careful so that doubling doesn't turn something like 0x80000000 into 0. So constants are a lot easier than arbitrary VL. This revision was landed with ongoing or failed builds.Aug 25 2023, 2:15 PM Closed by commit rG398c85545772: [RISCV] Improve splatPartsI64WithVL for vlmax scalable vector constants where… (authored by craig.topper). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 553623 llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/test/CodeGen/RISCV/rvv/bitreverse-sdnode.ll
llvm/test/CodeGen/RISCV/rvv/bitreverse-vp.ll
llvm/test/CodeGen/RISCV/rvv/ctlz-sdnode.ll
llvm/test/CodeGen/RISCV/rvv/ctpop-sdnode.ll
llvm/test/CodeGen/RISCV/rvv/ctpop-vp.ll
llvm/test/CodeGen/RISCV/rvv/cttz-sdnode.ll
llvm/test/CodeGen/RISCV/rvv/cttz-vp.ll
llvm/test/CodeGen/RISCV/rvv/splat-vector-split-i64-vl-sdnode.ll
|