[PATCH] D89038: [PatternMatch] Add new FP matchers. NFC.

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 16 05:05:08 PDT 2020


foad marked an inline comment as done.
foad added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:5297
   //   X > C1 ? C1 : Max(X, C2) --> Min(C1, Max(X, C2))
   // and return description of the outer Max/Min.
 
----------------
RKSimon wrote:
> Ideally this function needs extending to support non-uniform vectors as well.
Sure, but I'd prefer to do that in a separate patch. Currently it relies on checks like `*FC1 < *FC2` below that won't work for vectors, and I'm not sure how to write that in a vector-friendly way.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:5310
   const APFloat *FC1;
-  if (CmpRHS != TrueVal || !match(CmpRHS, m_APFloat(FC1)) || !FC1->isFinite())
+  if (CmpRHS != TrueVal || !match(CmpRHS, m_Finite(FC1)))
     return {SPF_UNKNOWN, SPNB_NA, false};
----------------
RKSimon wrote:
> m_APFloat didn't match constant vectors containing undefs but m_Finite will? Again, we need test coverage for this.
Since this whole function does support vectors yet, there's NFC here and nothing to test.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89038/new/

https://reviews.llvm.org/D89038



More information about the llvm-commits mailing list