OSDN Git Service

[llvm-mca] Account for buffered resources when analyzing "Super" resources.
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Fri, 9 Nov 2018 19:30:20 +0000 (19:30 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Fri, 9 Nov 2018 19:30:20 +0000 (19:30 +0000)
commitd09d3d9eec1af25eb4109d503d623ca0297a3898
treefed235bdfffbec73b1ef44e9e587f46a7df902d3
parent86c04a0332326df3a548e0254f8a07a6159230f1
[llvm-mca] Account for buffered resources when analyzing "Super" resources.

This was noticed when working on PR3946.
By construction, a group cannot be used as a "Super" resource. That constraint
is enforced by method `SubtargetEmitter::ExpandProcResource()`.

A Super resource S can be part of a group G. However, method
`SubtargetEmitter::ExpandProcResource()` would not update the number of
consumed resource cycles in G based on S.
In practice, this is perfectly fine because the resource usage is correctly
computed for processor resource units. However, llvm-mca should still check if G
is a buffered resource.
Before this patch, llvm-mca didn't correctly check if S was part of a group that
defines a buffer. So, the instruction descriptor was not correctly set.

For now, the semantic change introduced by this patch doesn't affect any of the
upstream scheduling models. However, it will allow to make some progress on PR3946.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346545 91177308-0d34-0410-b5e6-96231b3b80d8
tools/llvm-mca/lib/InstrBuilder.cpp