[llvm] [SLP]Initial compatibility support for shl v, 1 and add v, v (PR #181168)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 8 03:34:26 PDT 2026


================
@@ -1403,6 +1413,49 @@ class InstructionsState {
            Converter.hasAltOp() || !Converter.hasCandidateOpcode(getOpcode());
   }
 
+  /// Checks if the value \p V is a transformed instruction, compatible either
+  /// with main or alternate ops.
+  bool isExpandedBinOp(Value *V) const {
+    assert(valid() && "InstructionsState is invalid.");
+    if (isCopyableElement(V))
+      return false;
+    auto *I = dyn_cast<Instruction>(V);
+    if (!I)
+      return false;
+    auto CheckForTransformedOpcode = [](const Instruction *Op, Instruction *I) {
----------------
RKSimon wrote:

Can you use better names than Op and I? Also, why is one const and the other not?

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


More information about the llvm-commits mailing list