Add a little heuristic to Value::isUsedInBasicBlock to speed it up for small basic...
authorBenjamin Kramer <benny.kra@googlemail.com>
Mon, 5 Dec 2011 17:23:27 +0000 (17:23 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Mon, 5 Dec 2011 17:23:27 +0000 (17:23 +0000)
commit4da7f90b1780e4d1ba38da64c849b9c2b1c67071
tree445a3da34fcc6a74bba575914c6aafd2299ffc3d
parent27de2a54f3d500d00a2cf15f813944422a51dfa9
Add a little heuristic to Value::isUsedInBasicBlock to speed it up for small basic blocks.

- Calling getUser in a loop is much more expensive than iterating over a few instructions.
- Use it instead of the open-coded loop in AddrModeMatcher.
- 5% speedup on ARMDisassembler.cpp Release builds.

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