2010-10-19 02:04:47 +08:00
|
|
|
; RUN: opt %s -basicaa -gvn -S | FileCheck %s
|
2009-11-10 03:29:11 +08:00
|
|
|
|
|
|
|
%t = type { i32 }
|
|
|
|
declare void @test1f(i8*)
|
|
|
|
|
|
|
|
define void @test1(%t* noalias %stuff ) {
|
|
|
|
%p = getelementptr inbounds %t* %stuff, i32 0, i32 0
|
|
|
|
%before = load i32* %p
|
|
|
|
|
|
|
|
call void @test1f(i8* null)
|
|
|
|
|
|
|
|
%after = load i32* %p ; <--- This should be a dead load
|
2010-01-06 01:55:26 +08:00
|
|
|
%sum = add i32 %before, %after
|
2009-11-10 03:29:11 +08:00
|
|
|
|
|
|
|
store i32 %sum, i32* %p
|
|
|
|
ret void
|
|
|
|
; CHECK: load
|
|
|
|
; CHECK-NOT: load
|
|
|
|
; CHECK: ret void
|
|
|
|
}
|