@@ -3629,15 +3629,15 @@ void IRGenSILFunction::visitRetainValueInst(swift::RetainValueInst *i) {
3629
3629
}
3630
3630
3631
3631
void IRGenSILFunction::visitRetainValueAddrInst (swift::RetainValueAddrInst *i) {
3632
- assert (i->getAtomicity () == RefCountingInst::Atomicity::Atomic &&
3633
- " Non atomic retains are not supported" );
3634
3632
SILValue operandValue = i->getOperand ();
3635
3633
Address addr = getLoweredAddress (operandValue);
3636
3634
SILType addrTy = operandValue->getType ();
3637
3635
SILType objectT = addrTy.getObjectType ();
3638
3636
llvm::Type *llvmType = addr.getAddress ()->getType ();
3639
3637
const TypeInfo &addrTI = getTypeInfo (addrTy);
3640
- auto *outlinedF = IGM.getOrCreateRetainFunction (addrTI, objectT, llvmType);
3638
+ auto atomicity = i->isAtomic () ? Atomicity::Atomic : Atomicity::NonAtomic;
3639
+ auto *outlinedF = IGM.getOrCreateRetainFunction (
3640
+ addrTI, objectT, llvmType, atomicity);
3641
3641
llvm::Value *args[] = {addr.getAddress ()};
3642
3642
llvm::CallInst *call = Builder.CreateCall (outlinedF, args);
3643
3643
call->setCallingConv (IGM.DefaultCC );
@@ -3704,16 +3704,15 @@ void IRGenSILFunction::visitReleaseValueInst(swift::ReleaseValueInst *i) {
3704
3704
3705
3705
void IRGenSILFunction::visitReleaseValueAddrInst (
3706
3706
swift::ReleaseValueAddrInst *i) {
3707
- assert (i->getAtomicity () == RefCountingInst::Atomicity::Atomic &&
3708
- " Non atomic retains are not supported" );
3709
3707
SILValue operandValue = i->getOperand ();
3710
3708
Address addr = getLoweredAddress (operandValue);
3711
3709
SILType addrTy = operandValue->getType ();
3712
3710
SILType objectT = addrTy.getObjectType ();
3713
3711
llvm::Type *llvmType = addr.getAddress ()->getType ();
3714
3712
const TypeInfo &addrTI = getTypeInfo (addrTy);
3713
+ auto atomicity = i->isAtomic () ? Atomicity::Atomic : Atomicity::NonAtomic;
3715
3714
auto *outlinedF = IGM.getOrCreateReleaseFunction (
3716
- addrTI, objectT, llvmType);
3715
+ addrTI, objectT, llvmType, atomicity );
3717
3716
llvm::Value *args[] = {addr.getAddress ()};
3718
3717
llvm::CallInst *call = Builder.CreateCall (outlinedF, args);
3719
3718
call->setCallingConv (IGM.DefaultCC );
0 commit comments