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

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 16 07:18:16 PST 2018


lebedev.ri added inline comments.


================
Comment at: include/llvm/IR/PatternMatch.h:230
         }
-        return true;
+        return HasNonUndefElements;
       }
----------------
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})


================
Comment at: test/Transforms/InstSimplify/shr-scalar-vector-consistency.ll:6
+; If m_Zero() is able to match a vector undef, but not a scalar undef,
+; the two cases will simplify differently.
+
----------------
Please precommit the test and rebase.


Repository:
  rL LLVM

https://reviews.llvm.org/D54631





More information about the llvm-commits mailing list