Switch pattern sorting predicate from stable sort -> sort, it
authorChris Lattner <sabre@nondot.org>
Mon, 29 Mar 2010 02:02:45 +0000 (02:02 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 29 Mar 2010 02:02:45 +0000 (02:02 +0000)
commit283d1ceb576849f332df800b7bb1c609786e92b6
tree87a2b38c07c6bec940a036be39743aa474e95e8d
parent4810736134ee157036a67ed91855f737bc62dae2
Switch pattern sorting predicate from stable sort -> sort, it
doesn't need to be stable because the patterns are fully ordered.

Add a first level sort predicate that orders patterns in this
order:  1) scalar integer operations 2) scalar floating point
3) vector int 4) vector float.  This is a trivial sort on their
top level pattern type so it is nice and transitive.  The
benefit of doing this is that simple integer operations are
much more common than insane vector things and isel was trying
to match the big complex vector patterns before the simple
ones because the complexity of the vector operations was much
higher.  Since they can't both match, it is best (for compile
time) to try the simple integer ones first.

This cuts down the # failed match attempts on real code by
quite a bit, for example, this reduces backtracks on crafty
(as a random example) from 228285 -> 188369.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99797 91177308-0d34-0410-b5e6-96231b3b80d8
utils/TableGen/DAGISelEmitter.cpp