[llvm] [SLP] SLP's copyable elements based upon Main/Alt operations. (PR #124242)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 19 13:57:10 PDT 2025


================
@@ -8412,6 +8708,19 @@ void BoUpSLP::buildTree_rec(ArrayRef<Value *> VL, unsigned Depth,
   };
 
   InstructionsState S = getSameOpcode(VL, *TLI);
+  bool IsAltOpCopy = false;
+  if (!S && VectorizeCopyable) {
+    S = getCopyableOpcode(VL, *TLI);
+    if (S) {
+      if (isCopyableOp(VL, S.getMainOp(), S.getAltOp()) ||
+          canRepresentAsCopyable(S, VL)) {
+        IsAltOpCopy = true;
+      } else {
+        S = InstructionsState::invalid();
+      }
+    }
+  } else if (VectorizeCopyable && canRepresentAsCopyable(S, VL))
+    IsAltOpCopy = true;
----------------
alexey-bataev wrote:

Should be in braces

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


More information about the llvm-commits mailing list