HomePhabricator

[ValueTracking, InstCombine] canonicalize fcmp ord/uno with non-NAN ops to null…

Authored by spatel on Sep 5 2017, 4:13 PM.

Description

[ValueTracking, InstCombine] canonicalize fcmp ord/uno with non-NAN ops to null constants

This is a preliminary step towards solving the remaining part of PR27145 - IR for isfinite():
https://bugs.llvm.org/show_bug.cgi?id=27145

In order to solve that one more generally, we need to add matching for and/or of fcmp ord/uno
with a constant operand.

But while looking at those patterns, I realized we were missing a canonicalization for nonzero
constants. Rather than limiting to just folds for constants, we're adding a general value
tracking method for this based on an existing DAG helper.

By transforming everything to 0.0, we can simplify the existing code in foldLogicOfFCmps()
and pick up missing vector folds.

Differential Revision: https://reviews.llvm.org/D37427

llvm-svn: 312591

Details

Committed
spatelSep 5 2017, 4:13 PM
Differential Revision
D37427: [InstCombine] canonicalize fcmp ord/uno with constants to null constant
Parents
rG8db11a4f1cef: Fix a use after free.
Branches
Unknown
Tags
Unknown