[llvm] [IR][PatternMatch] Only accept poison in getSplatValue() (PR #89159)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 18 00:14:53 PDT 2024


================
@@ -433,7 +433,7 @@ template <typename Predicate> struct apf_pred_ty : public Predicate {
     if (V->getType()->isVectorTy())
       if (const auto *C = dyn_cast<Constant>(V))
         if (auto *CI = dyn_cast_or_null<ConstantFP>(
-                C->getSplatValue(/* AllowUndef */ true)))
+                C->getSplatValue(/* AllowPoison */ true)))
----------------
nikic wrote:

I've been looking into this. From a very quick inspection of all relevant matchers, I think only the usage in foldSelectICmpAndBinOp is problematic if poison is allowed.

However, our test coverage seems to be pretty bad -- allowing poison in api_pred_ty only results in test changes for a single transform :( At the same time, I don't really want to spend time adding poison vector tests for dozens of affected transforms...

https://github.com/llvm/llvm-project/pull/89159


More information about the llvm-commits mailing list