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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 16 13:35:30 PDT 2022


spatel accepted this revision.
spatel added a comment.

LGTM - thanks for the thorough tests!
See inline for some minor cleanups.



================
Comment at: llvm/lib/Analysis/ConstantFolding.cpp:1011
+    case Instruction::FRem:
+      // Handle floating point instructions seperately to account for denormals
+      // TODO: If an constant expression is being folded rather than an
----------------
typo: separately

Hopefully, we'll get rid of FP constant expressions, so there won't be a discrepancy in the future.


================
Comment at: llvm/lib/Analysis/ConstantFolding.cpp:1012
+      // Handle floating point instructions seperately to account for denormals
+      // TODO: If an constant expression is being folded rather than an
+      // instruction, denormals will not be flushed/treated as zero
----------------
"if a constant"


================
Comment at: llvm/lib/Analysis/ConstantFolding.cpp:1318
+// original constant. Inputs and outputs to floating point instructions can have
+// their mode set seperately, so the direction is also needed.
+Constant *FlushFPConstant(Constant *Operand, const llvm::Function *F,
----------------
typo: separately


================
Comment at: llvm/lib/Analysis/ConstantFolding.cpp:1366
+  }
+  // If instuction lacks a parent/function and the denormal mode cannot be
+  // determined, use the default (IEEE).
----------------
typo: instruction


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

https://reviews.llvm.org/D116952



More information about the llvm-commits mailing list