[PATCH] D44909: [DAGCombine] (float)((int) f) --> ftrunc (PR36617)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 12 08:36:56 PDT 2018


spatel added a comment.

In https://reviews.llvm.org/D44909#1065673, @thakis wrote:

> We think there's an UB check for this already, but v8 isn't UB clean.
>
> The fast way to do the "is this double an int" check on an assembly level is to convert to int and back and then compare if the roundtripped value is equal. After this change, is there some way to express this approach in C?


Still trying to digest this:
https://wiki.sei.cmu.edu/confluence/display/c/FLP34-C.+Ensure+that+floating-point+conversions+are+within+range+of+the+new+type


Repository:
  rL LLVM

https://reviews.llvm.org/D44909





More information about the llvm-commits mailing list