[InstCombine] fold fcmp with lossy casted constant
authorSanjay Patel <spatel@rotateright.com>
Tue, 8 Mar 2022 15:17:50 +0000 (10:17 -0500)
committerSanjay Patel <spatel@rotateright.com>
Tue, 8 Mar 2022 17:41:12 +0000 (12:41 -0500)
commit9397bdc67eb2b9eedc247a89bef01c2484b48b89
tree791e6030a7e979ff76a6d59564fc9a00c02c3de6
parentf345f7e30bd3a8e15052f5669c1977aa088e468f
[InstCombine] fold fcmp with lossy casted constant

This is noted as a missing clang warning in #54222
(and we should still make that enhancement).

Alive2 proofs:
https://alive2.llvm.org/ce/z/Q8drDq
https://alive2.llvm.org/ce/z/pE6LRt

I don't see a single conversion for all predicates
using "getFCmpCode" logic, so other predicates are
left as a TODO item.
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/fcmp.ll