llvm-6502/lib/Transforms
Chandler Carruth 55eab086e3 Fix rampant quadratic behavior in UpdatePHINodes. The operation of
mapping from a basic block to an incoming value, either for removal or
just lookup, is linear in the number of predecessors, and we were doing
this for every entry in the 'Preds' list which is in many cases almost
all of them!

Unfortunately, the fixes are quite ugly. PHI nodes just don't make this
operation easy. The efficient way to fix this is to have a clever
'remove_if' operation on PHI nodes that lets us do a single pass over
all the incoming values of the original PHI node, extracting the ones we
care about. Then we could quickly construct the new phi node from this
list. This would remove the remaining underlying quadratic movement of
unrelated incoming values and the need for silly backwards looping to
"minimize" how often we hit the quadratic case.

This is the last obvious fix for PR19499. It shaves another 20% off the
compile time for me, and while UpdatePHINodes remains in the profile,
most of the time is now stemming from the well known inefficiencies of
LVI and jump threading.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207409 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-28 10:37:30 +00:00
..
Hello [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:55:47 +00:00
InstCombine [C++] Use 'nullptr'. 2014-04-28 04:05:08 +00:00
Instrumentation [C++] Use 'nullptr'. 2014-04-28 04:05:08 +00:00
IPO SCC: Change clients to use const, NFC 2014-04-25 18:24:50 +00:00
ObjCARC [C++] Use 'nullptr'. 2014-04-28 04:05:08 +00:00
Scalar [C++] Use 'nullptr'. 2014-04-28 04:05:08 +00:00
Utils Fix rampant quadratic behavior in UpdatePHINodes. The operation of 2014-04-28 10:37:30 +00:00
Vectorize [C++] Use 'nullptr'. 2014-04-28 04:05:08 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile