[llvm] [SLP][NFC] Refactor duplicate code into `getVectorizedValue` (PR #156277)

Piotr Fusik via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 1 01:02:24 PDT 2025


================
@@ -17848,6 +17848,18 @@ class BoUpSLP::ShuffleInstructionBuilder final : public BaseShuffleAnalysis {
         IsSigned.value_or(!isKnownNonNegative(V, SimplifyQuery(*R.DL))));
   }
 
+  Value *getVectorizedValue(const TreeEntry &E1) {
+    Value *V1 = E1.VectorizedValue;
+    if (!V1->getType()->isIntOrIntVectorTy())
+      return V1;
+    return castToScalarTyElem(V1, any_of(E1.Scalars, [&](Value *V) {
+                                if (isa<PoisonValue>(V))
+                                  return false;
+                                return !isKnownNonNegative(
+                                    V, SimplifyQuery(*R.DL));
----------------
pfusik wrote:

Do you mean with `&&` ?

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


More information about the llvm-commits mailing list