<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi David(s),</div><div class=""><br class=""></div><div class="">Can we get r257279 and its followup approved for the 3.8 branch?  Hans, is there still time for RC3? :)</div><div class=""><br class=""></div><div class="">-Dimitry</div><br class=""><div><blockquote type="cite" class=""><div class="">On 11 Jan 2016, at 06:42, David Majnemer 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="">Yes, I added one yesterday (r257280).<span class=""></span><br class=""><br class="">On Sunday, January 10, 2016, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">any way to test this?</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Sat, Jan 9, 2016 at 11:13 PM, David Majnemer via llvm-commits <span dir="ltr" class=""><<a href="javascript:_e(%7B%7D,'cvml','llvm-commits@lists.llvm.org');" target="_blank" class="">llvm-commits@lists.llvm.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: majnemer<br class="">
Date: Sun Jan 10 01:13:04 2016<br class="">
New Revision: 257279<br class="">
<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=257279&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=257279&view=rev</a><br class="">
Log:<br class="">
[JumpThreading] Don't forget to report that the IR changed<br class="">
<br class="">
JumpThreading's runOnFunction is supposed to return true if it made any<br class="">
changes.  JumpThreading has a call to removeUnreachableBlocks which may<br class="">
result in changes to the IR but runOnFunction didn't appropriate account<br class="">
for this possibility, leading to badness.<br class="">
<br class="">
While we are here, make sure to call LazyValueInfo::eraseBlock in<br class="">
removeUnreachableBlocks;  JumpThreading preserves LVI.<br class="">
<br class="">
This fixes PR26096.<br class="">
<br class="">
Modified:<br class="">
    llvm/trunk/include/llvm/Transforms/Utils/Local.h<br class="">
    llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp<br class="">
    llvm/trunk/lib/Transforms/Utils/Local.cpp<br class="">
<br class="">
Modified: llvm/trunk/include/llvm/Transforms/Utils/Local.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/Local.h?rev=257279&r1=257278&r2=257279&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/Local.h?rev=257279&r1=257278&r2=257279&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/include/llvm/Transforms/Utils/Local.h (original)<br class="">
+++ llvm/trunk/include/llvm/Transforms/Utils/Local.h Sun Jan 10 01:13:04 2016<br class="">
@@ -42,6 +42,7 @@ class TargetLibraryInfo;<br class="">
 class TargetTransformInfo;<br class="">
 class DIBuilder;<br class="">
 class DominatorTree;<br class="">
+class LazyValueInfo;<br class="">
<br class="">
 template<typename T> class SmallVectorImpl;<br class="">
<br class="">
@@ -303,7 +304,7 @@ void removeUnwindEdge(BasicBlock *BB);<br class="">
 /// \brief Remove all blocks that can not be reached from the function's entry.<br class="">
 ///<br class="">
 /// Returns true if any basic block was removed.<br class="">
-bool removeUnreachableBlocks(Function &F);<br class="">
+bool removeUnreachableBlocks(Function &F, LazyValueInfo *LVI = nullptr);<br class="">
<br class="">
 /// \brief Combine the metadata of two instructions so that K can replace J<br class="">
 ///<br class="">
<br class="">
Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp?rev=257279&r1=257278&r2=257279&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp?rev=257279&r1=257278&r2=257279&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original)<br class="">
+++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Sun Jan 10 01:13:04 2016<br class="">
@@ -211,11 +211,12 @@ bool JumpThreading::runOnFunction(Functi<br class="">
   // we will loop forever. We take care of this issue by not jump threading for<br class="">
   // back edges. This works for normal cases but not for unreachable blocks as<br class="">
   // they may have cycle with no back edge.<br class="">
-  removeUnreachableBlocks(F);<br class="">
+  bool EverChanged = false;<br class="">
+  EverChanged |= removeUnreachableBlocks(F, LVI);<br class="">
<br class="">
   FindLoopHeaders(F);<br class="">
<br class="">
-  bool Changed, EverChanged = false;<br class="">
+  bool Changed;<br class="">
   do {<br class="">
     Changed = false;<br class="">
     for (Function::iterator I = F.begin(), E = F.end(); I != E;) {<br class="">
<br class="">
Modified: llvm/trunk/lib/Transforms/Utils/Local.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Local.cpp?rev=257279&r1=257278&r2=257279&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Local.cpp?rev=257279&r1=257278&r2=257279&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/Transforms/Utils/Local.cpp (original)<br class="">
+++ llvm/trunk/lib/Transforms/Utils/Local.cpp Sun Jan 10 01:13:04 2016<br class="">
@@ -23,6 +23,7 @@<br class="">
 #include "llvm/Analysis/EHPersonalities.h"<br class="">
 #include "llvm/Analysis/InstructionSimplify.h"<br class="">
 #include "llvm/Analysis/MemoryBuiltins.h"<br class="">
+#include "llvm/Analysis/LazyValueInfo.h"<br class="">
 #include "llvm/Analysis/ValueTracking.h"<br class="">
 #include "llvm/IR/CFG.h"<br class="">
 #include "llvm/IR/Constants.h"<br class="">
@@ -1407,7 +1408,7 @@ void llvm::removeUnwindEdge(BasicBlock *<br class="">
 /// removeUnreachableBlocksFromFn - Remove blocks that are not reachable, even<br class="">
 /// if they are in a dead cycle.  Return true if a change was made, false<br class="">
 /// otherwise.<br class="">
-bool llvm::removeUnreachableBlocks(Function &F) {<br class="">
+bool llvm::removeUnreachableBlocks(Function &F, LazyValueInfo *LVI) {<br class="">
   SmallPtrSet<BasicBlock*, 128> Reachable;<br class="">
   bool Changed = markAliveBlocks(F, Reachable);<br class="">
<br class="">
@@ -1428,6 +1429,8 @@ bool llvm::removeUnreachableBlocks(Funct<br class="">
          ++SI)<br class="">
       if (Reachable.count(*SI))<br class="">
         (*SI)->removePredecessor(&*BB);<br class="">
+    if (LVI)<br class="">
+      LVI->eraseBlock(&*BB);<br class="">
     BB->dropAllReferences();<br class="">
   }<br class="">
<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="javascript:_e(%7B%7D,'cvml','llvm-commits@lists.llvm.org');" target="_blank" class="">llvm-commits@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="">
</blockquote></div><br class=""></div>
</blockquote>
_______________________________________________<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></blockquote></div><br class=""></body></html>