<div dir="ltr">Hello all,<div><br></div><div>We are seeing a large compiler performance regression in moving from LLVM 6.0.1 to 8.0.1. We have a long function (~50000 instructions) that used to compile in about a minute but now takes at least an hour. All the time is in MergeConsecutiveStores, I believe due to super-linear behavior in analyzing very long chains of stores. For example, this change makes the problem go away:</div><div><br></div><div>```</div><div>--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp<br>+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp<br>@@ -16011,6 +16011,9 @@ bool DAGCombiner::MergeConsecutiveStores(StoreSDNode *St) {<br>                        StoreNodes.begin() + NumConsecutiveStores);<br>       continue;<br>     }<br>+    else if (NumConsecutiveStores > 128) {<br>+      return RV;<br>+    }<br></div><div>```</div><div><br></div><div>Does anybody have any advice on what a good way to fix this would be? Does it make sense to have some kind of limit on how many stores we try to merge? (Even if so, I don't know whether the above is the right way to implement such a limit.)</div><div><br></div><div>Thanks in advance for any suggestions.</div><div><br></div><div>-Jeff</div><div><br></div></div>