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

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 12 10:34:13 PST 2024


michaelmaitland wrote:

> > TargetSchedule.td explicitly allows the usage of a ProcResource for zero cycles, in order to represent that the ProcResource must be available but is not consumed by the instruction.
> 
> Why is this allowed? And where is this specified? I could not find any reference of this in TargetSchedule.td

https://github.com/llvm-mirror/llvm/blob/2c4ca6832fa6b306ee6a7010bfb80a3f2596f824/include/llvm/Target/TargetSchedule.td#L285

> It seems to me that, if a resource is required to be available, it means that the instruction needs to use it? Why not just mark it for at least 1 cycle usage?

It is not entirely clear why someone would want to do this, and I am happy to post a patch that removes allowing 0 usage and get feedback. We use it in our downstream but it isn't clear why we shouldn't use the resource for a single cycle, but it leads to better scheduling empirically on some workloads.

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


More information about the llvm-commits mailing list