Teach GVN to also propagate switch cases. For example, in this code
authorDuncan Sands <baldrick@free.fr>
Fri, 7 Oct 2011 08:29:06 +0000 (08:29 +0000)
committerDuncan Sands <baldrick@free.fr>
Fri, 7 Oct 2011 08:29:06 +0000 (08:29 +0000)
commit3f329cb781492e19a72af267cd3b7c2d8307a818
tree2332fd912c30ef02c25f5187751796d9979b99cb
parent75fe5f3bab7c33c14e5f7956e01a9d95d2712cc5
Teach GVN to also propagate switch cases.  For example, in this code
  switch (n) {
    case 27:
      do_something(x);
    ...
  }
the call do_something(x) will be replaced with do_something(27).  In
gcc-as-one-big-file this results in the removal of about 500 lines of
bitcode (about 0.02%), so has about 1/10 of the effect of propagating
branch conditions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141360 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/GVN.cpp
test/Transforms/GVN/condprop.ll