[PATCH] D116952: [ConstantFolding] Respect denormal handling mode attributes when folding instructions

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 30 10:42:07 PDT 2022


efriedma added a comment.

In D116952#3417056 <https://reviews.llvm.org/D116952#3417056>, @dcandler wrote:

> If the instruction lacks a parent function, then the alternative to defaulting to IEEE would be not folding at all. The impact to that could be limited to only instructions to where a denormal is detected in the input/output; if there's no denormal, there's no need for a parent function so folding can proceed.

Maybe... refusing to fold only when we see a denormal might lead to bugs which only show up for specific constants, though.  I think the current approach of just continuing to do IEEE folding is fine as an incremental step.

> Constant expressions won't be currently be affected by this, although potentially they could also follow the principle of only getting folded if denormals are not involved.

My concern with constant expressions here is mostly optimizations turning instructions into constant expressions, e.g. TargetFolder/ConstantFolder.  If frontends create constant expressions, it's less important what happens.


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

https://reviews.llvm.org/D116952



More information about the llvm-commits mailing list