[PATCH] D44424: [InstCombine] peek through unsigned FP casts for zero-equality compares (PR36682)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 18 11:40:20 PDT 2018


lebedev.ri added a comment.

In https://reviews.llvm.org/D44424#1038655, @lebedev.ri wrote:

> I'm looking at this more, and i expect that `sitofp/uitofp + bitcast + icmp eq/ne` -> `icmp eq/ne` combine is valid/can be generalized for more constants.
>  At the very least for all power-of-two constants.
>  F5895084: fp-constants.txt <https://reviews.llvm.org/F5895084>
>  This is currently not done, at least not fully, https://godbolt.org/g/QANEnM
>
> But that is for later.


@spatel 
Hmm, and it seems that as per alive-nj, this will work for **any** constant, not just power-of-two.
The only concern is the bitwidth of the const. (well, and the sign bit). I suppose it makes sense.
As soon as you post your `icmp eq/ne` part of https://reviews.llvm.org/D44390, i'll follow-up with a generalization.


Repository:
  rL LLVM

https://reviews.llvm.org/D44424





More information about the llvm-commits mailing list