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

David Candler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 28 08:52:04 PDT 2022


dcandler updated this revision to Diff 418604.
dcandler retitled this revision from "[ConstantFolding] Flush folded denormals to zero when using fastmath" to "[ConstantFolding] Respect denormal handling mode attributes when folding instructions".
dcandler edited the summary of this revision.
dcandler added a comment.
Herald added a subscriber: StephenFan.
Herald added a project: All.

I've updated the patch with a new version which now takes the denormal handling mode from the function attribute, and adjusted the title/summary to reflect this. This supports both different settings for inputs and outputs to the instruction, as well as whether values get flushed positive zero or the sign is preserved.

While testing I found the denormal-fp-math-f32 attribute was being set unexpectedly, but I've created a separate patch to deal with that: https://reviews.llvm.org/D122589. It should not be an issue for this patch however, since it simply uses the attributes as given.


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

https://reviews.llvm.org/D116952

Files:
  llvm/lib/Analysis/ConstantFolding.cpp
  llvm/test/Transforms/InstCombine/AArch64/constant-fold-fp-denormal.ll
  llvm/test/Transforms/InstCombine/ARM/constant-fold-fp-denormal.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116952.418604.patch
Type: text/x-patch
Size: 8578 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220328/07db3f69/attachment.bin>


More information about the llvm-commits mailing list