[llvm] 9a6a87d - [AutoUpgrade] Remove unnecessary name check (NFCI)
    Nikita Popov via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Jun 23 05:56:32 PDT 2025
    
    
  
Author: Nikita Popov
Date: 2025-06-23T14:56:24+02:00
New Revision: 9a6a87da6e618d25c23f5f8cf6e4e0f49d4f702c
URL: https://github.com/llvm/llvm-project/commit/9a6a87da6e618d25c23f5f8cf6e4e0f49d4f702c
DIFF: https://github.com/llvm/llvm-project/commit/9a6a87da6e618d25c23f5f8cf6e4e0f49d4f702c.diff
LOG: [AutoUpgrade] Remove unnecessary name check (NFCI)
If only the name is incorrect (due to added overload), but the
signature is correct, we should go through the generic remangling
upgrade.
Added: 
    
Modified: 
    llvm/lib/IR/AutoUpgrade.cpp
Removed: 
    
################################################################################
diff  --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp
index 6e7254ec3e31f..e429e2d65c05f 100644
--- a/llvm/lib/IR/AutoUpgrade.cpp
+++ b/llvm/lib/IR/AutoUpgrade.cpp
@@ -1443,13 +1443,9 @@ static bool upgradeIntrinsicFunction1(Function *F, Function *&NewFn,
     break;
   }
   case 'o':
-    // We only need to change the name to match the mangling including the
-    // address space.
     if (Name.starts_with("objectsize.")) {
       Type *Tys[2] = { F->getReturnType(), F->arg_begin()->getType() };
-      if (F->arg_size() == 2 || F->arg_size() == 3 ||
-          F->getName() !=
-              Intrinsic::getName(Intrinsic::objectsize, Tys, F->getParent())) {
+      if (F->arg_size() == 2 || F->arg_size() == 3) {
         rename(F);
         NewFn = Intrinsic::getOrInsertDeclaration(F->getParent(),
                                                   Intrinsic::objectsize, Tys);
        
    
    
More information about the llvm-commits
mailing list