<div dir="ltr">Would you mind giving a pointer on how I can reproduce this failure locally (e.g. flags used)? I hoped r340067 would fix it, but seems not.</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Aug 20, 2018 at 10:59 AM Krzysztof Parzyszek <<a href="mailto:kparzysz@codeaurora.org">kparzysz@codeaurora.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It seems like this commit broke Hexagon buildbots. Could you take a look?<br>
<br>
First breakage:<br>
<a href="http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/19479" rel="noreferrer" target="_blank">http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/19479</a><br>
<br>
-Krzysztof<br>
<br>
On 8/17/2018 12:39 PM, Alina Sbirlea via llvm-commits wrote:<br>
> Author: asbirlea<br>
> Date: Fri Aug 17 10:39:15 2018<br>
> New Revision: 340052<br>
> <br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=340052&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=340052&view=rev</a><br>
> Log:<br>
> [IDF] Teach Iterated Dominance Frontier to use a snapshot CFG based on a GraphDiff.<br>
> <br>
> Summary:<br>
> Create the ability to compute IDF using a CFG View.<br>
> For this, we'll need a new DT created using a list of Updates (to be refactored later to a GraphDiff), and the GraphTraits based on the same GraphDiff.<br>
> <br>
> Reviewers: kuhar, george.burgess.iv, mzolotukhin<br>
> <br>
> Subscribers: sanjoy, jlebar, llvm-commits<br>
> <br>
> Differential Revision: <a href="https://reviews.llvm.org/D50675" rel="noreferrer" target="_blank">https://reviews.llvm.org/D50675</a><br>
> <br>
> Modified:<br>
>      llvm/trunk/include/llvm/Analysis/IteratedDominanceFrontier.h<br>
>      llvm/trunk/lib/Analysis/IteratedDominanceFrontier.cpp<br>
> <br>
> Modified: llvm/trunk/include/llvm/Analysis/IteratedDominanceFrontier.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/IteratedDominanceFrontier.h?rev=340052&r1=340051&r2=340052&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/IteratedDominanceFrontier.h?rev=340052&r1=340051&r2=340052&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/Analysis/IteratedDominanceFrontier.h (original)<br>
> +++ llvm/trunk/include/llvm/Analysis/IteratedDominanceFrontier.h Fri Aug 17 10:39:15 2018<br>
> @@ -28,6 +28,7 @@<br>
>   #include "llvm/ADT/SmallPtrSet.h"<br>
>   #include "llvm/ADT/SmallVector.h"<br>
>   #include "llvm/IR/BasicBlock.h"<br>
> +#include "llvm/IR/CFGDiff.h"<br>
>   #include "llvm/IR/Dominators.h"<br>
>   <br>
>   namespace llvm {<br>
> @@ -45,17 +46,21 @@ namespace llvm {<br>
>   template <class NodeTy, bool IsPostDom><br>
>   class IDFCalculator {<br>
>    public:<br>
> -  IDFCalculator(DominatorTreeBase<BasicBlock, IsPostDom> &DT)<br>
> -      : DT(DT), useLiveIn(false) {}<br>
> +   IDFCalculator(DominatorTreeBase<BasicBlock, IsPostDom> &DT)<br>
> +       : DT(DT), GD(nullptr), useLiveIn(false) {}<br>
>   <br>
> -  /// Give the IDF calculator the set of blocks in which the value is<br>
> -  /// defined.  This is equivalent to the set of starting blocks it should be<br>
> -  /// calculating the IDF for (though later gets pruned based on liveness).<br>
> -  ///<br>
> -  /// Note: This set *must* live for the entire lifetime of the IDF calculator.<br>
> -  void setDefiningBlocks(const SmallPtrSetImpl<BasicBlock *> &Blocks) {<br>
> -    DefBlocks = &Blocks;<br>
> -  }<br>
> +   IDFCalculator(DominatorTreeBase<BasicBlock, IsPostDom> &DT,<br>
> +                 GraphDiff<BasicBlock *, IsPostDom> *GD)<br>
> +       : DT(DT), GD(GD), useLiveIn(false) {}<br>
> +<br>
> +   /// Give the IDF calculator the set of blocks in which the value is<br>
> +   /// defined.  This is equivalent to the set of starting blocks it should be<br>
> +   /// calculating the IDF for (though later gets pruned based on liveness).<br>
> +   ///<br>
> +   /// Note: This set *must* live for the entire lifetime of the IDF calculator.<br>
> +   void setDefiningBlocks(const SmallPtrSetImpl<BasicBlock *> &Blocks) {<br>
> +     DefBlocks = &Blocks;<br>
> +   }<br>
>   <br>
>     /// Give the IDF calculator the set of blocks in which the value is<br>
>     /// live on entry to the block.   This is used to prune the IDF calculation to<br>
> @@ -85,6 +90,7 @@ class IDFCalculator {<br>
>   <br>
>   private:<br>
>    DominatorTreeBase<BasicBlock, IsPostDom> &DT;<br>
> + GraphDiff<BasicBlock *, IsPostDom> *GD;<br>
>    bool useLiveIn;<br>
>    const SmallPtrSetImpl<BasicBlock *> *LiveInBlocks;<br>
>    const SmallPtrSetImpl<BasicBlock *> *DefBlocks;<br>
> <br>
> Modified: llvm/trunk/lib/Analysis/IteratedDominanceFrontier.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IteratedDominanceFrontier.cpp?rev=340052&r1=340051&r2=340052&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IteratedDominanceFrontier.cpp?rev=340052&r1=340051&r2=340052&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/Analysis/IteratedDominanceFrontier.cpp (original)<br>
> +++ llvm/trunk/lib/Analysis/IteratedDominanceFrontier.cpp Fri Aug 17 10:39:15 2018<br>
> @@ -17,6 +17,7 @@<br>
>   #include <queue><br>
>   <br>
>   namespace llvm {<br>
> +<br>
>   template <class NodeTy, bool IsPostDom><br>
>   void IDFCalculator<NodeTy, IsPostDom>::calculate(<br>
>       SmallVectorImpl<BasicBlock *> &PHIBlocks) {<br>
> @@ -61,29 +62,39 @@ void IDFCalculator<NodeTy, IsPostDom>::c<br>
>         BasicBlock *BB = Node->getBlock();<br>
>         // Succ is the successor in the direction we are calculating IDF, so it is<br>
>         // successor for IDF, and predecessor for Reverse IDF.<br>
> -      for (auto *Succ : children<NodeTy>(BB)) {<br>
> +      auto DoWork = [&](BasicBlock *Succ) {<br>
>           DomTreeNode *SuccNode = DT.getNode(Succ);<br>
>   <br>
>           // Quickly skip all CFG edges that are also dominator tree edges instead<br>
>           // of catching them below.<br>
>           if (SuccNode->getIDom() == Node)<br>
> -          continue;<br>
> +          return;<br>
>   <br>
>           const unsigned SuccLevel = SuccNode->getLevel();<br>
>           if (SuccLevel > RootLevel)<br>
> -          continue;<br>
> +          return;<br>
>   <br>
>           if (!VisitedPQ.insert(SuccNode).second)<br>
> -          continue;<br>
> +          return;<br>
>   <br>
>           BasicBlock *SuccBB = SuccNode->getBlock();<br>
>           if (useLiveIn && !LiveInBlocks->count(SuccBB))<br>
> -          continue;<br>
> +          return;<br>
>   <br>
>           PHIBlocks.emplace_back(SuccBB);<br>
>           if (!DefBlocks->count(SuccBB))<br>
>             PQ.push(std::make_pair(<br>
>                 SuccNode, std::make_pair(SuccLevel, SuccNode->getDFSNumIn())));<br>
> +      };<br>
> +<br>
> +      if (GD) {<br>
> +        for (auto Pair : children<<br>
> +                 std::pair<const GraphDiff<BasicBlock *, IsPostDom> *, NodeTy>>(<br>
> +                 {GD, BB}))<br>
> +          DoWork(Pair.second);<br>
> +      } else {<br>
> +        for (auto *Succ : children<NodeTy>(BB))<br>
> +          DoWork(Succ);<br>
>         }<br>
>   <br>
>         for (auto DomChild : *Node) {<br>
> <br>
> <br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
> <br>
<br>
-- <br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, <br>
hosted by The Linux Foundation<br>
</blockquote></div>