[PATCH] D21775: [InstCombine] Simplify and correct folding fcmps with the same children
Tim Shen via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 29 12:57:12 PDT 2016
timshen added inline comments.
================
Comment at: lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:1125-1133
@@ +1124,11 @@
+
+ // Simplify (fcmp cc0 x, y) & (fcmp cc1 x, y).
+ // Suppose the relation between x and y is R, where R is one of
+ // U(1000), L(0100), G(0010) or E(0001), and CC0 and CC1 are the bitmasks for
+ // testing the desired relations.
+ //
+ // Since (R & CC0) and (R & CC1) are either R or 0, we actually have this:
+ // bool(R & CC0) && bool(R & CC1)
+ // = bool((R & CC0) & (R & CC1))
+ // = bool(R & (CC0 & CC1)) <= by re-association, commutation, and idempotency
+ if (Op0LHS == Op1LHS && Op0RHS == Op1RHS)
----------------
spatel wrote:
> This comment and the similar one below didn't make anything clearer to me. I would leave it out, but that's just my suggestion.
The boolean logic deduction is quite different though. :)
I removed the first duplicated paragraph in FoldOrOfFCmps.
http://reviews.llvm.org/D21775
More information about the llvm-commits
mailing list