[PATCH] D148286: [PowerPC] Merge the constant pool on Power PC AIX.

Stefan Pintilie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 13 18:30:41 PDT 2023


stefanp created this revision.
stefanp added reviewers: nemanjai, lei, amyk.
Herald added subscribers: shchenz, kbarton, hiraditya.
Herald added a project: All.
stefanp requested review of this revision.
Herald added a project: LLVM.

On AIX we currently have one TOC entry for each constant in the constant
pool. This can create an issue in cases where there are a lot of
constants and we fill the TOC with constant pool entries.

This patch will try to merge the constant pool enties on the module
level. A struct will be created with all of the constants in that
module and the base address of that struct will be stored as a gobal
variable. All accesses to the constants in the struct will be done via
the base address of the global struct and and offset.

This pass was added after instruction selection. It was not easy to
decide where to place this pass as it doesn't fit well anywhere in the
piplelne. If this were to be done before instruction selection all
constants that may have been materialized or may have been folded away
in some fashion will be included in a merged constant pool. If this was
to be added as a feature in instruction selection it would be a module
level feature incuded in a basic block level pass.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D148286

Files:
  llvm/include/llvm/CodeGen/MachineConstantPool.h
  llvm/lib/Target/PowerPC/CMakeLists.txt
  llvm/lib/Target/PowerPC/PPC.h
  llvm/lib/Target/PowerPC/PPCMergeConstPoolEntries.cpp
  llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
  llvm/lib/Target/PowerPC/PPCTargetMachine.h
  llvm/test/CodeGen/PowerPC/O3-pipeline.ll
  llvm/test/CodeGen/PowerPC/ppc-aix-const-pool-merge.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148286.513407.patch
Type: text/x-patch
Size: 51307 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230414/91a9ae18/attachment.bin>


More information about the llvm-commits mailing list