This is an archive of the discontinued LLVM Phabricator instance.

ConstantFolding: Constant fold denormal inputs to canonicalize for IEEE
ClosedPublic

Authored by arsenm on Jul 24 2023, 5:05 AM.

Details

Summary

This makes it possible to use canonicalize to perform a dynamic check
for whether denormal flushing is enabled, which will fold out when the
denormal mode is known. Previously it would only fold if denormal
flushing were known enabled.

Not sure if this needs to filter the misbehaved types

Diff Detail

Event Timeline

arsenm created this revision.Jul 24 2023, 5:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2023, 5:05 AM
arsenm requested review of this revision.Jul 24 2023, 5:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2023, 5:05 AM
Herald added a subscriber: wdng. · View Herald Transcript
foad accepted this revision.Jul 24 2023, 7:40 AM
foad added inline comments.
llvm/lib/Analysis/ConstantFolding.cpp
1979

You could still fold this case if Src is positive and output mode is PreserveSign or PositiveZero.

1982

DenormMode.Input == DenormalMode::Dynamic is false here.

This revision is now accepted and ready to land.Jul 24 2023, 7:40 AM