1 ; RUN: opt < %s -aa-pipeline=basic-aa -passes=gvn -S | FileCheck %s
7 ; CHECK: %tmp0 = call i32 @TestConst(i32 5) [[READNONE:#[0-9]+]]
8 ; CHECK-NEXT: %tmp1 = call i32 @TestPure(i32 6) [[READONLY:#[0-9]+]]
9 ; CHECK-NEXT: %tmp2 = call i32 @TestNone(i32 7)
10 ; CHECK-NEXT: store i32 1, ptr @g
11 ; CHECK-NEXT: %tmp5 = call i32 @TestPure(i32 6) [[READONLY]]
12 ; CHECK-NEXT: %tmp7 = call i32 @TestNone(i32 7)
13 ; CHECK-NEXT: %tmp8 = call i32 @TestNone(i32 7)
14 ; CHECK-NEXT: %sum0 = add i32 %tmp0, %tmp1
15 ; CHECK-NEXT: %sum1 = add i32 %sum0, %tmp2
16 ; CHECK-NEXT: %sum2 = add i32 %sum1, %tmp0
17 ; CHECK-NEXT: %sum3 = add i32 %sum2, %tmp0
18 ; CHECK-NEXT: %sum4 = add i32 %sum3, %tmp5
19 ; CHECK-NEXT: %sum5 = add i32 %sum4, %tmp5
20 ; CHECK-NEXT: %sum6 = add i32 %sum5, %tmp7
21 ; CHECK-NEXT: %sum7 = add i32 %sum6, %tmp8
22 ; CHECK-NEXT: ret i32 %sum7
26 %tmp0 = call i32 @TestConst( i32 5 ) readnone ; <i32> [#uses=1]
27 %tmp1 = call i32 @TestPure( i32 6 ) readonly ; <i32> [#uses=1]
28 %tmp2 = call i32 @TestNone( i32 7 ) ; <i32> [#uses=1]
30 %tmp3 = call i32 @TestConst( i32 5 ) readnone ; <i32> [#uses=1]
31 %tmp4 = call i32 @TestConst( i32 5 ) readnone ; <i32> [#uses=1]
32 %tmp5 = call i32 @TestPure( i32 6 ) readonly ; <i32> [#uses=1]
33 %tmp6 = call i32 @TestPure( i32 6 ) readonly ; <i32> [#uses=1]
34 %tmp7 = call i32 @TestNone( i32 7 ) ; <i32> [#uses=1]
35 %tmp8 = call i32 @TestNone( i32 7 ) ; <i32> [#uses=1]
36 %sum0 = add i32 %tmp0, %tmp1 ; <i32> [#uses=1]
37 %sum1 = add i32 %sum0, %tmp2 ; <i32> [#uses=1]
38 %sum2 = add i32 %sum1, %tmp3 ; <i32> [#uses=1]
39 %sum3 = add i32 %sum2, %tmp4 ; <i32> [#uses=1]
40 %sum4 = add i32 %sum3, %tmp5 ; <i32> [#uses=1]
41 %sum5 = add i32 %sum4, %tmp6 ; <i32> [#uses=1]
42 %sum6 = add i32 %sum5, %tmp7 ; <i32> [#uses=1]
43 %sum7 = add i32 %sum6, %tmp8 ; <i32> [#uses=1]
47 declare i32 @TestConst(i32) readnone
49 declare i32 @TestPure(i32) readonly
51 declare i32 @TestNone(i32)
53 ; CHECK: attributes [[READNONE]] = { memory(none) }
54 ; CHECK: attributes [[READONLY]] = { memory(read) }