diff --git a/lib/IRGen/IRGenSIL.cpp b/lib/IRGen/IRGenSIL.cpp index 349bf71f791e2..2a2b42fd22f3f 100644 --- a/lib/IRGen/IRGenSIL.cpp +++ b/lib/IRGen/IRGenSIL.cpp @@ -758,7 +758,7 @@ class IRGenSILFunction : if (IGM.IRGen.Opts.DisableDebuggerShadowCopies || IGM.IRGen.Opts.shouldOptimize() || IsAnonymous || isa(Storage) || isa(Storage) || - Storage->getType() == IGM.RefCountedPtrTy || !needsShadowCopy(Storage)) + !needsShadowCopy(Storage)) return Storage; // Emit a shadow copy. diff --git a/test/IRGen/builtins.swift b/test/IRGen/builtins.swift index 43adb03237981..e14cbc2e01deb 100644 --- a/test/IRGen/builtins.swift +++ b/test/IRGen/builtins.swift @@ -759,9 +759,10 @@ func generic_unsafeGuaranteed_test(_ t : T) -> T { } // CHECK-LABEL: define {{.*}} @{{.*}}unsafeGuaranteed_test -// CHECK: [[LOCAL:%.*]] = alloca %swift.refcounted* +// CHECK: [[LOCAL1:%.*]] = alloca %swift.refcounted* +// CHECK: [[LOCAL2:%.*]] = alloca %swift.refcounted* // CHECK: call %swift.refcounted* @swift_retain(%swift.refcounted* returned %0) -// CHECK: store %swift.refcounted* %0, %swift.refcounted** [[LOCAL]] +// CHECK: store %swift.refcounted* %0, %swift.refcounted** [[LOCAL2]] // CHECK-NOT: call void @swift_release(%swift.refcounted* %0) // CHECK: ret %swift.refcounted* %0 func unsafeGuaranteed_test(_ x: Builtin.NativeObject) -> Builtin.NativeObject {