[PATCH] D139311: InstCombine: Match pattern that appears in clang's __builtin_isnormal
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 14 07:05:17 PST 2022
arsenm added inline comments.
================
Comment at: llvm/include/llvm/IR/InstrTypes.h:839
+ /// For example, UEQ -> OEQ, ULT -> OLT, OEQ -> OEQ
+ static Predicate getOrderedPredicate(Predicate pred) {
+ return static_cast<Predicate>(pred & FCMP_ORD);
----------------
foad wrote:
> Argument name should be capitalized (though the existing functions are inconsistent on this).
Right this was just copy paste from the others
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:1229
+/// and (fcmp ord x, 0), (fcmp u* x, inf) -> fcmp o* x, y
+/// and (fcmp ord x, 0), (fcmp u* fabs(x), inf) -> fcmp o* x, y
+///
----------------
foad wrote:
> Comment seems wrong - this function doesn't do anything with fabs.
It's not wrong, it's just the fabs stripping is applied in the predicate where it's called
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:1309
+ if (IsAnd && stripSignOnlyFPOps(LHS0) == stripSignOnlyFPOps(RHS0)) {
+ if (Value *Left = matchOrdAndUnorderedCmpInf(Builder, LHS, RHS))
----------------
foad wrote:
> Do you need to worry about IsLogicalSelect here?
I don't really know what IsLogicalSelect means
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139311/new/
https://reviews.llvm.org/D139311
More information about the llvm-commits
mailing list