[PATCH] D141565: [RISCV][CodeGen] Account for LMUL from VS2 for Vector Reduction Instructions

Monk Chiang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 18:04:53 PST 2023


monkchiang added a comment.

In D141565#4048418 <https://reviews.llvm.org/D141565#4048418>, @michaelmaitland wrote:

> Does it make sense to change the `SchedReads`s and `ReadAdvance` to be LMUL specific for this class of instuctions?

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.



================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoV.td:728
   def _VS : VALUVV<funct6, OPMVV, opcodestr # ".vs">,
-            Sched<[WriteVIRedV, ReadVIRedV, ReadVIRedV0, ReadVMask]>;
+            Sched<[WriteVIRedV_From_UpperBound, ReadVIRedV, ReadVIRedV0,
+                   ReadVMask]>;
----------------
michaelmaitland wrote:
> Other LMUL specific `SchedWrite`s use the suffix `UpperBound`. Is there a difference in meaning between `UpperBound` and `From_UpperBound`?
The destunation LMUL of Reduction instructions is 1, I use 
`From_UpperBound`  to distinguish the source operand of reading: LMUL=MF8 to M8.
Do you suggest I use ` UpperBound` , ` Read_UpperBound`  or something else?


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td:3303
     defm _VS : VPseudoTernary<V_M1.vrclass, m.vrclass, V_M1.vrclass, m>,
-               Sched<[WriteVIRedV, ReadVIRedV, ReadVIRedV, ReadVIRedV, ReadVMask]>;
+               Sched<[WriteVIRedV_From_MX, ReadVIRedV, ReadVIRedV, ReadVIRedV,
+                      ReadVMask]>;
----------------
michaelmaitland wrote:
> Other LMUL specific SchedWrites use the suffix `MX`. Is there a difference in meaning between `MX` and `From_MX`?
The use of  `From_MX` is just to be noticed that the LMUL of the source operand is different.
But it is the same for scheduling, I personally prefer to use `MX` .


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141565/new/

https://reviews.llvm.org/D141565



More information about the llvm-commits mailing list