[llvm] adc6b43 - [llvm][NFC] Autoupdater AMD intrinsic detection (#73331)

via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 11:50:46 PST 2023


Author: Nathan Sidwell
Date: 2023-12-01T14:50:39-05:00
New Revision: adc6b43ee1c4672b8aa1a0763111c1ade9e7e2bb

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

LOG: [llvm][NFC] Autoupdater AMD intrinsic detection (#73331)

Check atomic prefix before looking for atomic instructions

Added: 
    

Modified: 
    llvm/lib/IR/AutoUpgrade.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp
index 1699fb962201181..b494a76767dcc9c 100644
--- a/llvm/lib/IR/AutoUpgrade.cpp
+++ b/llvm/lib/IR/AutoUpgrade.cpp
@@ -949,11 +949,14 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
         return true;
       }
 
-      if (Name.starts_with("atomic.inc") || Name.starts_with("atomic.dec")) {
-        // This was replaced with atomicrmw uinc_wrap and udec_wrap, so there's no
-        // new declaration.
-        NewFn = nullptr;
-        return true;
+      if (Name.consume_front("atomic.")) {
+        if (Name.starts_with("inc") || Name.starts_with("dec")) {
+          // These were replaced with atomicrmw uinc_wrap and udec_wrap, so
+          // there's no new declaration.
+          NewFn = nullptr;
+          return true;
+        }
+        break; // No other 'amdgcn.atomic.*'
       }
 
       if (Name.starts_with("ldexp.")) {
@@ -963,6 +966,7 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
           {F->getReturnType(), F->getArg(1)->getType()});
         return true;
       }
+      break; // No other 'amdgcn.*'
     }
 
     break;


        


More information about the llvm-commits mailing list