[PATCH] D72814: [AArch64][GlobalISel] Change G_FCONSTANTs feeding into stores into G_CONSTANTS
Jessica Paquette via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 15 16:32:18 PST 2020
paquette created this revision.
paquette added a reviewer: aemerson.
Herald added subscribers: Petar.Avramovic, hiraditya, kristof.beyls, rovka.
Herald added a project: LLVM.
Given the following situation:
x = G_FCONSTANT (something that can't be materialized)
G_STORE x, some_addr
We know that x must be materialized as at least a single mov. However, at the time of selection, the G_STORE will have been regbankselected to a FPR store.
So, as a result, you'll get an unnecessary fmov into the G_STORE.
Storing a constant value in a GPR and a constant value in a FPR are the same. So, whenever you see a G_FCONSTANT that feeds into only G_STORES, so might as well make it a G_CONSTANT.
This adds a target-specific combine which changes G_FCONSTANTs feeding into G_STOREs into G_CONSTANTs.
https://reviews.llvm.org/D72814
Files:
llvm/lib/Target/AArch64/AArch64Combine.td
llvm/lib/Target/AArch64/AArch64PreLegalizerCombiner.cpp
llvm/test/CodeGen/AArch64/GlobalISel/combine-fconstant.mir
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72814.238390.patch
Type: text/x-patch
Size: 5160 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200116/716581b1/attachment.bin>
More information about the llvm-commits
mailing list