Rafael Espindola 702bcce747 The dominance computation already has logic for computing if an edge dominates
a use or a BB, but it is inline in the handling of the invoke instruction.

This patch refactors it so that it can be used in other cases. For example, in

define i32 @f(i32 %x) {
bb0:
  %cmp = icmp eq i32 %x, 0
  br i1 %cmp, label %bb2, label %bb1
bb1:
  br label %bb2
bb2:
  %cond = phi i32 [ %x, %bb0 ], [ 0, %bb1 ]
  %foo = add i32 %cond, %x
  ret i32 %foo
}

GVN should be able to replace %x with 0 in any use that is dominated by the
true edge out of bb0. In the above example the only such use is the one in
the phi.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161429 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-07 17:30:46 +00:00
..
2012-07-19 04:50:12 +00:00
2012-08-06 22:34:51 +00:00
2012-07-25 17:18:59 +00:00
2012-07-24 21:40:17 +00:00
2012-07-19 00:01:00 +00:00
2012-06-27 17:10:33 +00:00
2012-06-23 12:14:23 +00:00
2011-12-01 08:00:17 +00:00
2012-01-26 00:06:44 +00:00
2012-05-16 22:08:58 +00:00