<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 8, 2016, at 11:32 AM, Michael Zolotukhin via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">On Aug 8, 2016, at 9:55 AM, Hans Wennborg <<a href="mailto:hans@chromium.org" class="">hans@chromium.org</a>> wrote:<br class=""><br class="">Can a regular user run into this? The PR talks about the new pass<br class="">manager. I haven't followed along very well, is that (partially)<br class="">enabled by default these days?<br class=""></blockquote><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">It can also be exposed with the old PM (I mentioned a way in the comments to that bug). It was just discovered with the new PM.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="">From the PR it also sounds like the original test case still fails?<br class=""></blockquote><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I’ll look into it, probably there is more than one issue there. It still might be a good idea to merge this in, as the test from the commit would fail without the fix anyway.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote>We might wait for a complete fix though. I hope to get it this week.</div><div><br class=""></div><div>Michael<br class=""><blockquote type="cite" class=""><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Thanks,</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Michael</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Thanks,<br class="">Hans<br class=""><br class="">On Fri, Aug 5, 2016 at 3:12 PM, Michael Zolotukhin<br class=""><<a href="mailto:mzolotukhin@apple.com" class="">mzolotukhin@apple.com</a>> wrote:<br class=""><blockquote type="cite" class="">Hi Hans,<br class=""><br class="">I think this fix is worth merging to the branch.<br class=""><br class="">Thanks,<br class="">Michael<br class=""><br class=""><blockquote type="cite" class="">On Aug 5, 2016, at 3:00 PM, Michael Zolotukhin <<a href="mailto:mzolotukhin@apple.com" class="">mzolotukhin@apple.com</a>> wrote:<br class=""><br class="">mzolotukhin committed rL277877: [LoopSimplify] Fix updating LCSSA after separating nested loops..<br class=""><br class="">[LoopSimplify] Fix updating LCSSA after separating nested loops.<br class=""><br class="">This fixes PR28825. The problem was that we only checked if a value from<br class="">a created inner loop is used in the outer loop, and fixed LCSSA for<br class="">them. But we missed to fixup LCSSA for values used in exits of the outer<br class="">loop.<br class=""><br class=""><br class="">Files:<br class="">/llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp<br class="">/llvm/trunk/test/Transforms/LoopSimplify/pr28272.ll<br class=""><br class="">PATCH<br class=""><br class="">Index: llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp<br class="">===================================================================<br class="">--- llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp  (revision 277876)<br class="">+++ llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp  (revision 277877)<br class="">@@ -376,6 +376,21 @@<br class="">      }<br class="">    }<br class="">  }<br class="">+    // We also need to check exit blocks of the outer loop - it might be using<br class="">+    // values from what now became an inner loop.<br class="">+    SmallVector<BasicBlock*, 8> ExitBlocks;<br class="">+    NewOuter->getExitBlocks(ExitBlocks);<br class="">+    for (BasicBlock *ExitBB: ExitBlocks) {<br class="">+      for (Instruction &I : *ExitBB) {<br class="">+        for (Value *Op : I.operands()) {<br class="">+          Instruction *OpI = dyn_cast<Instruction>(Op);<br class="">+          if (!OpI || !L->contains(OpI))<br class="">+            continue;<br class="">+          WorklistSet.insert(OpI);<br class="">+        }<br class="">+      }<br class="">+    }<br class="">+<br class="">  SmallVector<Instruction *, 8> Worklist(WorklistSet.begin(),<br class="">                                         WorklistSet.end());<br class="">  formLCSSAForInstructions(Worklist, *DT, *LI);<br class="">Index: llvm/trunk/test/Transforms/LoopSimplify/pr28272.ll<br class="">===================================================================<br class="">--- llvm/trunk/test/Transforms/LoopSimplify/pr28272.ll        (revision 277876)<br class="">+++ llvm/trunk/test/Transforms/LoopSimplify/pr28272.ll        (revision 277877)<br class="">@@ -1,7 +1,7 @@<br class="">; RUN: opt < %s -lcssa -loop-unroll -S | FileCheck %s<br class="">target triple = "x86_64-unknown-linux-gnu"<br class=""><br class="">-; PR28272<br class="">+; PR28272, PR28825<br class="">; When LoopSimplify separates nested loops, it might break LCSSA form: values<br class="">; from the original loop might be used in the outer loop. This test invokes<br class="">; loop-unroll, which calls loop-simplify before itself. If LCSSA is broken<br class="">@@ -74,3 +74,35 @@<br class="">bb:<br class="">br label %loop2<br class="">}<br class="">+<br class="">+; When LoopSimplify separates nested loops, it might break LCSSA form: values<br class="">+; from the original loop might be used in exit blocks of the outer loop.<br class="">+; CHECK-LABEL: @foo3<br class="">+define void @foo3() {<br class="">+entry:<br class="">+  br label %bb1<br class="">+<br class="">+bb1:<br class="">+  br i1 undef, label %bb2, label %bb1<br class="">+<br class="">+bb2:<br class="">+  %a = phi i32 [ undef, %bb1 ], [ %a, %bb3 ], [ undef, %bb5 ]<br class="">+  br i1 undef, label %bb3, label %bb1<br class="">+<br class="">+bb3:<br class="">+  %b = load i32*, i32** undef<br class="">+  br i1 undef, label %bb2, label %bb4<br class="">+<br class="">+bb4:<br class="">+  br i1 undef, label %bb5, label %bb6<br class="">+<br class="">+bb5:<br class="">+  br i1 undef, label %bb2, label %bb4<br class="">+<br class="">+bb6:<br class="">+  br i1 undef, label %bb_end, label %bb1<br class="">+<br class="">+bb_end:<br class="">+  %x = getelementptr i32, i32* %b<br class="">+  br label %bb_end<br class="">+}<br class=""><br class="">Users:<br class="">mzolotukhin (Author)<br class=""><br class=""><a href="https://reviews.llvm.org/rL277877" class="">https://reviews.llvm.org/rL277877</a><br class=""><br class=""><br class=""><br class=""></blockquote><br class=""></blockquote></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">llvm-commits mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:llvm-commits@lists.llvm.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">llvm-commits@lists.llvm.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a></div></blockquote></div><br class=""></body></html>