llvm.org GIT mirror llvm / f92ff03
Fix for PR1741. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43326 91177308-0d34-0410-b5e6-96231b3b80d8 Owen Anderson 12 years ago
2 changed file(s) with 17 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
338338
339339 // Otherwise, nothing is known...
340340 } else if (O1 != O2) {
341 // If they are two different objects, we know that we have no alias...
342 return NoAlias;
341 if (!isa(O1))
342 // If they are two different objects, we know that we have no alias...
343 return NoAlias;
343344 }
344345
345346 // If they are the same object, they we can look at the indexes. If they
0 ; RUN: llvm-as < %s | opt -basicaa -gvn -dce | llvm-dis | grep tmp7
1
2 %struct.A = type { i32 }
3 %struct.B = type { %struct.A }
4 @a = global %struct.B zeroinitializer ; <%struct.B*> [#uses=2]
5
6 define i32 @_Z3fooP1A(%struct.A* %b) {
7 entry:
8 store i32 1, i32* getelementptr (%struct.B* @a, i32 0, i32 0, i32 0), align 8
9 %tmp4 = getelementptr %struct.A* %b, i32 0, i32 0 ; [#uses=1]
10 store i32 0, i32* %tmp4, align 4
11 %tmp7 = load i32* getelementptr (%struct.B* @a, i32 0, i32 0, i32 0), align 8 ; [#uses=1]
12 ret i32 %tmp7
13 }