Replace the old ADCE implementation with a new one that more simply solves
[oota-llvm.git] / test / Transforms / ArgumentPromotion / aggregate-promote.ll
1 ; RUN: llvm-as < %s | opt -argpromotion -instcombine | not grep load
2
3 %QuadTy = type { i32, i32, i32, i32 }
4 @G = constant %QuadTy {
5     i32 0, 
6     i32 0, 
7     i32 17, 
8     i32 25 }            ; <%QuadTy*> [#uses=1]
9
10 define internal i32 @test(%QuadTy* %P) {
11         %A = getelementptr %QuadTy* %P, i64 0, i32 3            ; <i32*> [#uses=1]
12         %B = getelementptr %QuadTy* %P, i64 0, i32 2            ; <i32*> [#uses=1]
13         %a = load i32* %A               ; <i32> [#uses=1]
14         %b = load i32* %B               ; <i32> [#uses=1]
15         %V = add i32 %a, %b             ; <i32> [#uses=1]
16         ret i32 %V
17 }
18
19 define i32 @caller() {
20         %V = call i32 @test( %QuadTy* @G )              ; <i32> [#uses=1]
21         ret i32 %V
22 }
23