[AtomicExpand] Use getSigned() for negative value

This commit is contained in:
Nikita Popov
2025-12-09 14:56:02 +01:00
parent 748e7af8dd
commit b0bd8bdbd8

View File

@@ -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");