[PATCH] D40130: [InstSimplify] fold and/or of fcmp ord/uno when operand is known nnan
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 16 07:46:14 PST 2017
spatel created this revision.
Herald added a subscriber: mcrosier.
The 'ord' and 'uno' predicates have a logic operation for NAN built into their definitions:
FCMP_ORD = 7, ///< 0 1 1 1 True if ordered (no nans)
FCMP_UNO = 8, ///< 1 0 0 0 True if unordered: isnan(X) | isnan(Y)
So we can simplify patterns like this:
(fcmp ord NNAN, X) && (fcmp ord X, Y) --> fcmp ord X, Y
(fcmp uno NNAN, X) || (fcmp uno X, Y) --> fcmp uno X, Y
https://reviews.llvm.org/D40130
Files:
lib/Analysis/InstructionSimplify.cpp
test/Transforms/InstSimplify/logic-of-fcmps.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40130.123179.patch
Type: text/x-patch
Size: 11116 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171116/dae3773e/attachment.bin>
More information about the llvm-commits
mailing list