[PATCH] D154168: [X86] Split SDISel call lowering out to its own file

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 27 13:01:37 PDT 2023


rnk added a comment.

Sorry for the delay, I think this requires some more careful rebasing now.

In D154168#4464266 <https://reviews.llvm.org/D154168#4464266>, @RKSimon wrote:

> No objections from me, but it'd be useful to take a look at build insights or something to get a better understanding of where the compile time is going inside X86ISelLowering, and not just blame it on #loc - amdgpu and aarch64 tend to be the bigger buildtimesinks for me on multi-target builds.

It's been years since I dug into it, but I think a lot of the compile time cost came down to lots of stuff getting inlined into the two large switches in this file, LowerOperation and PerformDAGCombine. What happens is that all the static functions local to this file get inlined, and those two functions become very large, slowing down optimization.

I previously attempted to refactor this file by extracting all of the vector shuffle combination logic, but it uses so many static helpers it doesn't have a straightforward way to do that.

I do recall compile time issues with AMDGPU and AArch64, but they tended to be from runaway table generated code, not handwritten code as we have in X86ISelLowering.



================
Comment at: llvm/lib/Target/X86/CMakeLists.txt:56
   X86InstructionSelector.cpp
+  X86ISelCallLowering.cpp
   X86ISelDAGToDAG.cpp
----------------
pengfei wrote:
> Would it be better to use `X86ISelLoweringCall`? I think it's more clean to start with `X86ISelLowering` if we have more such split in the future, and it's easy to understand they are extracted from `X86ISelLowering`.
That works for me.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154168



More information about the llvm-commits mailing list