[PATCH] D155874: [llvm] Exit early if inputs to comparator are equal

David Berard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 15:42:01 PDT 2023


davidberard98 updated this revision to Diff 542708.
davidberard98 added a comment.

update using arcanist


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155874

Files:
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp


Index: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
===================================================================
--- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -4136,6 +4136,8 @@
     return TE.ReorderIndices;
   if (TE.State == TreeEntry::Vectorize && TE.getOpcode() == Instruction::PHI) {
     auto PHICompare = [](llvm::Value *V1, llvm::Value *V2) {
+      if (V1 == V2)
+        return false;
       if (!V1->hasOneUse() || !V2->hasOneUse())
         return false;
       auto *FirstUserOfPhi1 = cast<Instruction>(*V1->user_begin());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155874.542708.patch
Type: text/x-patch
Size: 608 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230720/1cf9ada7/attachment.bin>


More information about the llvm-commits mailing list