[PATCH] D91053: [PowerPC] Lump the constants to save one addis for each constant access

Qiu Chaofan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 16 22:52:37 PST 2020


qiucf added a comment.

> If there is only one constant, we will have one extra load with this patch. But the load could be optimized by linker if it merges the TOC. It is not easy inside compiler to handle it as ISEL is done basing on per BB, and we don't know if there are other constants until other BBs are selected. Any thoughts ?

As discussed, `FunctionLoweringInfo` is 'global' to SelectionDAG. Can we take advantage of it to record some global information? `FunctionLoweringInfo::set` has already scanned over each BB, each instruction.

Also, test changes in this patch are really huge. Are they all related?



================
Comment at: llvm/test/CodeGen/PowerPC/constant-pool.ll:19
+; CHECK-P9-NEXT:    ld r3, .LC0 at toc@l(r3)
+; CHECK-P9-NEXT:    lfs f1, 0(r3)
 ; CHECK-P9-NEXT:    blr
----------------
Regression?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91053



More information about the llvm-commits mailing list