Hi Jin, Thanks for looking into this. The numbers look very promising, I'll do some benchmarks with this as well when I get the chance.
> and represents each selected pair as a temporary, recognized PARALLEL > insn containing two scalar SETs. I'm not sold on this approach. Duplicating the move patterns and having to restore CFI info and other properties during split feels error-prone. I prefer the pair-fusion.cc pass to be generalized to allow for emitting multiple instructions instead of just one. If that is possible the splitting pass and the extra define_insn's will not be needed. I think that having a custom representation will also prevent sched2 from reasoning about the load and store, e.g. to adjust the load/store offset when moving it before or after increment/decrement. > This gives sched2 one schedulable unit for the pair. A RISC-V pass > immediately after sched2 restores the two scalar insns, preserving their > order, locations, register notes, and frame-related notes. This introduces a second representation of fused pairs during scheduling. Is there any advantage to this over SCHED_GROUP_P? Sticking to a single mechanism to glue instructions together is cleaner in my opinion. The hooks you introduced in your previous patches will have to be adapted to interpret these insns as fused in addition to SCHED_GROUP_P as well. Even if the merged insn is required, I prefer it to be split before sched2 to simplify scheduling. We noticed when working on the scheduling for designs where load/store pair fusion is less profitable than some other fusion cases that using a single instruction to represent a fused pair is very inflexible and potentially locks you in that fusion too early or too late, while SCHED_GROUP_P is easily adjusted. Thanks, Michiel
