[PATCH] D31182: [InstCombine] fadd double (sitofp x), y check that the promotion is valid

Artur Pilipenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 22 09:10:44 PDT 2017


apilipenko added a comment.

In https://reviews.llvm.org/D31182#706365, @spatel wrote:

> Before getting to any details about the patch, we need to address the question raised in PR27036: why are we doing this transform in InstCombine at all? The assumption is that an integer add is more canonical and/or cheaper than an FP add. Is that universally true?


It's difficult to tell. Even if FP addition is cheaper the second combine also saves us one sitofp conversion. It should be also taken into account.

These combines are buggy and there is a simple fix. Since I don't have a good understanding on the profitability of these combines I decided to go ahead with the fix rather then removing them for example.


https://reviews.llvm.org/D31182





More information about the llvm-commits mailing list