<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I would like to propose merging the patch below into the release branch.<div class=""><br class=""></div><div class="">The patch affects only code that uses the ‘swifterror’ attribute — code generated by the swift compiler.<br class=""><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">Begin forwarded message:</div><br class="Apple-interchange-newline"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">From: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">Arnold Schwaighofer via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>><br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Subject: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class=""><b class="">[llvm] r293658 - Don't combine stores to a swifterror pointer operand to a different type</b><br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Date: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">January 31, 2017 at 9:53:50 AM PST<br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">To: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Reply-To: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">Arnold Schwaighofer <<a href="mailto:aschwaighofer@apple.com" class="">aschwaighofer@apple.com</a>><br class=""></span></div><br class=""><div class=""><div class="">Author: arnolds<br class="">Date: Tue Jan 31 11:53:49 2017<br class="">New Revision: 293658<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=293658&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=293658&view=rev</a><br class="">Log:<br class="">Don't combine stores to a swifterror pointer operand to a different type<br class=""><br class="">Modified:<br class="">    llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp<br class="">    llvm/trunk/test/Transforms/InstCombine/load.ll<br class=""><br class="">Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp?rev=293658&r1=293657&r2=293658&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp?rev=293658&r1=293657&r2=293658&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp (original)<br class="">+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp Tue Jan 31 11:53:49 2017<br class="">@@ -502,7 +502,8 @@ static Instruction *combineLoadToOperati<br class="">       !DL.isNonIntegralPointerType(Ty)) {<br class="">     if (all_of(LI.users(), [&LI](User *U) {<br class="">           auto *SI = dyn_cast<StoreInst>(U);<br class="">-          return SI && SI->getPointerOperand() != &LI;<br class="">+          return SI && SI->getPointerOperand() != &LI &&<br class="">+                 !SI->getPointerOperand()->isSwiftError();<br class="">         })) {<br class="">       LoadInst *NewLoad = combineLoadToNewType(<br class="">           IC, LI,<br class=""><br class="">Modified: llvm/trunk/test/Transforms/InstCombine/load.ll<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/load.ll?rev=293658&r1=293657&r2=293658&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/load.ll?rev=293658&r1=293657&r2=293658&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/test/Transforms/InstCombine/load.ll (original)<br class="">+++ llvm/trunk/test/Transforms/InstCombine/load.ll Tue Jan 31 11:53:49 2017<br class="">@@ -219,3 +219,22 @@ entry:<br class="">   store %swift.error* %err.res, %swift.error** %err, align 8<br class="">   ret void<br class=""> }<br class="">+<br class="">+; Make sure we preseve the type of the store to a swifterror pointer.<br class="">+; CHECK-LABEL: @test19(<br class="">+; CHECK: [[A:%.*]] = alloca<br class="">+; CHECK: call<br class="">+; CHECK: [[BC:%.*]] = bitcast i8** [[A]] to<br class="">+; CHECK: [[ERRVAL:%.*]] =  load {{.*}}[[BC]]<br class="">+; CHECK: store {{.*}}[[ERRVAL]]<br class="">+; CHECK: ret<br class="">+declare void @initi8(i8**)<br class="">+define void @test19(%swift.error** swifterror %err) {<br class="">+entry:<br class="">+  %tmp = alloca i8*, align 8<br class="">+  call void @initi8(i8** %tmp)<br class="">+  %swifterror = bitcast i8** %tmp to %swift.error**<br class="">+  %err.res = load %swift.error*, %swift.error** %swifterror, align 8<br class="">+  store %swift.error* %err.res, %swift.error** %err, align 8<br class="">+  ret void<br class="">+}<br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits<br class=""></div></div></blockquote></div><br class=""></div></div></body></html>