[llvm] e5df048 - [FunctionSpecialization] Use SmallVector::operator== to simplify some code. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 26 09:46:45 PDT 2023


Author: Craig Topper
Date: 2023-07-26T09:46:37-07:00
New Revision: e5df0481f009aa65b3a33d8b023040178692d9bc

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

LOG: [FunctionSpecialization] Use SmallVector::operator== to simplify some code. NFC

Reviewed By: labrinea

Differential Revision: https://reviews.llvm.org/D156260

Added: 
    

Modified: 
    llvm/include/llvm/Transforms/IPO/FunctionSpecialization.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Transforms/IPO/FunctionSpecialization.h b/llvm/include/llvm/Transforms/IPO/FunctionSpecialization.h
index f780385f7f67da..b20212a21b3264 100644
--- a/llvm/include/llvm/Transforms/IPO/FunctionSpecialization.h
+++ b/llvm/include/llvm/Transforms/IPO/FunctionSpecialization.h
@@ -82,12 +82,9 @@ struct SpecSig {
   SmallVector<ArgInfo, 4> Args;
 
   bool operator==(const SpecSig &Other) const {
-    if (Key != Other.Key || Args.size() != Other.Args.size())
+    if (Key != Other.Key)
       return false;
-    for (size_t I = 0; I < Args.size(); ++I)
-      if (Args[I] != Other.Args[I])
-        return false;
-    return true;
+    return Args == Other.Args;
   }
 
   friend hash_code hash_value(const SpecSig &S) {


        


More information about the llvm-commits mailing list