[PATCH] D158713: [GlobalISel] Refactor Combiner API

Pierre van Houtryve via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 24 00:42:34 PDT 2023


Pierre-vh created this revision.
Pierre-vh added reviewers: arsenm, aemerson, dsanders, foad.
Herald added subscribers: StephenFan, kerbowa, atanasyan, jrtc27, hiraditya, jvesely, sdardis.
Herald added a project: All.
Pierre-vh requested review of this revision.
Herald added subscribers: llvm-commits, wangpc, wdng.
Herald added a project: LLVM.

Remove CodeGen leftovers from the old combiner backend and adapt the API to fit the new backend better.
It's now quite a bit closer to how InstructionSelector works.

- `CombinerInfo` is now a simple "options" struct.
- `Combiner` is now the base class of all TableGen'd combiner implementation.
  - Many fields have been moved from derived classes into that class.
  - It has been refactored to create & own the Observer and Builder.
- `tryCombineAll` TableGen'd method can now be renamed, which allows targets to implement the actual `tryCombineAll` call manually and do whatever they want to do before/after it.

Note: `CombinerHelper` needs to be mutable because none of its methods are const. This can be revisited later.

Depends on D158710 <https://reviews.llvm.org/D158710>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158713

Files:
  llvm/include/llvm/CodeGen/GlobalISel/Combiner.h
  llvm/include/llvm/CodeGen/GlobalISel/CombinerInfo.h
  llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h
  llvm/include/llvm/Target/GlobalISel/Combine.td
  llvm/lib/CodeGen/GlobalISel/Combiner.cpp
  llvm/lib/Target/AArch64/AArch64Combine.td
  llvm/lib/Target/AArch64/GISel/AArch64O0PreLegalizerCombiner.cpp
  llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp
  llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp
  llvm/lib/Target/AArch64/GISel/AArch64PreLegalizerCombiner.cpp
  llvm/lib/Target/AMDGPU/AMDGPUCombine.td
  llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp
  llvm/lib/Target/AMDGPU/AMDGPUPreLegalizerCombiner.cpp
  llvm/lib/Target/AMDGPU/AMDGPURegBankCombiner.cpp
  llvm/lib/Target/Mips/MipsPostLegalizerCombiner.cpp
  llvm/lib/Target/Mips/MipsPreLegalizerCombiner.cpp
  llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158713.553023.patch
Type: text/x-patch
Size: 69383 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230824/31249567/attachment.bin>


More information about the llvm-commits mailing list