[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:59:23 PDT 2020


foad added inline comments.


================
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:
> foad wrote:
> > 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.
> OK - in which case a TODO comment plus an assert that !getType->isVectorTy() at the top of the function would be fine.
I was mistaken. This function did already handle splat vectors with no undefs, because of the use of m_APFloat matchers. I've added an explicit test case for this. My patch does not change this behaviour.


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