mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-25 04:39:44 +00:00
f2f6ce65b7
input filename so that opt doesn't print the input filename in the output so that grep lines in the tests don't unintentionally match strings in the input filename. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81537 91177308-0d34-0410-b5e6-96231b3b80d8
47 lines
907 B
LLVM
47 lines
907 B
LLVM
; Test that GCSE uses basicaa to do alias analysis, which is capable of
|
|
; disambiguating some obvious cases. All loads should be removable in
|
|
; this testcase.
|
|
|
|
; RUN: opt < %s -basicaa -gvn -instcombine -dce -S \
|
|
; RUN: | not grep load
|
|
|
|
@A = global i32 7
|
|
@B = global i32 8
|
|
|
|
define i32 @test() {
|
|
%A1 = load i32* @A
|
|
|
|
store i32 123, i32* @B ; Store cannot alias @A
|
|
|
|
%A2 = load i32* @A
|
|
%X = sub i32 %A1, %A2
|
|
ret i32 %X
|
|
}
|
|
|
|
define i32 @test2() {
|
|
%A1 = load i32* @A
|
|
br label %Loop
|
|
Loop:
|
|
%AP = phi i32 [0, %0], [%X, %Loop]
|
|
store i32 %AP, i32* @B ; Store cannot alias @A
|
|
|
|
%A2 = load i32* @A
|
|
%X = sub i32 %A1, %A2
|
|
%c = icmp eq i32 %X, 0
|
|
br i1 %c, label %out, label %Loop
|
|
|
|
out:
|
|
ret i32 %X
|
|
}
|
|
|
|
declare void @external()
|
|
|
|
define i32 @test3() {
|
|
%X = alloca i32
|
|
store i32 7, i32* %X
|
|
call void @external()
|
|
%V = load i32* %X
|
|
ret i32 %V
|
|
}
|
|
|