[llvm] [X86][NVPTX][LegalizeDAG] If i16 legal, legalize FABS/FNEG/FCOPYSIGN (f16) with Expand (PR #106153)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 28 10:59:42 PDT 2024
arsenm wrote:
> * For targets with f16 have a valid i16, the natural way to lower those ops is with a bitcast (unless there are native instructions for that of course). In this case, removing Promote is sound.
The problem isn't that it's overkill, it's that it is *wrong*. You cannot have the canonicalization effects of the fpextend.
> * Concerning the case of an arch with f16 and without i16, we should instead use the smallest fitting integer type rather than promotion.
This is more of a ridiculous DAG design issue; you should be able to create the bitcast and have later legalization steps deal with it. Failing that, you could do a replacement bitcast by doing store to stack and reload
https://github.com/llvm/llvm-project/pull/106153
More information about the llvm-commits
mailing list