[PATCH] D129743: [GlobalISel] Change widenScalar of G_FCONSTANT to mutate into G_CONSTANT.

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 14 02:26:52 PDT 2022


aemerson added a comment.

In D129743#3651143 <https://reviews.llvm.org/D129743#3651143>, @foad wrote:

> In D129743#3651128 <https://reviews.llvm.org/D129743#3651128>, @aemerson wrote:
>
>> In D129743#3651111 <https://reviews.llvm.org/D129743#3651111>, @foad wrote:
>>
>>>> Widening a G_FCONSTANT by extending and then generating G_FPTRUNC doesn't produce the same result all the time.
>>>
>>> That's only a problem if you care about the bit pattern of NaNs, right? It should be OK for all non-NaN values.
>>
>> Yeah, but it seems better to handle this as a G_CONSTANT rather than have value dependent legalization.
>
> Agreed, I wasn't suggesting to change anything, just trying to understand what the problem was.
>
> I don't really understand why we have G_FCONSTANT in the first place. Also I don't really understand the concept of legalizing a constant.

It probably makes selection easier when importing patterns, so that's something that might cause some issues if we decide to remove it one day.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129743



More information about the llvm-commits mailing list