[PATCH] D61675: [WIP] Update IRBuilder::CreateFNeg(...) to return a UnaryOperator

Cameron McInally via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 16 13:10:52 PDT 2019


cameron.mcinally added a comment.

In D61675#1671602 <https://reviews.llvm.org/D61675#1671602>, @spatel wrote:

> And I think the case where a user changes MXCSR bits is UB for C/C++ ( https://bugs.llvm.org/show_bug.cgi?id=8100#c15 ). So x86 never has a problem in theory, but it might in practice because users believe that twiddling MXCSR bits is allowed?


We will eventually have to support `#pragma STDC FENV_ACCESS`, so Richard's reasoning won't hold forever.

Someone could argue, though, to just use a constrained strict FSub if you care about DAZ/FTZ. That seems like a valid solution. But, that is really treating DAZ/FTZ like a rounding-mode, not underflow. It would be a heavy hammer to enforce all the side-effect concerns when the user really only cares about DAZ/FTZ. In other words, we'll be losing significant performance in an attempt to gain significant performance.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61675/new/

https://reviews.llvm.org/D61675





More information about the llvm-commits mailing list