[PATCH] D73978: [WIP][FPEnv] Don't transform FSUB(-0.0,X)->FNEG(X) when flushing denormals

Cameron McInally via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 3 14:39:07 PDT 2020


cameron.mcinally added a comment.

In D73978#1960092 <https://reviews.llvm.org/D73978#1960092>, @arsenm wrote:

> > Should we not expect the explicit FSUB(-0,X) to fold under denormal flushing modes? (Too big a hammer, but correct)
>
> That's what I would expect. Additional context is needed to know the flush will be performed elsewhere
>
> > Or maybe fold the FSUB(-0,X) into the instruction in the backend where possible? (Might cause some slightly wrong answers, unless we're careful)
>
> I don't think we need to fold this in the target, we should be able to fold based on another instruction we know will flush. In the sample you gave there, the f16 operation was promoted to f32 and the conversion should also flush


Good point. I suppose we'd need a switch to check if the user's opcode is a flushing operation.

That's kind of ugly though. Anyone know of a better way to do it?


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

https://reviews.llvm.org/D73978





More information about the llvm-commits mailing list