================
@@ -2060,9 +2060,28 @@ bool AtomicExpandImpl::expandAtomicOpToLibcall(
I->replaceAllUsesWith(V);
} else if (HasResult) {
Value *V;
- if (UseSizedLibcall)
- V = Builder.CreateBitOrPointerCast(Result, I->getType());
- else {
+ if (UseSizedLibcall) {
+ // Add bitcasts from Result's T scalar type to I's <2 x T/2> vector type
+ if (I->getType()->getScalarType()->isIntOrPtrTy() &&
+ I->getType()->isVectorTy() && !Result->getType()->isVectorTy()) {
+ TypeSize Size = Result->getType()->getPrimitiveSizeInBits();
+ assert((unsigned)Size % 2 == 0);
+ unsigned HalfSize = (unsigned)Size / 2;
----------------
arsenm wrote:
bitcast i128 to <2 x ptr> and then inttoptr <2 x i64> to <2 x ptr>?
https://github.com/llvm/llvm-project/pull/120716
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits