[llvm] [CodeGen][MISched] Handle empty sized resource usage. (PR #75951)

Francesco Petrogalli via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 02:19:21 PST 2024


https://github.com/fpetrogalli commented:

Thank you for your patch, I agree that if the scheduler needs to know about empty resource usage, we need to take care of this.

In the commit message you say:
> In order to remedy this, this patch handles the special case of when there is a zero sized usage of a resource without creating a ResourceSegment for it.

Correct me if I am wrong, but this doesn't seem to be what your patch is doing?
A ResourceSegment is always created, even with your changes, it is just that you keep it empty (no intervals in it).

On a more general note. Would it be possible to have the scheduler deal with the situation "[...] that the ProcResource must be available but is not consumed by the instruction" by not even trying to add the interval? I am asking this because the situation in which we need to decide whether or not we can schedule an instruction in the case of "we have a resource that is not used by the instruction but needs to be available" seems to be different from the case  of "we have a resource that is used by the instruction", where we are forced to check whether or not we can schedule by checking the content of the ResourceSegment (empty/interval history overlapping the cycle in which the instruction will use that resource). 

Francesco

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


More information about the llvm-commits mailing list