Now the function hasRVVFrameObject is using hasVInstructions() as the return value. This patch changed it to two parts judgement. Firstly, check if there is any frame object that is scalable vector. If there is no scalable vector frame object, then check if there is any V instruction in the function.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
Is it possible write a test for this?
llvm/lib/Target/RISCV/RISCVFrameLowering.cpp | ||
---|---|---|
951–952 | Does this comment need to be updated? |
I add a case to show the difference when the function will not use any rvv.
llvm/lib/Target/RISCV/RISCVFrameLowering.cpp | ||
---|---|---|
951–952 | Done. |
llvm/lib/Target/RISCV/RISCVFrameLowering.cpp | ||
---|---|---|
976 | Is it possible to write a function that contains nothing but whole register loads/stores/moves such that no instruction access VL but needs to spill a register? |
llvm/lib/Target/RISCV/RISCVFrameLowering.cpp | ||
---|---|---|
976 | I am not sure about this, I think maybe it's not possible to generate independent whole register instructions. Do you have any good opinion about the condition? |
llvm/lib/Target/RISCV/RISCVFrameLowering.cpp | ||
---|---|---|
976 | Maybe check any vector register are appear in the function either use or def? |
llvm/lib/Target/RISCV/RISCVFrameLowering.cpp | ||
---|---|---|
976 | This generates a single whole register load #include <riscv_vector.h> vfloat32m4_t foo(vfloat32m4_t *a) { return *a; } |
llvm/lib/Target/RISCV/RISCVFrameLowering.cpp | ||
---|---|---|
976 | That was only meant as an example of how register instrutions can be generated. Not that it creates scalable frame object. |
llvm/lib/Target/RISCV/RISCVFrameLowering.cpp | ||
---|---|---|
976 | Done, I changed the condition to check if there ia any VR or VTYPE. |
llvm/lib/Target/RISCV/RISCVFrameLowering.cpp | ||
---|---|---|
978 | NO, what do you think is a good way to check if there is any VR? |
llvm/lib/Target/RISCV/RISCVFrameLowering.cpp | ||
---|---|---|
978 | I think using MachineRegisterInfo::getRegClass |
Does this comment need to be updated?