[llvm] [llvm-mca] Account for AcquireAtCycles in llvm-mca (PR #80742)

Andrea Di Biagio via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 29 07:28:22 PST 2024


================
@@ -89,11 +89,11 @@ static void initializeUsedResources(InstrDesc &ID,
       AllInOrderResources &= (PR.BufferSize <= 1);
     }
 
-    CycleSegment RCy(0, PRE->ReleaseAtCycle, false);
+    CycleSegment RCy(PRE->AcquireAtCycle, PRE->ReleaseAtCycle, false);
----------------
adibiagio wrote:

> This code here made me wonder if we are accounting for AcquireAtCycle correctly.
> 
> The `NumCyclesUsed` class may only represent the total number of cycles used, without saying anything about when the resource is acquired or released. `CycleSegment` class looks like it is the one who is responsible for taking this information into account. After looking into it, I found that although this information is being tracked, it is not being used as needed

Correct.

If you see my comment from three weeks ago, this is literally what I was trying to say when I wrote "this patch doesn't add support for AcquireAtCycle".
The ResourceManager still assumes that every resource is consumed at relative cycle zero (i.e. relative to the issue event).

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


More information about the llvm-commits mailing list