[PATCH] D41381: [InstCombine] Missed optimization in math expression: squashing exp(log), log(exp)

Dmitry Venikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 20 23:10:43 PST 2017

Quolyk added a comment.

In https://reviews.llvm.org/D41381#960534, @davide wrote:

> I don't have access to my checkout here, but I'm fairly sure we do something similar in SimplifyLibCalls.
>  I understand many of the pattern proposed will be duplicated, which is, not ideal.
>  Also, I'm pretty sure @scanon once taught me (when I implemented a similar transformation in simplifylibcalls) that these can underflow/overflow pretty dramatically, so, shouldn't these only be enabled under `-ffast-math` ?

These transforms are only enabled under -ffast-math,  `II->isFast()` checks here for it. Tests explicitly show correctness.


More information about the llvm-commits mailing list