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

Steve Canon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 26 17:36:57 PDT 2018


scanon added a comment.

In https://reviews.llvm.org/D44909#1048811, @spatel wrote:

> In https://reviews.llvm.org/D44909#1048805, @scanon wrote:
>
> > Two questions, to which I do not know the answer:
> >
> > (a) Are the semantics of ISD::FP_TO_[US]INT for out-of-range values specified anywhere? The do not seem to be, but maybe I'm just missing it.
>
>
> No, I don't see anything either. We just have:
>
>   /// FP_TO_[US]INT - Convert a floating point value to a signed or unsigned
>   /// integer.
>   
>
> I was assuming these nodes follow the same rules as the IR instructions since they are mapped 1-to-1 in SelectionDAGBuilder::visitFPToSI() etc.


I'll buy that. Can you add a note specifying this?

>> (b) Are there test cases that make sure this transform is *not* applied for armv7 and x86 -sse4.1?
> 
> I don't see coverage for armv7, but I may be overlooking it (cc @dmgreen). For x86, I also don't see any test of the roundtrip. I'll add a RUN line to the ftrunc.ll test file.

Great. With those two questions addressed, this LGTM.


https://reviews.llvm.org/D44909





More information about the llvm-commits mailing list