[LPM] Stop using the string based preservation API. It is an
authorChandler Carruth <chandlerc@gmail.com>
Wed, 28 Jan 2015 04:57:56 +0000 (04:57 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 28 Jan 2015 04:57:56 +0000 (04:57 +0000)
commit52334f2ad84e965af786de252b41974b38ca9593
tree7ad6f6c579e240b0dfbfd70ac6eec926302c3e30
parentb99395a7f7e98ee67c86667008be1ec72a9c8f55
[LPM] Stop using the string based preservation API. It is an
abomination.

For starters, this API is incredibly slow. In order to lookup the name
of a pass it must take a memory fence to acquire a pointer to the
managed static pass registry, and then potentially acquire locks while
it consults this registry for information about what passes exist by
that name. This stops the world of LLVMs in your process no matter
how little they cared about the result.

To make this more joyful, you'll note that we are preserving many passes
which *do not exist* any more, or are not even analyses which one might
wish to have be preserved. This means we do all the work only to say
"nope" with no error to the user.

String-based APIs are a *bad idea*. String-based APIs that cannot
produce any meaningful error are an even worse idea. =/

I have a patch that simply removes this API completely, but I'm hesitant
to commit it as I don't really want to perniciously break out-of-tree
users of the old pass manager. I'd rather they just have to migrate to
the new one at some point. If others disagree and would like me to kill
it with fire, just say the word. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227294 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/MachineFunctionPass.cpp
lib/Target/Hexagon/HexagonRemoveSZExtArgs.cpp
lib/Target/NVPTX/NVPTXAllocaHoisting.h
lib/Target/NVPTX/NVPTXLowerAggrCopies.h
lib/Transforms/Scalar/LoopInstSimplify.cpp
lib/Transforms/Utils/LowerSwitch.cpp
lib/Transforms/Utils/UnifyFunctionExitNodes.cpp