[llvm] [SLP] SLP's copyable elements based upon Main/Alt operations. (PR #124242)
    Alexey Bataev via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Mar 13 04:06:42 PDT 2025
    
    
  
================
@@ -1125,6 +1244,25 @@ static bool doesInTreeUserNeedToExtract(Value *Scalar, Instruction *UserInst,
   }
 }
 
+// Determine that the vector could be vectorized with copyable elements.
+static bool isCopyableOp(ArrayRef<Value *> VL, Value *Main, Value *Alt) {
+  if (any_of(VL, IsaPred<PoisonValue>) || Main == Alt ||
+      !isa<BinaryOperator>(Main) || !isa<Instruction>(Alt) ||
----------------
alexey-bataev wrote:
Also, why `Alt` should be an instruction? I thought we should support non-instructions here too.
https://github.com/llvm/llvm-project/pull/124242
    
    
More information about the llvm-commits
mailing list