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

Han-Kuan Chen via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 21 16:52:18 PDT 2024


================
@@ -14935,7 +15108,7 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E, bool PostponedPHIs) {
       Value *V = Builder.CreateBinOp(
           static_cast<Instruction::BinaryOps>(E->getOpcode()), LHS,
           RHS);
-      propagateIRFlags(V, E->Scalars, VL0, It == MinBWs.end());
+      propagateIRFlags(V, E->Scalars, nullptr, It == MinBWs.end());
----------------
HanKuanChen wrote:

Before the PR, there is no difference between VL0 and nullptr. The opcode must be the same for all VL.
After the PR, VL0 cannot be used because opcode may be different.
I don't know why VL0 is used in the beginning since pass VL0 and nullptr will get the same result for propagateIRFlags.

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


More information about the llvm-commits mailing list