Open
Description
I'm not sure if this belongs to a bug, but I wanted to open the conversation about the best approach to dealing with scheduling of VCIX instructions. What I'd like to be able to do is to:
- Be able to provide accurate latencies of VCIX instructions in our internal LLVM build. (NB: These latencies would not be upstreamed)
- But reuse the upstream
SiFive7Model
. - Make it reasonably easy to keep up with the upstream changes of
SiFive7Model
(e.g., manually copy & paste of the VCIX latencies would be ok, but it'd be nice to avoid anything more complicated).
What would be the best approach to achieve this?
Idea 1:
- Create a copy of
RISCVSchedSiFive7.td
(let's call itRISCVSchedSiFive7Foobar.td
). - But this leads to name conflicts since everything is just included in
RISCV.td
. - So one could run
sed s/SiFive7/SiFive7Foobar/g
over the file. This is not quite enough (VLDSX0Pred
conflicts); perhaps we could try to use theSiFive7
prefix for all definitions in that file? Would that be acceptable? - The above should be mostly mechanical (could be automated by a script). Then it would be a matter of (semi-)manually adjusting the VCIX scheduling information.
Idea 2:
- Perhaps we could refactor
RISCVSchedSiFive7.td
to have something likeSiFive7ModelTemplate
that would be a multiclass and could be instantiated with different VCIX scheduling information? (i.e., we would just instantiate it to create the currentSiFive7Model
) - This seems like a cleaner approach where
RISCVSchedSiFive7Foobar.td
would not have to be a copy (with all thesed
renaming), it would just instantiate the model and provide the custom VCIX latencies. - But I'm not sure if this is even feasible? (not a TableGen expert!) Would we run into some issues with this? Would it significantly increase the maintenance burden of
RISCVSchedSiFive7.td
?
@topperc @michaelmaitland What are your thoughts? Any better ideas would be appreciated! 🙂