[PATCH] D106775: [MCA] Moving the target specific CustomBehaviour impl. from /tools/llvm-mca/ to /lib/Target/.

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 26 09:01:02 PDT 2021


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/CMakeLists.txt:159
   Passes
+  AMDGPUTargetMCA
   AMDGPUDesc
----------------
andreadb wrote:
> foad wrote:
> > I don't speak cmake. What does this line do? Does it mean that the target MCA class will be pulled into the AMDGPUCodeGen library? That seems unnecessary, since it's not needed for codegen.
> That's correct.
> 
> In https://reviews.llvm.org/D104730, Patrick has suggested three options for solving this issue. This was his comment:
> 
> > @tstellar @andreadb I've been thinking about the problem for a bit now and have been brainstorming different ideas and digging through the code. I just made a post on the llvm discourse to hopefully get some feedback on the issue (and some potential solutions that I've come up with). If you guys are curious or would be willing to take a look, here's the post https://llvm.discourse.group/t/need-help-deciding-how-to-access-backend-functions-from-within-a-tool/3915 .
> 
> On that discourse link, both me and Tom have suggested to implement option 2. (i.e. this patch). We believe that it is the simplest solution, and we don't expect the CustomBehaviour code to ever be big enough in general.
> 
> I agree that this change is not strictly needed for codegen now. However, that might change in future.
> 
> During the development of MCA,it was requested to make MCA accessible from Codegen. That is because a few people (including @courbet 's team) expressed the intention of using MCA to define their own custom machine scheduler passes.
> 
> Unfortunately, we never really got to that point (mainly due to the lack of devs time). Nowadays, MCA is also built as a library. However, it is missing some lowering functionalities to translate from MachineInstr to mca::Instruction. However, that could change in future; if so, then this patch would make things much easier.
> 
> That being said, the main reason why we suggested to use this approach is mainly because we assumed that the impact on Codegen of CustomBehaviour objects would always be relatively small. Maybe Patrick could give a bit more details on this (since he presumably has also some numbers to show).
Thanks for explaining. I don't object to this, just wanted to make sure I understood how it worked.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106775



More information about the llvm-commits mailing list