[PATCH] D65174: [DAGCombine] Limit the number of times for a store being considered for merging

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 29 11:23:11 PDT 2019


wmi marked an inline comment as done.
wmi added a comment.

Thanks for pointing me to D60133 <https://reviews.llvm.org/D60133>.

I check and the reason the candidates cannot be merged isn't because of the legal size. It is that checkMergeStoreCandidatesForDependencies always returns false so https://reviews.llvm.org/D60133 doesn't help.

For the case addressed in https://reviews.llvm.org/D60133, limiting the search to the correct size is definitely a good way to solve it. But I think it can cause compile time problem likely also because the same store and root pair appearing repeatedly, so the patch here may also help for the case in D60133 <https://reviews.llvm.org/D60133>.



================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:15461
+    // merging from the same root.
+    if (RootStorePairCountMap[{RootNode, St}] > StoreMergeLimit)
+      return;
----------------
niravd wrote:
> nit: Hoist this and the equal check in the else clause out of the if.
The RootNode is updated inside of then branch so it wasn't hoisted above.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65174/new/

https://reviews.llvm.org/D65174





More information about the llvm-commits mailing list