[PATCH] D48085: [DAGCombiner] restrict (float)((int) f) --> ftrunc with no-signed-zeros

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 19 14:51:11 PDT 2018


spatel added a comment.

In https://reviews.llvm.org/D48085#1136910, @lebedev.ri wrote:

> In https://reviews.llvm.org/D48085#1136900, @spatel wrote:
>
> > In https://reviews.llvm.org/D48085#1136860, @lebedev.ri wrote:
> >
> > > Should this adjust the ReleaseNotes?
> >
> >
> > The docs provide extra warning/workaround, and this change doesn't affect that language IMO (there's less chance we're going to break code, but we don't have to disclose that).
> >
> > For reference, here are links to the docs that we added with the previous patches (last updated with https://reviews.llvm.org/D46236 I think):
> >  https://clang.llvm.org/docs/ReleaseNotes.html#new-compiler-flags
> >  https://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
> >  http://llvm.org/docs/ReleaseNotes.html#non-comprehensive-list-of-changes-in-this-release
> >
> > Let me know if you see anything that can be improved.
>
>
> The text in first and last links suggests that such an optimization is always being done.


One more point here: if it sounds like it's always done, then that's already wrong.

We only do the transformation when the target has a legal FTRUNC op, so some fraction of targets are never affected by this transform regardless of fast-math. Eg, x86 doesn't have roundXX before SSE4.1.


https://reviews.llvm.org/D48085





More information about the llvm-commits mailing list