SimplifyCFG: Enhance the "remove CFG edge that leads to null pointer dereference...
authorBenjamin Kramer <benny.kra@googlemail.com>
Thu, 4 Oct 2012 16:11:49 +0000 (16:11 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Thu, 4 Oct 2012 16:11:49 +0000 (16:11 +0000)
commit1e21db6e831923bb35d2c5e22b50ad198de49a61
tree253053dc74e2c5ae2589dd1f211e0faf8824b897
parent7508f946bc4b5022cc4612c8c7492f2e23043976
SimplifyCFG: Enhance the "remove CFG edge that leads to null pointer dereference" optimization to also handle instructions with multiple uses.

We conservatively only check the first use to avoid walking long use chains.
This catches the common case of having both a load and a store to a pointer
supplied by a PHI node.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165232 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyCFG.cpp
test/Transforms/SimplifyCFG/phi-undef-loadstore.ll