[PATCH] D12882: [SimplifyCFG] do not speculate fdiv by default; it's expensive (PR24818)

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 15:49:44 PDT 2015


spatel added a comment.

In http://reviews.llvm.org/D12882#247388, @joker.eph wrote:

> Is it only an "optimization fix"? The "correctness" fix for PR24343 seems to requires that an fdiv can't be speculated with FPE enabled and if the denominator is not zero, right?
>  It seems that LLVM Optimizations are still not very friendly with respect to that, there were some patches at some point last year but it seems they have not been integrated: http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20141110/243778.html


Hi Mehdi -

Yes, my patch is only intended to solve the perf problem (PR24818)...and raise the question about the existing sqrt hoisting test in test/Transforms/SimplifyCFG/speculate-math.ll.

This patch just happens to prevent the FPE in the case of PR24343, but that's a happy accident. Clang/LLVM still need major work to support FPE, and that's tracked (and unsolved for years) by PR8100 and related bugs.


http://reviews.llvm.org/D12882





More information about the llvm-commits mailing list