[llvm-dev] FENV_ACCESS and floating point LibFunc calls

Michael Clark via llvm-dev llvm-dev at lists.llvm.org
Thu May 11 18:53:42 PDT 2017


> On 12 May 2017, at 1:48 PM, Tim Northover <t.p.northover at gmail.com> wrote:
> 
> On 11 May 2017 at 18:30, Michael Clark via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
>> I note that on your bug that you have stated that the branch is faster than
>> the conditional move. Faster code is a side effect of the fix in this
>> particular case.
> 
> On the contrary: the faster code is pretty much the only reason this
> can happen before the rest of the FENV support lands.
> 
> It's been said before, but I'll reiterate: LLVM IR does not model the
> FENV on its instructions. CodeGen and other passes are free to
> de-conditionalize exceptions, remove them, or add spurious ones just
> for the giggles. What LLVM does now is not incorrect.

OK. So we are in fact lucky that the correct case is actually faster, and it’s a bug in the predicate lowering i.e. speculative execution and conditional move being slower than a branch.

I’m curious how the select lowering models the cost, when I figure out where to look in the codebase…

Michael.


More information about the llvm-dev mailing list