[llvm] [SLP] Make getSameOpcode support different instructions if they have same semantics. (PR #112181)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 22 04:33:35 PDT 2024


================
@@ -2335,24 +2479,41 @@ class BoUpSLP {
                                  : cast<Instruction>(VL[0])->getNumOperands();
       OpsVec.resize(NumOperands);
       unsigned NumLanes = VL.size();
-      for (unsigned OpIdx = 0; OpIdx != NumOperands; ++OpIdx) {
+      InstructionsState S = getSameOpcode(VL, TLI);
----------------
alexey-bataev wrote:

You can try. But keep in mind, these elements should not be reordered at all. Otherwise, it may affect compile time.

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


More information about the llvm-commits mailing list