[PATCH] D148599: ValueTrackng: Handle sign bit for fptrunc

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 18 04:45:04 PDT 2023


foad added a comment.

>> Is Known.SignBit supposed to be accurate even for Nans? That seems unfortunate, since for a lot of operations you won't be able to propagate it unless you can prove something isn't Nan.
>
> That’s the only reason you need it. Otherwise you can infer from the mask.

Ack. Could do with an explanatory note on the definition of SignBit.

But there's something odd here: the case in which you set SignBit in this patch is exactly the case in which you don't really need to because it //could// be inferred from the mask.

To put it another way, the information provided by SignBit overlaps with the mask, and each could be used to refine the other. Maybe the internal representation of KnownFPClass should be more orthogonal - you could have just a mask, but with separate bits for PosSNan NegSNan PosQNan NegQNan.


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

https://reviews.llvm.org/D148599



More information about the llvm-commits mailing list