[PATCH] D54007: Use a data structure better suited for large sets in SimplificationTracker.

Ali Tamur via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 6 15:34:12 PST 2018


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

Thank you for the explanation. OK, neither SmallPtrSet nor SmallSetVector seems suitable for this specific task, so I created a simple set implementation, that is fast and has the same iteration order with SmallSetVector; so I don't expect any behaviour change. (The problem with SmallSetVector is that it actually removes elements from the underlying vector and shifts all others, which is bad when we have many elements).

I arrived at 600.000 by putting a static variable that peeks the AllPhiNodes.size() and acts as a "maximum value tracker" inside SimplificationTracker::insertNewPhi, so it should correspond to a single activation. The code I am trying to compile is open source (EPL 1.0), if you are curious or want to verify:

- download https://www.coin-or.org/download/source/Cbc/Cbc-2.9.5.tgz
- compile Cbc-2.9.5/Cbc/src/CbcSolver.cpp with -O3 --target=powerpc64le -std=gnu++17  options.


Repository:
  rL LLVM

https://reviews.llvm.org/D54007





More information about the llvm-commits mailing list