llvm.org GIT mirror llvm / 434622b
Merge r98416 from mainline. Fix a typo in ValueTracking that's causing instcombine to delete needed shift instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_27@99289 91177308-0d34-0410-b5e6-96231b3b80d8 Tanya Lattner 10 years ago
2 changed file(s) with 21 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
778778 for (unsigned i = 1, e = PN->getNumIncomingValues(); i != e; ++i) {
779779 if (Tmp == 1) return Tmp;
780780 Tmp = std::min(Tmp,
781 ComputeNumSignBits(PN->getIncomingValue(1), TD, Depth+1));
781 ComputeNumSignBits(PN->getIncomingValue(i), TD, Depth+1));
782782 }
783783 return Tmp;
784784 }
5555 ; CHECK: %P = phi i64
5656 ; CHECK-NEXT: ret i64 %P
5757 }
58
59 ; rdar://7732987
60 define i32 @test5(i32 %Y) {
61 br i1 undef, label %A, label %C
62 A:
63 br i1 undef, label %B, label %D
64 B:
65 br label %D
66 C:
67 br i1 undef, label %D, label %E
68 D:
69 %P = phi i32 [0, %A], [0, %B], [%Y, %C]
70 %S = ashr i32 %P, 16
71 ret i32 %S
72 ; CHECK: @test5
73 ; CHECK: %P = phi i32
74 ; CHECK-NEXT: ashr i32 %P, 16
75 E:
76 ret i32 0
77 }