[PATCH] D27587: Add "X / 1.0" to SimplifyFDivInst

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 8 12:38:12 PST 2016


spatel added a comment.

I just added a test for this before reading David's comment: https://reviews.llvm.org/rL289098 .

Zia, you can update the CHECK lines there; we shouldn't need a more complicated regression test unless I'm missing something.

I assume it's just oversight that this is missing from InstSimplify. Currently, InstCombine gets it via:
/// CvtFDivConstToReciprocal tries to convert X/C into X*1/C if C not a special
/// FP value and:
///    1) 1/C is exact, or
///    2) reciprocal is allowed.
/// If the conversion was successful, the simplified expression "X * 1/C" is
/// returned; otherwise, NULL is returned.


https://reviews.llvm.org/D27587





More information about the llvm-commits mailing list