[PATCH] D100122: Update m_Undef to match vectors/aggrs with undefs and poisons mixed

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 17 00:39:53 PDT 2021


lebedev.ri added inline comments.


================
Comment at: llvm/include/llvm/IR/PatternMatch.h:92-100
+  static bool check(const Value *V) {
+    if (isa<UndefValue>(V))
+      return true;
+
+    if (auto *CA = dyn_cast<ConstantAggregate>(V))
+      return all_of(CA->operand_values(), check);
+
----------------
I'm not sure i like recursion here.
How about a worklist algorithm?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100122



More information about the llvm-commits mailing list