[llvm] 4ac42af - [InstCombine] Use llvm::set_is_subset (NFC) (#102778)

via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 10 22:46:06 PDT 2024


Author: Kazu Hirata
Date: 2024-08-10T22:46:03-07:00
New Revision: 4ac42afbccf616a3644e19f2945ccd9ad1b66ccf

URL: https://github.com/llvm/llvm-project/commit/4ac42afbccf616a3644e19f2945ccd9ad1b66ccf
DIFF: https://github.com/llvm/llvm-project/commit/4ac42afbccf616a3644e19f2945ccd9ad1b66ccf.diff

LOG: [InstCombine] Use llvm::set_is_subset (NFC) (#102778)

Added: 
    

Modified: 
    llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
index 1661fa564c65c7..0b51845ab5e257 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
@@ -12,6 +12,7 @@
 
 #include "InstCombineInternal.h"
 #include "llvm/ADT/MapVector.h"
+#include "llvm/ADT/SetOperations.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/Analysis/AliasAnalysis.h"
@@ -287,10 +288,7 @@ bool PointerReplacer::collectUsers() {
   // Ensure that all outstanding (indirect) users of I
   // are inserted into the Worklist. Return false
   // otherwise.
-  for (auto *Inst : ValuesToRevisit)
-    if (!Worklist.contains(Inst))
-      return false;
-  return true;
+  return llvm::set_is_subset(ValuesToRevisit, Worklist);
 }
 
 bool PointerReplacer::collectUsersRecursive(Instruction &I) {


        


More information about the llvm-commits mailing list