[llvm] b0bd8bd - [AtomicExpand] Use getSigned() for negative value

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 9 07:14:09 PST 2025


Author: Nikita Popov
Date: 2025-12-09T16:13:59+01:00
New Revision: b0bd8bdbd89701173db0d446757aad1ad166f08d

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

LOG: [AtomicExpand] Use getSigned() for negative value

Added: 
    

Modified: 
    llvm/lib/CodeGen/AtomicExpandPass.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/AtomicExpandPass.cpp b/llvm/lib/CodeGen/AtomicExpandPass.cpp
index d9bc042d6807e..d19862ad7c188 100644
--- a/llvm/lib/CodeGen/AtomicExpandPass.cpp
+++ b/llvm/lib/CodeGen/AtomicExpandPass.cpp
@@ -853,8 +853,8 @@ static PartwordMaskValues createMaskInstrs(IRBuilderBase &Builder,
   if (AddrAlign < MinWordSize) {
     PMV.AlignedAddr = Builder.CreateIntrinsic(
         Intrinsic::ptrmask, {PtrTy, IntTy},
-        {Addr, ConstantInt::get(IntTy, ~(uint64_t)(MinWordSize - 1))}, nullptr,
-        "AlignedAddr");
+        {Addr, ConstantInt::getSigned(IntTy, ~(uint64_t)(MinWordSize - 1))},
+        nullptr, "AlignedAddr");
 
     Value *AddrInt = Builder.CreatePtrToInt(Addr, IntTy);
     PtrLSB = Builder.CreateAnd(AddrInt, MinWordSize - 1, "PtrLSB");


        


More information about the llvm-commits mailing list