llvm.org GIT mirror llvm / 66048c2
Fix a bug in LazyValueInfo that CorrelatedValuePropagation exposed: In the LVI lattice, undef and the full set ConstantRange should not be treated as equivalent. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112843 91177308-0d34-0410-b5e6-96231b3b80d8 Owen Anderson 9 years ago
2 changed file(s) with 25 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
172172 assert(isUndefined());
173173 if (NewR.isEmptySet())
174174 return markOverdefined();
175 else if (NewR.isFullSet()) {
176 Tag = undefined;
177 return true;
178 }
179175
180176 Tag = constantrange;
181177 Range = NewR;
0 ; RUN: opt -S < %s -correlated-propagation | FileCheck %s
1
2 ; CHECK: @check
3 define i16 @test(i32 %a, i1 %b) {
4 entry:
5 %c = icmp eq i32 %a, 0
6 br i1 %c, label %left, label %right
7
8 right:
9 %d = trunc i32 %a to i1
10 br label %merge
11
12 left:
13 br i1 %b, label %merge, label %other
14
15 other:
16 ret i16 23
17
18 merge:
19 %f = phi i1 [%b, %left], [%d, %right]
20 ; CHECK: select i1 %f, i16 1, i16 0
21 %h = select i1 %f, i16 1, i16 0
22 ; CHECK: ret i16 %h
23 ret i16 %h
24 }