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

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


scanon added a comment.

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).


https://reviews.llvm.org/D44909





More information about the llvm-commits mailing list