[PATCH] D64700: [SLPVectorizer] [NFC] Avoid repetitive calls to getSameOpcode().

Vasileios Porpodas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 4 13:07:47 PDT 2019


vporpo added a comment.

Just a couple more comments.



================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:2790
     }
     if (getSameOpcode(VL).getOpcode() == Instruction::ExtractElement &&
         allSameType(VL) && allSameBlock(VL)) {
----------------
How about this `getSameOpcode()`  ? Can't we replace this too?


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:3833
+        E->setOperations(&S);
+        VL0 = E->getMainOp();
       }
----------------
Hmm, this block starting at line 3828 looks a bit redundant now. Shouldn't this state update be done internally within TreeEntry? How about using something like E->updateStateIfReorder() ?


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

https://reviews.llvm.org/D64700





More information about the llvm-commits mailing list