[PATCH] D44909: [InstCombine] (float)((int) f) --> llvm.trunc (PR36617)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 26 15:05:03 PDT 2018


spatel planned changes to this revision.
spatel added a comment.

In https://reviews.llvm.org/D44909#1048692, @scanon wrote:

> This is the class of optimizations that I would call "formally allowed by the standard, but extremely likely to break things and surprise people." Which isn't to say that we shouldn't do it, just ... be prepared.
>
> More of a concern (to me), this will be a significant perf regression for armv7 and non-SSE4.1 x86, and most other arches with hardware conversion but not `trunc`. We need so means to identify those targets and disable this (the double-conversion dance is frequently used specifically as an optimization to avoid calling `trunc` on such targets).


Ah, I wasn't thinking hard enough about targets/types that don't have direct support. We really don't want to do this in IR then. Let me look at a DAG combine instead.


https://reviews.llvm.org/D44909





More information about the llvm-commits mailing list