[PATCH] D37427: [InstCombine] canonicalize fcmp ord/uno with constants to null constant

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 3 09:52:26 PDT 2017


spatel created this revision.
Herald added a subscriber: mcrosier.

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. By transforming everything to 0.0, we can simplify the existing code in foldLogicOfFCmps() and pick up missing vector folds.


https://reviews.llvm.org/D37427

Files:
  include/llvm/IR/Constant.h
  lib/IR/Constants.cpp
  lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
  lib/Transforms/InstCombine/InstCombineCompares.cpp
  test/Transforms/InstCombine/and-fcmp.ll
  test/Transforms/InstCombine/fcmp-special.ll
  test/Transforms/InstCombine/or-fcmp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37427.113706.patch
Type: text/x-patch
Size: 7701 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170903/a3bca9a9/attachment.bin>


More information about the llvm-commits mailing list