[llvm] 87b491a - [NFC] [MTE] get rid of unnecessary cast (#110336)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 8 15:51:30 PDT 2024


Author: Florian Mayer
Date: 2024-10-08T15:51:27-07:00
New Revision: 87b491a95c3a8f17bd5c6e578104289954c16456

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

LOG: [NFC] [MTE] get rid of unnecessary cast (#110336)

Added: 
    

Modified: 
    llvm/lib/Target/AArch64/AArch64StackTagging.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp
index 1d2b2573778283..7652758284f4b0 100644
--- a/llvm/lib/Target/AArch64/AArch64StackTagging.cpp
+++ b/llvm/lib/Target/AArch64/AArch64StackTagging.cpp
@@ -580,14 +580,14 @@ bool AArch64StackTagging::runOnFunction(Function &Fn) {
   Instruction *Base =
       insertBaseTaggedPointer(*Fn.getParent(), SInfo.AllocasToInstrument, DT);
 
-  int NextTag = 0;
+  unsigned int NextTag = 0;
   for (auto &I : SInfo.AllocasToInstrument) {
     memtag::AllocaInfo &Info = I.second;
     assert(Info.AI && SIB.getAllocaInterestingness(*Info.AI) ==
                           llvm::memtag::AllocaInterestingness::kInteresting);
     memtag::alignAndPadAlloca(Info, kTagGranuleSize);
     AllocaInst *AI = Info.AI;
-    int Tag = NextTag;
+    unsigned int Tag = NextTag;
     NextTag = (NextTag + 1) % 16;
     // Replace alloca with tagp(alloca).
     IRBuilder<> IRB(Info.AI->getNextNode());
@@ -642,7 +642,7 @@ bool AArch64StackTagging::runOnFunction(Function &Fn) {
         II->eraseFromParent();
     }
 
-    memtag::annotateDebugRecords(Info, static_cast<unsigned long>(Tag));
+    memtag::annotateDebugRecords(Info, Tag);
   }
 
   // If we have instrumented at least one alloca, all unrecognized lifetime


        


More information about the llvm-commits mailing list