[PATCH] D54631: Handle undef vectors consistently in pattern matching

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 16 09:57:46 PST 2018


nikic added inline comments.


================
Comment at: include/llvm/IR/PatternMatch.h:230
         }
-        return true;
+        return HasNonUndefElements;
       }
----------------
lebedev.ri wrote:
> So now instead of checking that any (zero or more) non-undef elements match,
> we check that  all (one or more) non-undef elements match?
> 
> In other words, if we had a vector of `undef`s, we used to accept it, and will no longer?
> I think this needs unit tests. ({int, fp} x {scalar, vector})
Yes, your understanding is exactly right. Previously all cst_pred_ty/cstfp_pred_ty matchers returned true for a vector of undefs, now they will return false.

I've now added some unit tests for behavior of m_Undef and m_Zero/m_AnyZeroFP applied to scalars and vectors of undef, zero and mixed zero/undef.


https://reviews.llvm.org/D54631





More information about the llvm-commits mailing list