[PATCH] D50582: ValueTracking: Handle more instructions in isKnownNeverNaN

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 20 05:17:47 PDT 2018


spatel accepted this revision.
spatel added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lib/Analysis/ValueTracking.cpp:2921-2923
   // TODO: Handle instructions and potentially recurse like other 'isKnown'
   // functions. For example, the result of sitofp is never NaN.
 
----------------
arsenm wrote:
> arsenm wrote:
> > spatel wrote:
> > > spatel wrote:
> > > > Remove stale comment.
> > > Comment is still here. Also, we should have tests for sitofp/uitofp.
> > The tests are there for sitofp/uitofp, just apparently somehow the fcmp ord was already optimizing away before
> It looks like foldFCmpIntToFPConst specifically handles the case of these with an fcmp ord
Ah, I see. Sorry, I didn't see the existing tests. We can test this patch more directly and improve efficiency with a small edit in instsimplify, but that can be a follow-up. Please do remove or edit the TODO comment here if there are planned improvements.


https://reviews.llvm.org/D50582





More information about the llvm-commits mailing list