diff --git a/llvm/lib/CodeGen/AtomicExpandPass.cpp b/llvm/lib/CodeGen/AtomicExpandPass.cpp --- a/llvm/lib/CodeGen/AtomicExpandPass.cpp +++ b/llvm/lib/CodeGen/AtomicExpandPass.cpp @@ -704,7 +704,7 @@ PMV.AlignedAddr = Addr; PMV.AlignedAddrAlignment = AddrAlign; PMV.ShiftAmt = ConstantInt::get(PMV.ValueType, 0); - PMV.Mask = ConstantInt::get(PMV.ValueType, ~0); + PMV.Mask = ConstantInt::get(PMV.ValueType, ~0, /*isSigned*/ true); return PMV; } diff --git a/llvm/test/CodeGen/PowerPC/atomics-i128.ll b/llvm/test/CodeGen/PowerPC/atomics-i128.ll --- a/llvm/test/CodeGen/PowerPC/atomics-i128.ll +++ b/llvm/test/CodeGen/PowerPC/atomics-i128.ll @@ -473,8 +473,9 @@ ; CHECK-NEXT: stqcx. r8, 0, r3 ; CHECK-NEXT: .LBB11_4: # %entry ; CHECK-NEXT: lwsync -; CHECK-NEXT: xor r3, r5, r9 -; CHECK-NEXT: or r3, r3, r4 +; CHECK-NEXT: xor r3, r4, r8 +; CHECK-NEXT: xor r4, r5, r9 +; CHECK-NEXT: or r3, r4, r3 ; CHECK-NEXT: cntlzd r3, r3 ; CHECK-NEXT: rldicl r3, r3, 58, 63 ; CHECK-NEXT: blr diff --git a/llvm/test/Transforms/AtomicExpand/PowerPC/cmpxchg.ll b/llvm/test/Transforms/AtomicExpand/PowerPC/cmpxchg.ll --- a/llvm/test/Transforms/AtomicExpand/PowerPC/cmpxchg.ll +++ b/llvm/test/Transforms/AtomicExpand/PowerPC/cmpxchg.ll @@ -24,7 +24,7 @@ ; CHECK-NEXT: [[TMP4:%.*]] = shl i128 [[HI64]], 64 ; CHECK-NEXT: [[VAL64:%.*]] = or i128 [[LO64]], [[TMP4]] ; CHECK-NEXT: [[TMP5:%.*]] = insertvalue { i128, i1 } undef, i128 [[VAL64]], 0 -; CHECK-NEXT: [[TMP6:%.*]] = and i128 [[VAL64]], 18446744073709551615 +; CHECK-NEXT: [[TMP6:%.*]] = and i128 [[VAL64]], -1 ; CHECK-NEXT: [[SUCCESS:%.*]] = icmp eq i128 [[CMPVAL_SHIFTED]], [[TMP6]] ; CHECK-NEXT: [[TMP7:%.*]] = insertvalue { i128, i1 } [[TMP5]], i1 [[SUCCESS]], 1 ; CHECK-NEXT: [[SUCC:%.*]] = extractvalue { i128, i1 } [[TMP7]], 1