[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

Alex MacLean via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 6 09:09:48 PDT 2024


AlexMaclean wrote:

> Can you add some tests to demonstrate that this patch will enable more optimizations in some real-world applications?

I can extend the existing test cases to make them more elaborate/real-looking, but I'm guessing that would not qualify as "real-world". This patch is motivated by an internal benchmark where there were some cases where this helped, though even that case is in some sense artificial. Is this a necessary criteria for landing this change? I believe we already handle float to int in KnownBits and adding the inverse in KnownFPClass seems like a correct and reasonable extension of the logic, even if there are not many cases where it is used.

https://github.com/llvm/llvm-project/pull/97762


More information about the cfe-commits mailing list