Teach InstructionSimplify about phi nodes. I chose to have it simply
authorDuncan Sands <baldrick@free.fr>
Sun, 14 Nov 2010 13:30:18 +0000 (13:30 +0000)
committerDuncan Sands <baldrick@free.fr>
Sun, 14 Nov 2010 13:30:18 +0000 (13:30 +0000)
commitcd6636c737a82949ad13db2d0d918af6424fb78b
treed3a7b6371ca1c32f8ca737e1dfb5625b7af8b6e5
parentc0362d5c6e0066c741bce056a65d8b4c026de19f
Teach InstructionSimplify about phi nodes.  I chose to have it simply
offload the work to hasConstantValue rather than do something more
complicated (such handling mutually recursive phis) because (1) it is
not clear it is worth it; and (2) if it is worth it, maybe such logic
would be better placed in hasConstantValue.  Adjust some GVN tests
which are now cleaned up much further (eg: all phi nodes are removed).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119043 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/InstructionSimplify.cpp
lib/Transforms/InstCombine/InstCombinePHI.cpp
test/Transforms/GVN/2007-07-26-InterlockingLoops.ll
test/Transforms/GVN/2010-03-31-RedundantPHIs.ll