Emit the LLVM<->DWARF register mapping as a sorted table and use binary search to...
authorBenjamin Kramer <benny.kra@googlemail.com>
Sun, 1 Apr 2012 14:23:58 +0000 (14:23 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sun, 1 Apr 2012 14:23:58 +0000 (14:23 +0000)
commit243018ffcf764e4dde2968f909f4a2e578aafe86
treeee4d0f104ef2d917497a0fc8ebe798d807aaad98
parentdafe48e230916ce0de4228d81dece732159994f1
Emit the LLVM<->DWARF register mapping as a sorted table and use binary search to do the lookup.

This also avoids emitting the information twice, which led to code bloat. On i386-linux-Release+Asserts
with all targets built this change shaves a whopping 1.3 MB off clang. The number is probably exaggerated
by recent inliner changes but the methods were already enormous with the old inline cost computation.

The DWARF reg -> LLVM reg mapping doesn't seem to have holes in it, so it could be a simple lookup table.
I didn't implement that optimization yet to avoid potentially changing functionality.

There is still some duplication both in tablegen and the generated code that should be cleaned up eventually.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153837 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCRegisterInfo.h
utils/TableGen/RegisterInfoEmitter.cpp
utils/TableGen/RegisterInfoEmitter.h