This is an archive of the discontinued LLVM Phabricator instance.

ValueTracking: Handle minimum/maximum in computeKnownFPClass
ClosedPublic

Authored by arsenm on Apr 10 2023, 6:27 AM.

Diff Detail

Event Timeline

arsenm created this revision.Apr 10 2023, 6:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 10 2023, 6:27 AM
arsenm requested review of this revision.Apr 10 2023, 6:27 AM
Herald added a reviewer: sstefan1. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: wdng. · View Herald Transcript
kpn added inline comments.Apr 13 2023, 7:23 AM
llvm/lib/Analysis/ValueTracking.cpp
4571

Is this correct? If we know that one operand cannot be NaN, but we don't know that about the other operand, then we can't know if the result of the operation is NaN or not. This is llvm.minimum/llvm.maximum, correct? Those are documented as propagating NaN,

arsenm added inline comments.Apr 13 2023, 4:05 PM
llvm/lib/Analysis/ValueTracking.cpp
4571

Right, so both operands need to be nnan which is what this accomplishes. The mask is the values it can be, not that it cannot be.

jcranmer-intel accepted this revision.Apr 14 2023, 1:05 PM

Assuming FTZ/DAZ shenanigans are handled in a later patch, this LGTM.

This revision is now accepted and ready to land.Apr 14 2023, 1:05 PM
arsenm updated this revision to Diff 514027.Apr 16 2023, 9:00 AM

Fix DAZ handling