This is an archive of the discontinued LLVM Phabricator instance.

DAGCombine: Remove redundant NaN checks around ISD::FSQRT
ClosedPublic

Authored by tstellarAMD on Mar 19 2015, 3:07 PM.

Details

Summary

This folds:

(select (setcc x, -0.0, olt), NaN, (fsqrt x)) -> ( fsqrt x)

Diff Detail

Repository
rL LLVM

Event Timeline

tstellarAMD retitled this revision from to DAGCombine: Remove redundant NaN checks around ISD::FSQRT.
tstellarAMD updated this object.
tstellarAMD edited the test plan for this revision. (Show Details)
tstellarAMD added a reviewer: resistor.
tstellarAMD set the repository for this revision to rL LLVM.
tstellarAMD added a subscriber: Unknown Object (MLST).
resistor edited edge metadata.Mar 19 2015, 3:54 PM

LGTM

—Owen

mehdi_amini added inline comments.
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
12444

s/becuase/because

12467

Since fsqrt(NaN) = NaN (I believe), SETULT should be fine as well here right? And SETLT too?

tstellarAMD edited edge metadata.

Here is an updated patch with the typo fix and with an expanded pattern that patches all of the *LT flavors of condition codes. I forgot to mention before that this patch depends on http://reviews.llvm.org/D8469

mehdi_amini accepted this revision.Mar 20 2015, 9:46 AM
mehdi_amini added a reviewer: mehdi_amini.

LGTM.

This revision is now accepted and ready to land.Mar 20 2015, 9:46 AM