2009-09-11 18:01:28 +00:00
|
|
|
; RUN: opt < %s -basicaa -gvn -instcombine |\
|
2008-02-14 06:56:27 +00:00
|
|
|
; RUN: llvm-dis | grep {load i32\\* %A}
|
2005-03-09 16:29:22 +00:00
|
|
|
|
2008-02-14 06:56:27 +00:00
|
|
|
declare double* @useit(i32*)
|
2005-03-09 16:29:22 +00:00
|
|
|
|
2008-02-14 06:56:27 +00:00
|
|
|
define i32 @foo(i32 %Amt) {
|
|
|
|
%A = malloc i32, i32 %Amt
|
|
|
|
%P = call double* @useit(i32* %A)
|
2005-03-09 16:29:22 +00:00
|
|
|
|
2008-02-14 06:56:27 +00:00
|
|
|
%X = load i32* %A
|
2005-03-09 16:29:22 +00:00
|
|
|
store double 0.0, double* %P
|
2008-02-14 06:56:27 +00:00
|
|
|
%Y = load i32* %A
|
|
|
|
%Z = sub i32 %X, %Y
|
|
|
|
ret i32 %Z
|
2005-03-09 16:29:22 +00:00
|
|
|
}
|