aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorPhilip Reames <preames@rivosinc.com>2023-11-28 10:45:22 -0800
committerGitHub <noreply@github.com>2023-11-28 10:45:22 -0800
commit02cbae4fe0683c90ccd544d0be7fa82732a502e8 (patch)
treedadfe642cfb3664ad4569d0f3edeca0eeebf22d9 /clang/lib/CodeGen/CodeGenModule.cpp
parentc846f8ba104f18053ce666de7e2da0a82deb45cd (diff)
downloadllvm-02cbae4fe0683c90ccd544d0be7fa82732a502e8.zip
llvm-02cbae4fe0683c90ccd544d0be7fa82732a502e8.tar.gz
llvm-02cbae4fe0683c90ccd544d0be7fa82732a502e8.tar.bz2
[RISCV] Work on subreg for insert_vector_elt when vlen is known (#72666) (#73680)
If we have a constant index and a known vlen, then we can identify which registers out of a register group is being accessed. Given this, we can reuse the (slightly generalized) existing handling for working on sub-register groups. This results in all constant index extracts with known vlen becoming m1 operations. One bit of weirdness to highlight and explain: the existing code uses the VL from the original vector type, not the inner vector type. This is correct because the inner register group must be smaller than the original (possibly fixed length) vector type. Overall, this seems to a reasonable codegen tradeoff as it biases us towards immediate AVLs, which avoids needing the vsetvli form which clobbers a GPR for no real purpose. The downside is that for large fixed length vectors, we end up materializing an immediate in register for little value. We should probably generalize this idea and try to optimize the large fixed length vector case, but that can be done in separate work.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions