PHINode::getBasicBlockIndex is O(n) in the number of inputs
authorChris Lattner <sabre@nondot.org>
Sat, 13 Feb 2010 04:24:19 +0000 (04:24 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 13 Feb 2010 04:24:19 +0000 (04:24 +0000)
commit277cccc58fcbc6da6c83b5ccdb2c0ec0ab46bbc1
tree6f0e0b915de275949f3ed8f46197c467995df538
parent2f36ea8b74f2d81b0d14cbaf11f2158c97355dfd
PHINode::getBasicBlockIndex is O(n) in the number of inputs
to a PHI, avoid it in the common case where the BB occurs
in the same index for multiple phis.  This speeds up CGP on
an insane testcase from 8.35 to 3.58s.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96080 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/BreakCriticalEdges.cpp