[PATCH] D118316: [PowerPC] Materialize special ConstantFP using instructions instead of load from TOC
Ting Wang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 26 22:24:02 PST 2022
tingwang created this revision.
tingwang added reviewers: nemanjai, jsji, shchenz, qiucf, PowerPC.
tingwang added a project: LLVM.
Herald added subscribers: kbarton, hiraditya.
tingwang requested review of this revision.
Herald added a subscriber: llvm-commits.
ConstantFP in the range of [-16, 15] (excluding 0.0, which is done by XXLXOR) that can be exactly converted to integer can be materialized into register using VSPLTISW and XVCVSXWDP. This will reduce TOC usage, get rid of memory reference, and maybe save some TOC pointer calculations.
ConstantFP is expanded into load from TOC during ExpandNode. This patch identifies the opportunity before expansion, and does the manual instruction selection later. LIT test shows this patch exposes some other issues, please see my comments on the test scripts.
Since Power10 use prefixed instructions to materialize ConstantFP, maybe target Power9 for this change.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D118316
Files:
llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/test/CodeGen/PowerPC/handle-f16-storage-type.ll
llvm/test/CodeGen/PowerPC/recipest.ll
llvm/test/CodeGen/PowerPC/scalar_cmp.ll
llvm/test/CodeGen/PowerPC/toc-float.ll
llvm/test/CodeGen/PowerPC/vec_extract_p9.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118316.403494.patch
Type: text/x-patch
Size: 14260 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220127/39a03757/attachment.bin>
More information about the llvm-commits
mailing list