[llvm] llvm-mca: Disentangle `MemoryGroup` from `LSUnitBase` (PR #114159)

Andrea Di Biagio via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 30 04:24:07 PDT 2024


adibiagio wrote:

> In my eyes, this is an implementation detail. Other LSUnits may want to keep track of data dependencies in different ways. 

In my eyes, using a DAG for scheduling memory groups was not necessarily an implementation detail.
The general idea was that, no matter which consistency model you want to implement, you can always represent memory dependencies using edges of a DAG, where nodes are (groups of) instructions.
Other algorithms in LLVM use similar approaches. For example, machine schedulers also use a DAG to track dependencies in a code region.

The original intention was to provide a target independent mechanism for adding nodes and edges to the dependency graph. Custom LSUnits can then decide when/how to assign edges/form groups.

Just to clarify, I am not against this patch. I am mainly curious about why using the existing framework would not work in your particular case. What is your solution using for tracking execution of dependent memory operations?

Generally speaking, I would be tempted to accept your patch. However, I'd like to hear the opinion of @mshockwave and @michaelmaitland on this.

https://github.com/llvm/llvm-project/pull/114159


More information about the llvm-commits mailing list