[PATCH] D136757: [SLP] Extend reordering data of tree entry to support PHI nodes

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 31 08:44:02 PDT 2022


ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:3875
+    if (IsIdentityOrder(ResOrder))
+      return None;
+    return ResOrder;
----------------
I think we need to return `{}` here to point that we need to use identity order.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:3826
     return TE.ReorderIndices;
+  if (TE.State == TreeEntry::Vectorize && TE.getOpcode() == Instruction::PHI) {
+    auto PHICompare = [](llvm::Value *V1, llvm::Value *V2) {
----------------
skc7 wrote:
> ABataev wrote:
> > I believe this can be used not only for PHIs, but for other instructions too
> I have seen this issue with only PHIs in my code walkthrough. Haven't come across a case where ordering of other instructions in BB changes resulting shuffle mask. 
Ah, most probably because we consider phi nodes as key nodes, while others are not.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136757/new/

https://reviews.llvm.org/D136757



More information about the llvm-commits mailing list