This is an archive of the discontinued LLVM Phabricator instance.

DAG Combiner: Fold SelectCC When Cond is UNDEF
ClosedPublic

Authored by mehdi_amini on Jan 8 2015, 6:20 PM.

Details

Summary

In case folding a node end up with a NaN as operand for the select, the folding here fails because the comparison is "UNDEF". This patch handles the UNDEF accordingly.

There is no test case because I can find a situation in an open source backend where we would generate a NaN in DAGCombine (the folding is performed earlier during DAG creation usually). Yet it seems that generating a NaN is not invalid by itself.

Diff Detail

Repository
rL LLVM

Event Timeline

mehdi_amini updated this revision to Diff 17920.Jan 8 2015, 6:20 PM
mehdi_amini retitled this revision from to DAG Combiner: Fold SelectCC When Cond is UNDEF.
mehdi_amini updated this object.
mehdi_amini edited the test plan for this revision. (Show Details)
mehdi_amini added a reviewer: resistor.
mehdi_amini added a subscriber: Unknown Object (MLST).Jan 13 2015, 2:18 AM

+llvm-commit

resistor accepted this revision.Jan 13 2015, 9:10 PM
resistor edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Jan 13 2015, 9:10 PM
This revision was automatically updated to reflect the committed changes.