Simplify common predecessor finding.
authorBenjamin Kramer <benny.kra@googlemail.com>
Tue, 6 Dec 2011 16:14:29 +0000 (16:14 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Tue, 6 Dec 2011 16:14:29 +0000 (16:14 +0000)
commit88c09143b6af07ed7b16381885a03c4b10886f96
treebf43148ac9de4f7f2cc7438f7093c8c00313c552
parent85dadecbd664f60f0c7e4fbb44f083d43d01cfb7
Simplify common predecessor finding.

- Walking over pred_begin/pred_end is an expensive operation.
- PHINodes contain a value for each predecessor anyway.
- While it may look like we used to save a few iterations with the set,
  be aware that getIncomingValueForBlock does a linear search on
  the values of the phi node.
- Another -5% on ARMDisassembler.cpp (Release build). This was the last
  entry in the profile that was obviously wasting time.

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