The Reduction instruction destination register LMUL is 1. But the source
register(vs2) has different LMUL(MF8 to M8). It's beneficial to know how
many registers are working on reduction instructions.
This patch creates separate SchedWrite for each relevant LMUL that from VS2.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Does it make sense to change the SchedReadss and ReadAdvance to be LMUL specific for this class of instuctions?
llvm/lib/Target/RISCV/RISCVInstrInfoV.td | ||
---|---|---|
728–729 | Other LMUL specific SchedWrites use the suffix UpperBound. Is there a difference in meaning between UpperBound and From_UpperBound? | |
llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td | ||
3303–3304 | Other LMUL specific SchedWrites use the suffix MX. Is there a difference in meaning between MX and From_MX? |
llvm/lib/Target/RISCV/RISCVScheduleV.td | ||
---|---|---|
755 | VFW prefix should use LMULWriteResFW class. |
It is helpful to describe the forwarding behavior. In order to simplify the design,
I think that the description Latency and ResourceCycles are all done in WriteRes.
llvm/lib/Target/RISCV/RISCVInstrInfoV.td | ||
---|---|---|
728–729 | The destunation LMUL of Reduction instructions is 1, I use | |
llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td | ||
3303–3304 | The use of From_MX is just to be noticed that the LMUL of the source operand is different. |
The suffixes From_UpperBound and From_MX come from the naming of the LMULWriteRes in the ScheduleV file. I think it makes sense to differentiate these LMULWriteRes with some sort of suffix, because they represent behavior that is different than the other LMULWriteRes definitions. I think From is a good suffix choice. Perhaps a comment above the definition of these LMULWriteRess that elaborates on the meaning of the suffix would be a helpful reference.
llvm/lib/Target/RISCV/RISCVScheduleV.td | ||
---|---|---|
755 | I think we still want WriteVFWRedV_From to use LMULWriteResFW class since its a floating point widening operation. After that change, it LGTM. |
Change LMULWriteRes to LMULWriteResFWRed.
The following link shows LMUL of vfwredosum and vfwredusum are between MF4 to M8.
So I add LMULWriteResFWRed for widening floating-point Reduction.
https://github.com/riscv-non-isa/rvv-intrinsic-doc/blob/master/auto-generated/intrinsic_funcs/09_vector_reduction_functions.md#vector-widening-floating-point-reduction-functions
Other LMUL specific SchedWrites use the suffix UpperBound. Is there a difference in meaning between UpperBound and From_UpperBound?