[PATCH] D84779: [AMDGPU] Add amdgpu specific loop threshold metadata

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 10:59:47 PDT 2020


jdoerfert added a comment.

> When the unroll factor isn't forced (unroll.disable, unroll.full, or unroll.count) then any cost model changes (or any other change that affects the threshold or loop size) can result in a change to the unroll behavior. That can be appropriate, just as a fixed unroll factor may not be with the same changes. I don't think there is a clear correct answer, just a compromise.

I guess the question is, what does a threshold of X mean? It seems to be an intrinsically magic number that is only meaningful for a particular version of the compiler (as @arsenm pointed out before). I mean, if anything changes, in the IR, the loop threshold computation, the input, ... the behavior can flip from unrolling to not unrolling. Most of these things are out of the control for the user, that is, the user actually not any better of than before by specifying a threshold of X instead of a unroll factor of Y, is she? Maybe I misunderstand the use case here, could you elaborate who/when the metadata is generated and what it is influenced by?

Also, if we conclude this is useful, it should be useful for the regular unroller, right? So we should check for the metadata there too I guess.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84779/new/

https://reviews.llvm.org/D84779



More information about the llvm-commits mailing list