[PATCH] D88177: [AArch64][GlobalISel] Infer whether G_PHI is going to be a FPR in regbankselect
Jessica Paquette via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 23 11:54:15 PDT 2020
paquette created this revision.
paquette added a reviewer: aemerson.
Herald added subscribers: danielkiss, hiraditya, kristof.beyls, rovka.
Herald added a project: LLVM.
paquette requested review of this revision.
Some instructions (G_LOAD, G_SELECT, G_UNMERGE_VALUES) check if their uses will define/use FPRs (using `onlyUsesFP` and `onlyDefinesFP`).
The register bank of a use isn't necessarily known when an instruction asks for this.
Teach `hasFPConstraints` to look at the instructions feeding into a G_PHI when its destination bank is unknown. If any of them are FPR, assume the entire G_PHI will also be assigned a FPR.
Since a phi can have many inputs, and those inputs can in turn be phis, restrict the search depth to a very low number.
Also improve the docs for `hasFPConstraints` and friends a little.
This is a 0.3% code size improvement on CTMark/Bullet at -O3, and a 0.2% code size improvement at CTMark/pairlocalalign at -O3.
https://reviews.llvm.org/D88177
Files:
llvm/lib/Target/AArch64/GISel/AArch64RegisterBankInfo.cpp
llvm/lib/Target/AArch64/GISel/AArch64RegisterBankInfo.h
llvm/test/CodeGen/AArch64/GlobalISel/regbank-fp-use-def.mir
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88177.293829.patch
Type: text/x-patch
Size: 13854 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200923/d6394dd8/attachment.bin>
More information about the llvm-commits
mailing list